/* Inter, self-hosted (no visitor IPs sent to Google). SIL Open Font License: fonts/LICENSE-Inter.txt */
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --bg: #f2f4f7; --panel: #ffffff; --ink: #1b2330; --muted: #677285; --line: #e3e7ee; --soft: #f6f8fb;
  --brand: #14284b; --brand-2: #1d3a6b; --brand-ink: #ffffff;
  --cta: #ff7a00; --cta-hover: #ec6c00; --cta-ink: #ffffff;
  --link: #1a66d6; --good: #1f9d55; --good-bg: #e7f6ee; --bad: #c2410c; --bad-bg: #fdeee6;
  --save: #e11d48; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-hover: 0 8px 24px rgba(16, 24, 40, .12);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141c; --panel: #171e29; --ink: #e7ebf2; --muted: #95a0b3; --line: #273142; --soft: #1c2431;
    --brand: #0b1526; --brand-2: #142542;
    --link: #6aa5ff; --good: #4ade80; --good-bg: #133222; --bad: #fb923c; --bad-bg: #3a2113;
    --save: #fb7185; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-hover: 0 8px 24px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* ---------- header ---------- */
.top { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.top-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { color: #fff; font-weight: 800; font-size: 22px; letter-spacing: -.02em; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--cta); font-weight: 800; }
.logo-text { white-space: nowrap; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.12); font-size: 19px; }
.logo.small { font-size: 18px; color: var(--ink); }
.search { flex: 1; display: flex; align-items: center; background: #fff; border-radius: 999px; padding: 4px 4px 4px 16px; max-width: 760px; }
.search-ico { width: 20px; height: 20px; fill: #8a94a6; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 10px 12px; font: inherit; font-size: 16px; color: #1b2330; background: transparent; }
.search button { border: 0; background: var(--cta); color: var(--cta-ink); font: inherit; font-weight: 700; padding: 10px 22px; border-radius: 999px; cursor: pointer; }
.search button:hover { background: var(--cta-hover); }
.top-nav a { color: #fff; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.top-nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }

.catbar { background: var(--panel); border-bottom: 1px solid var(--line); color: var(--ink); }
.catbar-inner { display: flex; justify-content: space-between; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.catbar-inner::-webkit-scrollbar { display: none; }
.catbar a { color: var(--ink); white-space: nowrap; padding: 11px 12px; font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent; display: flex; gap: 6px; align-items: center; }
.catbar a:hover { text-decoration: none; background: var(--soft); }
.catbar a.on { border-bottom-color: var(--cta); font-weight: 700; }

.main { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }

/* ---------- buttons, pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; background: var(--cta); color: var(--cta-ink); font: inherit; font-weight: 700; padding: 10px 18px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--cta-hover); text-decoration: none; }
.btn-big { padding: 14px 26px; font-size: 16px; }
.btn-ghost { background: transparent; color: var(--link); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--soft); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.stock { font-size: 13px; font-weight: 600; color: var(--muted); }
.stock.yes { color: var(--good); } .stock.no { color: var(--bad); }
.stock.yes::before { content: "● "; font-size: 10px; vertical-align: 1px; }

/* ---------- home ---------- */
.hero { background: linear-gradient(120deg, var(--brand-2), var(--brand)); color: #fff; border-radius: 16px; padding: 28px 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.02em; }
.hero p { margin: 0; color: #cfd8ea; max-width: 560px; } .hero p b { color: #fff; }
.hero-stats { display: flex; gap: 12px; }
.hero-stats div { background: rgba(255,255,255,.09); border-radius: 12px; padding: 12px 18px; text-align: center; min-width: 110px; }
.hero-stats b { display: block; font-size: 22px; } .hero-stats span { font-size: 12px; color: #cfd8ea; }

.sec-title { font-size: 21px; letter-spacing: -.01em; margin: 30px 0 14px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-head a { font-weight: 600; font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s; }
.tile:hover { box-shadow: var(--shadow-hover); }
.tile-main { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; color: var(--ink); }
.tile-main:hover { text-decoration: none; } .tile-main:hover .tile-name { color: var(--link); }
.tile-ico { grid-row: span 2; font-size: 30px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--soft); border-radius: 12px; }
.tile-name { font-weight: 700; font-size: 15px; line-height: 1.25; } .tile-n { font-size: 12px; color: var(--muted); }
.tile-subs { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }

/* One row of cards that fits the width; extra cards are hidden instead of scrolling. */
.row-one { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-template-rows: auto; grid-auto-rows: 0; row-gap: 0; column-gap: 12px; overflow: hidden; padding: 4px; margin: -4px; }

.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.subcats a { background: var(--panel); box-shadow: var(--shadow); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.subcats a b { color: var(--muted); font-weight: 500; margin-left: 2px; }
.subcats a:hover { text-decoration: none; box-shadow: var(--shadow-hover); }
.subcats a.on { background: var(--brand); color: #fff; } .subcats a.on b { color: #cfd8ea; }

/* ---------- listing ---------- */
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.filters { position: sticky; top: 130px; }
.filters-box { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px 16px; }
.filters-box summary { font-weight: 700; font-size: 16px; padding: 12px 0; cursor: pointer; list-style: none; }
.filters-box summary::-webkit-details-marker { display: none; }
.filters-box summary::after { content: "▾"; float: right; color: var(--muted); }
.f-group { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.f-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filters select, .filters input[type=number] { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); font: inherit; font-size: 14px; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--cta); }
.filters .btn { width: 100%; margin-top: 4px; }

.results-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.results-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.sort-tabs { display: flex; gap: 4px; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.sort-tabs a { color: var(--ink); padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.sort-tabs a:hover { background: var(--soft); text-decoration: none; }
.sort-tabs a.on { background: var(--brand); color: #fff; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.card:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.thumb { aspect-ratio: 1; background: #fff; position: relative; display: grid; place-items: center; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px; background: #fff; }
.thumb .ph, .pd-img .ph { font-size: 48px; opacity: .35; }
.thumb img, .pd-img img { z-index: 1; }
.badge-save { position: absolute; top: 10px; left: 10px; background: var(--save); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 6px; z-index: 1; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; border-top: 1px solid var(--line); }
.name { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.price-row { margin-top: auto; }
.price { font-weight: 800; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; }
.price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.cmp { font-size: 13px; font-weight: 600; color: var(--muted); }
.cmp.multi { color: var(--link); }
.empty { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 28px 0 0; }
.pager a { background: var(--panel); box-shadow: var(--shadow); padding: 9px 16px; border-radius: 10px; font-weight: 600; }

/* ---------- product ---------- */
.crumbs { font-size: 14px; display: flex; gap: 8px; color: var(--muted); margin-bottom: 12px; }
.pd { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 28px; padding: 24px; }
.pd-img { aspect-ratio: 1; background: #fff; border-radius: 12px; position: relative; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.pd-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.pd-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pd-info h1 { margin: 0; font-size: 26px; line-height: 1.25; letter-spacing: -.02em; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.pd-meta b { color: var(--ink); }
.pd-buy { margin-top: auto; background: var(--soft); border-radius: 12px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pd-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.pd-price small { font-size: 16px; font-weight: 500; color: var(--muted); }
.pd-range { font-size: 14px; color: var(--muted); margin: 4px 0; } .pd-range b { color: var(--save); }

.offers { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.offer { display: grid; grid-template-columns: 1fr 160px 140px 150px; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.offer:last-child { border-bottom: 0; }
.offer.best { background: var(--good-bg); }
.offer.gone { opacity: .5; }
.o-shop b { font-size: 16px; }
.o-title { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; background: var(--good); color: #fff; padding: 2px 8px; border-radius: 999px; vertical-align: 2px; }
.o-price { font-size: 20px; font-weight: 800; text-align: right; white-space: nowrap; }
.o-price small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.btn-shop { width: 100%; }

.chart { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); }
.chart .axis { fill: var(--muted); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; padding: 8px 4px 0; }
.legend i { display: inline-block; width: 14px; height: 4px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }

/* ---------- shops ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.shop-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.sc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.sc-url { font-size: 13px; color: var(--muted); }
.sc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-stats div { background: var(--soft); border-radius: 10px; padding: 10px; }
.sc-stats b { display: block; font-size: 20px; } .sc-stats span { font-size: 12px; color: var(--muted); }
.sc-foot { font-size: 12px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot-inner { display: grid; grid-template-columns: 1.2fr 1fr 1.5fr; gap: 32px; padding-top: 32px; padding-bottom: 32px; }
.foot h4 { color: var(--ink); margin: 0 0 10px; font-size: 14px; }
.foot-inner a { display: block; color: var(--muted); margin-bottom: 6px; }
.foot p { margin: 8px 0 0; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .pd { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .pd-img { max-height: 340px; aspect-ratio: auto; height: 300px; }
  .offer { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 16px; }
  .o-stock { grid-row: 2; } .o-price { grid-row: 1; grid-column: 2; }
  .btn-shop { grid-column: 2; grid-row: 2; }
  .foot-inner { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 640px) {
  .top-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px 16px; }
  .search { order: 3; flex: 1 1 100%; max-width: 100%; min-width: 0; }
  .search button { padding: 10px 16px; }
  .top-nav { margin-left: auto; }
  .filters { top: auto; }
  .hero { padding: 20px; } .hero h1 { font-size: 23px; }
  .hero-stats { width: 100%; } .hero-stats div { flex: 1; min-width: 0; padding: 10px 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-body { padding: 10px; } .price { font-size: 17px; }
  .tiles { grid-template-columns: 1fr; gap: 8px; }
  .row-one { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
  .results-head h1 { font-size: 21px; }
  .pd-info h1 { font-size: 21px; } .pd-price { font-size: 28px; }
  .btn-big { width: 100%; }
}

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.center { text-align: center; margin: 28px 0 8px; }
.empty h1 { color: var(--ink); font-size: 22px; margin: 0 0 8px; }
