:root {
  --bg: #f7f7f5; --card: #fff; --ink: #1c1e1b; --muted: #6f746a;
  --line: #e7e8e3; --brand: #ffc5c5; --brand-dark: #c56b72; --brand-soft: #fff2f3;
  --header: #1e211c; --accent: #ffc5c5; --on-brand: #3a2224; --radius: 8px; --wrap: 1160px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.right { text-align: right; }
h1 { font-size: 1.65rem; font-weight: 600; letter-spacing: -.01em; margin: 1.2rem 0 .6rem; }

/* Header */
.site-header { background: var(--header); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-tag { color: rgba(255,255,255,.55); font-size: .8rem; font-weight: 400; letter-spacing: .04em;
  padding-left: 10px; border-left: 1px solid rgba(255,255,255,.2); }
.search-bar { display: flex; flex: 1; max-width: 640px; }
.search-bar input { flex: 1; padding: 10px 14px; border: 1px solid transparent; border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius); font-size: .98rem; outline: none; background: #fff; }
.search-bar input:focus { box-shadow: inset 0 0 0 2px var(--brand); }
.search-bar button { padding: 10px 22px; background: var(--brand); color: var(--on-brand); border: 0;
  border-radius: 0 var(--radius) var(--radius) 0; font-size: .98rem; font-weight: 600; cursor: pointer; transition: background .15s; }
.search-bar button:hover { background: var(--brand-dark); }
.top-nav { display: flex; gap: 20px; }
.top-nav a { color: rgba(255,255,255,.8); font-weight: 500; font-size: .95rem; }
.top-nav a:hover { color: #fff; text-decoration: none; }

/* Hero */
.hero { text-align: center; padding: 72px 0 40px; }
.hero h1 { font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: .5rem; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 600px; margin: 0 auto 28px; }
.search-bar.big { max-width: 660px; margin: 0 auto; box-shadow: 0 6px 24px rgba(30,33,28,.08); border-radius: var(--radius); }
.search-bar.big input { padding: 16px 20px; font-size: 1.08rem; border: 1px solid var(--line); border-right: 0; }
.search-bar.big input:focus { box-shadow: inset 0 0 0 2px var(--brand); }
.hero-links { margin-top: 18px; color: var(--muted); font-size: .95rem; }
.hero-links a { color: var(--brand-dark); }

/* How-it-works */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 40px 0 56px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.how-item { background: var(--card); padding: 28px 24px; }
.how-item h3 { margin: 0 0 8px; color: var(--brand-dark); font-size: 1.05rem; font-weight: 600; }
.how-item p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Results layout */
.results-head { margin-top: 20px; }
.results-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; margin: 16px 0 48px; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: start; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.filters legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.price-range { display: flex; gap: 8px; }
.price-range input, .filters select { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.btn-filter { width: 100%; padding: 9px; background: var(--ink); color: #fff; border: 0; border-radius: 6px; cursor: pointer; font-weight: 600; }
.facet { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.facet h3 { margin: 0 0 8px; font-size: .95rem; }
.facet ul { list-style: none; margin: 0; padding: 0; }
.facet li a { display: flex; justify-content: space-between; padding: 4px 0; color: var(--ink); font-size: .9rem; }
.facet .cnt { color: var(--muted); font-size: .8rem; }
.clear-filters { display: inline-block; margin-top: 12px; color: #b91c1c; font-size: .9rem; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.card-img { display: block; aspect-ratio: 1; background: #fafafa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.noimg { color: var(--muted); font-size: .85rem; }
.noimg.big { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #fafafa; border-radius: var(--radius); }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { color: var(--ink); font-size: .9rem; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-brand { color: var(--muted); font-size: .8rem; }
.card-price { font-size: 1.25rem; font-weight: 700; color: var(--ink); margin-top: auto; }
.card-merchant { color: var(--muted); font-size: .8rem; }

.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 32px 0; }
.empty, .empty-page { text-align: center; padding: 40px; color: var(--muted); }

/* Product page */
.breadcrumb { margin: 16px 0; font-size: .9rem; color: var(--muted); }
.product-view { display: grid; grid-template-columns: 380px 1fr; gap: 32px; margin-bottom: 48px; }
.product-img img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.product-brand { margin: 4px 0; }
.offers { margin: 20px 0; }
.offers-table, .merchants-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.offers-table th, .offers-table td, .merchants-table th, .merchants-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.offers-table thead th, .merchants-table thead th { background: #fafafa; font-size: .85rem; color: var(--muted); }
.offers-table tr.best { background: #f0fdf4; }
.offers-table .price { font-weight: 700; font-size: 1.1rem; }
.badge { background: var(--accent); color: var(--on-brand); font-size: .7rem; padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.btn-shop { display: inline-block; padding: 8px 14px; background: var(--brand); color: var(--on-brand); border-radius: 6px; font-weight: 600; white-space: nowrap; }
.btn-shop:hover { background: var(--brand-dark); text-decoration: none; }
.product-desc { margin-top: 24px; }

.prose { max-width: 720px; }
.prose h2 { margin-top: 28px; }

/* Footer */
.site-footer { background: var(--card); border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0; }
.site-footer p { margin: 4px 0; font-size: .9rem; }

@media (max-width: 860px) {
  .results-layout, .product-view { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .search-bar { order: 3; flex-basis: 100%; max-width: none; }
}
