/* The static SEO pages (scraper/pages.py). Same colours and cards as the app (web/index.html). */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #191b1f; --muted: #646973; --line: #e1e4e9;
  --accent: #2a4f8f; --accent-ink: #ffffff; --sale: #c2410c; --good: #15803d; --chip: #eceef2;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518; --panel: #1d1f23; --ink: #e9eaee; --muted: #9a9fa9; --line: #30333a;
    --accent: #8fb3f0; --accent-ink: #0f1a2c; --sale: #fb923c; --good: #4ade80; --chip: #272a30;
  }
}
/* Sofia Sans (Lettersoup, OFL: web/fonts/SofiaSans-OFL.txt), self-hosted: the CSP allows only our own fonts, and
   Google's servers would see every visitor. One variable woff2 subset (Latin, Latin Ext-A, Cyrillic, €), made from
   google/fonts' SofiaSans[wght].ttf with fontTools to keep tabular figures (tnum), which Google's own files drop.
   Its default Cyrillic is the Bulgarian form (lang="bg"); a locl rule gives Russian shapes only for lang="ru". */
@font-face { font-family: "Sofia Sans"; src: url("/fonts/SofiaSans-var.woff2") format("woff2"); font-weight: 1 1000; font-style: normal; font-display: swap; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 16px/1.55 "Sofia Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }

header.top { display: flex; align-items: center; gap: 12px 32px; flex-wrap: wrap; padding: 18px 24px 10px; max-width: 1240px; width: 100%; margin: 0 auto; }
.brand-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-link:hover .brand-name { color: var(--accent); }
.logo { width: 48px; height: 48px; flex: none; }
.logo .a { stroke: var(--accent); } .logo .ah { fill: var(--accent); } .logo .p { stroke: var(--sale); }
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
.brand-sub { font-size: 14px; color: var(--muted); }
header nav.cats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
header nav.cats a { color: var(--muted); text-decoration: none; padding: 2px 0; }
header nav.cats a:hover, header nav.cats a[aria-current] { color: var(--accent); }

main.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 8px 24px 40px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 6px 0 4px; }
.crumbs a { color: var(--muted); }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.015em; margin: 4px 0 12px; }
h2 { font-size: 20px; letter-spacing: -0.01em; margin: 34px 0 12px; }
.lead { max-width: 820px; font-size: 16px; }
/* The intro: number tiles (3 x 2 or 2 x 2) beside the "Най-евтина в момента" card; on a phone, 2 tiles per row
   and the card under them. */
.lead-block { display: flex; flex-direction: column; gap: 16px; margin: 4px 0 18px; }
.cta-row { margin: 0; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 25%); gap: 16px; align-items: stretch; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.stat dd { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat dt { font-size: 13px; line-height: 1.35; color: var(--muted); }
.deal { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1.5px solid var(--good); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.deal .eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--good); }
.deal-main { display: flex; gap: 12px; align-items: flex-start; }
.deal-img { flex: none; width: 76px; height: 76px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.deal-img img { width: 100%; height: 100%; object-fit: contain; }
.deal-name { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.deal-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }
.deal-price { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.deal-store { color: var(--muted); font-size: 14px; }
.deal-more { color: var(--good); font-size: 13px; font-weight: 600; margin-top: -6px; }
.deal .cta { text-align: center; }
@media (max-width: 820px) {
  .intro { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .lead-block { gap: 12px; }
  .cta-row { order: -1; }   /* right under the title */
  .cta-row .cta { display: block; text-align: center; padding: 12px 16px; }
  .stats, .stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat dd { font-size: 22px; }
}
.cta { display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.cta:hover { filter: brightness(1.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 5px 12px; font-size: 14px; text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card a { color: inherit; text-decoration: none; }
.card > a.main { display: flex; flex-direction: column; flex: 1; }
.img { aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.img img { width: 100%; height: 100%; object-fit: contain; }
.store { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px; }
.body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.name { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 11px; background: var(--chip); border-radius: 5px; padding: 1px 6px; color: var(--muted); }
.price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .now { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price .drop { color: var(--good); font-size: 12px; font-weight: 600; }
.best { color: var(--good); font-size: 12px; font-weight: 600; }
.offers { border-top: 1px solid var(--line); padding: 6px 12px 10px; font-size: 13px; }
.offers a { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.offers a:hover .o-store { color: var(--accent); text-decoration: underline; }
.offers a:first-child .o-price { color: var(--good); }
.offers .o-price { font-variant-numeric: tabular-nums; font-weight: 600; }
.more-offers { display: block; color: var(--muted); font-size: 12px; padding-top: 2px; }

.seg { display: inline-block; vertical-align: top; width: 100%; max-width: 520px; margin-right: 32px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td:nth-child(2), td:nth-child(3), th:nth-child(2), th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

.guide, .faq { max-width: 820px; }
.guide ul { padding-left: 20px; }
.guide li { margin: 4px 0; }
/* FAQ accordion (<details name="faq">): one answer open at a time. */
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; transition: border-color .15s; }
.faq details[open] { border-color: var(--accent); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(-135deg) translateX(-3px); border-color: var(--accent); }
.faq summary:hover h3 { color: var(--accent); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.faq h3 { font-size: 16px; margin: 0; font-weight: 600; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--ink); }
.updated { margin-top: 36px; color: var(--muted); font-size: 13px; }

.foot { margin-top: auto; padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }
.foot a { color: var(--accent); }
.foot button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.consent { position: fixed; z-index: 30; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; padding: 14px 16px; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.consent p { margin: 0 0 10px; }
.consent .actions { display: flex; gap: 8px; justify-content: flex-end; }
/* Both choices look the same: refusing must be as easy as accepting. */
.consent button { padding: 8px 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--panel); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

@media (max-width: 820px) {
  header.top { padding: 14px 16px 6px; }
  main.page { padding: 4px 16px 32px; }
  h1 { font-size: 24px; }
  .lead { font-size: 15px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .seg { margin-right: 0; }
}

/* Back to the top, as in the app: shown once the page has scrolled 600px. */
.to-top { position: fixed; z-index: 20; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer; }
.to-top:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
