/* PriceScout: one stylesheet. Colors live in the tokens below. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #6b6f78;
  --line: #e4e0d6;
  --accent: #ff5b2e;
  --accent-ink: #ffffff;
  --good: #1a8f4c;
  --good-soft: #e2f4e8;
  --fair: #f3e9cf;
  --shadow: 0 1px 2px rgba(22, 24, 29, .06), 0 8px 24px rgba(22, 24, 29, .06);
  --radius: 16px;
  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1a1c20;
    --ink: #f2f0ea;
    --muted: #9a9ea7;
    --line: #2b2e35;
    --accent: #ff6a3d;
    --good: #43d17f;
    --good-soft: #15301f;
    --fair: #2e2919;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main, .topbar, .ad--top, .footer { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 22px/1 var(--font-head); letter-spacing: -.02em; }
.brand b { font-weight: 800; color: var(--accent); }
.brand__tag {
  display: grid; place-items: center; width: 32px; height: 32px;
  background: var(--ink); color: var(--bg); border-radius: 8px 8px 8px 2px;
  font-weight: 800; transform: rotate(-8deg);
}
.topbar__nav { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.topbar__nav a { text-decoration: none; color: var(--muted); }
.topbar__nav a:hover { color: var(--ink); }
select {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; cursor: pointer;
}

/* ---------- Ads ---------- */
.ad {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--surface);
  padding: 12px 16px; font-size: 14px; color: var(--muted);
}
.ad__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted);
}
.ad__body { flex: 1; min-width: 200px; }
.ad__cta { font-weight: 700; color: var(--ink); text-decoration: none; }
.ad__cta::after { content: " →"; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; text-align: center; }
.eyebrow { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.03em; margin: 0; }
h1 { font-size: clamp(40px, 7vw, 84px); line-height: .98; font-weight: 800; }
.hl { color: var(--accent); }
.hero__sub { max-width: 560px; margin: 18px auto 30px; color: var(--muted); font-size: 18px; }

.search {
  position: relative; display: flex; gap: 8px; max-width: 680px; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 18px;
  padding: 8px; box-shadow: 6px 6px 0 var(--ink);
}
.search__icon { width: 22px; height: 22px; align-self: center; margin-left: 10px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 18px; padding: 10px 6px; }
.search button {
  border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; padding: 12px 22px; cursor: pointer; white-space: nowrap;
}
.search button:hover { filter: brightness(1.05); }
.search:focus-within { box-shadow: 6px 6px 0 var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 22px; }
.chips__label { font-size: 14px; color: var(--muted); }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips--small { margin: 0; justify-content: flex-start; }
.chips--small .chip { padding: 4px 10px; font-size: 13px; }

/* ---------- Searching display ---------- */
.scan {
  max-width: 680px; margin: 0 auto 48px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.scan__head { display: flex; align-items: center; gap: 18px; }
.scan__title { margin: 0; font: 600 20px/1.2 var(--font-head); }
.scan__count { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.scan__count span { color: var(--good); font-weight: 700; font-variant-numeric: tabular-nums; }
.scan__radar { position: relative; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--good-soft); }
.scan__radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--good); opacity: 0; animation: ping 1.8s ease-out infinite; }
.scan__radar span:nth-child(2) { animation-delay: .6s; }
.scan__radar span:nth-child(3) { animation-delay: 1.2s; }
@keyframes ping { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.15); opacity: 0; } }

.scan__bar { height: 6px; background: var(--bg); border-radius: 999px; margin: 20px 0 16px; overflow: hidden; }
.scan__bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .35s ease; }

.scan__countries { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.scan__countries li {
  font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); transition: background .3s, color .3s, border-color .3s;
}
.scan__countries li.is-active { border-color: var(--accent); color: var(--ink); }
.scan__countries li.is-done { background: var(--good-soft); border-color: transparent; color: var(--ink); }

.scan__log { list-style: none; padding: 0; margin: 0; height: 132px; overflow: hidden; font-size: 14px; mask-image: linear-gradient(to bottom, transparent, #000 30%); }
.scan__log li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); animation: slide-in .3s ease both; }
.scan__log li span:last-child { color: var(--good); font-weight: 700; }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Results ---------- */
.results { padding-bottom: 56px; }
.results__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.results__head h2 { font-size: clamp(28px, 4vw, 40px); }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge--live { background: var(--good-soft); color: var(--good); }
.badge--demo { background: var(--fair); color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Price range */
.range { padding: 24px; }
.range__verdict { margin: 0 0 22px; font-size: 18px; }
.range__verdict b { font-family: var(--font-head); }
.range__track { position: relative; height: 44px; margin: 0 8px; }
.range__line { position: absolute; left: 0; right: 0; top: 20px; height: 4px; background: var(--line); border-radius: 4px; }
.range__fair { position: absolute; top: 12px; height: 20px; background: var(--fair); border-radius: 6px; }
.range__dot {
  position: absolute; top: 17px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--muted); opacity: .55; border: 0; padding: 0; cursor: pointer;
}
.range__dot--best { background: var(--good); opacity: 1; width: 14px; height: 14px; margin-left: -7px; top: 15px; box-shadow: 0 0 0 4px var(--good-soft); }
.range__labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 14px; }
.range__labels div { display: flex; flex-direction: column; }
.range__labels div:nth-child(2) { text-align: center; }
.range__labels div:last-child { text-align: right; }
.range__labels small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.range__labels b { font: 700 20px/1.2 var(--font-head); }
.range__labels .is-low b { color: var(--good); }

.section-label { font-size: 22px; margin: 36px 0 14px; }
.section-label span { color: var(--muted); font-weight: 600; }

/* Picks */
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pick { padding: 20px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; transition: transform .15s ease, border-color .15s; }
.pick:hover { transform: translateY(-2px); border-color: var(--ink); }
.pick__kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pick--cheapest { border: 2px solid var(--good); }
.pick--cheapest .pick__kind { color: var(--good); }
.pick__price { font: 800 34px/1.05 var(--font-head); letter-spacing: -.03em; }
.pick__store { font-weight: 700; }
.pick__title { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick__why { margin-top: auto; padding-top: 10px; font-size: 14px; border-top: 1px solid var(--line); }
.pick__why b { color: var(--good); }

/* Offer list */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.list-head .section-label { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.offers { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.offer {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 16px;
}
.offer.is-best { border: 2px solid var(--good); }
.offer__thumb {
  width: 56px; height: 56px; border-radius: 12px; background: var(--bg); display: grid; place-items: center;
  font: 800 22px/1 var(--font-head); color: var(--muted); overflow: hidden;
}
.offer__thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.offer__title { margin: 0; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.offer__meta b { color: var(--ink); font-weight: 700; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--ink); }
.tag--good { background: var(--good-soft); color: var(--good); }
.tag--warn { background: var(--fair); }
.offer__price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.offer__price strong { font: 800 22px/1.1 var(--font-head); letter-spacing: -.02em; }
.offer__price small { color: var(--muted); font-size: 12px; }
.go {
  margin-top: 6px; display: inline-block; text-decoration: none; font-size: 14px; font-weight: 700;
  padding: 7px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); white-space: nowrap;
}
.go:hover { background: var(--accent); color: var(--accent-ink); }
.ad--inline { margin: 0; }

.link-btn { margin-top: 14px; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }
.fineprint { margin-top: 24px; font-size: 13px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- How it works ---------- */
.how { padding: 56px 0; border-top: 1px solid var(--line); }
.how h2 { font-size: 32px; margin-bottom: 20px; }
.how__steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; color: var(--muted); }
.how__steps b { display: block; color: var(--ink); font-family: var(--font-head); font-size: 19px; margin-bottom: 6px; }

.footer { padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- Phone width ---------- */
@media (max-width: 760px) {
  .topbar__nav a { display: none; }
  .hero { padding: 40px 0 28px; }
  .hero__sub { font-size: 16px; }
  .search { flex-wrap: wrap; box-shadow: 4px 4px 0 var(--ink); }
  .search input { font-size: 16px; }
  .search button { width: 100%; }
  .picks, .how__steps { grid-template-columns: 1fr; }
  .results__head { flex-direction: column; align-items: flex-start; }
  .offer { grid-template-columns: 44px 1fr; gap: 12px; }
  .offer__thumb { width: 44px; height: 44px; font-size: 18px; }
  .offer__price { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; flex-wrap: wrap; }
  .offer__price .go { margin-top: 0; }
  .range__labels b { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Product photos ---------- */
.photo {
  display: grid; place-items: center; flex: none; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}
.photo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.photo svg { width: 46%; height: 46%; fill: none; stroke: #b9b4a8; stroke-width: 1.5; stroke-linejoin: round; }
.photo--sug { width: 44px; height: 44px; border-radius: 10px; }
.photo--hero { width: 96px; height: 96px; border-radius: 16px; }
.photo--pick { width: 64px; height: 64px; margin-bottom: 6px; }
.offer__thumb { width: 56px; height: 56px; }
@media (prefers-color-scheme: dark) {
  .photo { border-color: transparent; }
  .photo svg { stroke: #8d887c; }
}

/* ---------- Suggestions dropdown ---------- */
.suggest {
  position: absolute; left: -2px; right: -2px; top: calc(100% + 10px); z-index: 20;
  list-style: none; margin: 0; padding: 6px; text-align: left;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink);
}
.suggest li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.suggest li:hover, .suggest li.is-active { background: var(--bg); }
.suggest__text { display: flex; flex-direction: column; min-width: 0; }
.suggest__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); line-height: 1.3; }
.suggest__title b { color: var(--ink); font-weight: 700; }
.suggest small { color: var(--good); font-weight: 700; font-size: 13px; }

/* Results header with the product photo */
.results__head { align-items: center; justify-content: flex-start; }
.results__name { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .results__head { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .photo--hero { width: 72px; height: 72px; }
  .offer__thumb { width: 44px; height: 44px; }
  .suggest { box-shadow: 4px 4px 0 var(--ink); }
}

/* Demo-mode notice above the results */
.demo-note {
  margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; font-size: 14px;
  background: var(--fair); color: var(--ink);
}

/* ---------- Step 1: choose the product ---------- */
.choose { padding: 8px 0 56px; scroll-margin-top: 16px; }
.choose h2 { font-size: clamp(28px, 4vw, 40px); }
.choose__sub { margin: 6px 0 22px; color: var(--muted); }
.choices { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.choice {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; cursor: pointer; transition: transform .15s ease, border-color .15s;
}
.choice:hover, .choice:focus-visible { transform: translateY(-2px); border-color: var(--ink); outline: none; }
.photo--choice { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 6px; border-radius: 12px; }
.photo--choice svg { width: 34%; height: 34%; }
.choice__title { font-weight: 700; line-height: 1.3; }
.choice__price { font-size: 14px; color: var(--muted); }
.choice__price b { color: var(--good); font-family: var(--font-head); font-size: 17px; }
.choice__meta { font-size: 12px; color: var(--muted); }
.choice.is-loading { cursor: default; }
.skel { display: block; height: 14px; width: 80%; border-radius: 6px; background: var(--bg); animation: pulse 1.2s ease-in-out infinite; }
.skel--short { width: 45%; }
.is-loading .photo { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
#choose-all { margin-top: 20px; }

/* ---------- Step 2: results with a filter panel ---------- */
.back { margin: 0 0 14px; text-decoration: none; font-weight: 700; color: var(--ink); }
.results__body { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.results__main { min-width: 0; }
.results__main > .section-label:first-of-type { margin-top: 28px; }
.filters-toggle { display: none; }

.filters-panel {
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.filters__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.filters__head .link-btn { margin: 0; font-size: 14px; }
.fgroup { border: 0; padding: 12px 0 0; margin: 12px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.fgroup legend { float: left; width: 100%; padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fchips { clear: both; display: flex; flex-wrap: wrap; gap: 6px; }
.fchips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 13px; }
.fchips .chip small { color: var(--muted); font-size: 11px; }
.fchips .chip[aria-pressed="true"] small { color: inherit; opacity: .7; }
.fchips .chip:disabled { opacity: .4; cursor: default; }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); flex: none; }
.fprice { clear: both; display: flex; align-items: center; gap: 8px; }
.fprice input {
  width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.list-head select { margin-top: 36px; }

@media (max-width: 900px) {
  .results__body { grid-template-columns: 1fr; }
  .filters-toggle {
    display: inline-flex; margin-bottom: 14px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
    border: 2px solid var(--ink); background: var(--surface); font-weight: 700;
  }
  .filters-panel { display: none; position: static; max-height: none; }
  .filters-panel.is-open { display: block; }
  .choices { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .choice { padding: 10px; }
  .list-head select { margin-top: 12px; }
}

/* Store logos */
.logo { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; background: #fff; object-fit: contain; }
.offer__store { display: inline-flex; align-items: center; gap: 4px; }
.offer__store .logo { margin-right: 2px; }
