/* BoxScout prototype. No external fonts or libraries: everything works offline. */
:root {
  --bg: #0d0f13;
  --surface: #161a20;
  --surface-2: #1f242c;
  --ink: #eef0f3;
  --ink-2: #b9bfca;
  --muted: #858d9b;
  --line: #2a303a;
  --tag: #ffd60a;          /* price-tag yellow: best price and the main button */
  --tag-ink: #14161a;
  --link: #8fb0ff;
  --chart: #5f8cf0;        /* passes the dataviz validator on the dark surface; light theme uses #1a4fd6 */
  --good: #5fd08b;
  --bad: #ff8a80;
  --top: #07080a;
  --radius: 12px;
  --wrap: 1200px;
  --display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #ebe8df;
  --ink: #14161a;
  --ink-2: #454a54;
  --muted: #6a707c;
  --line: #dcd8cc;
  --link: #1a4fd6;
  --chart: #1a4fd6;
  --good: #1b7a43;
  --bad: #b3261e;
  --top: #14161a;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); font-variant-numeric: tabular-nums; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
h1, h2, h3, .display { font-family: var(--display); font-stretch: 85%; letter-spacing: .005em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 700; }
h2 { font-size: 26px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- header */
.top { background: var(--top); color: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { font-family: var(--display); font-size: 24px; font-weight: 700; color: #fff; letter-spacing: .02em; display: flex; align-items: center; gap: 9px; }
.logo:hover { text-decoration: none; }
.logo i { display: inline-block; width: 22px; height: 16px; background: var(--tag); clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%); }
.nav { display: flex; gap: 16px; flex-wrap: wrap; flex: 1; }
.nav a { color: #c9cdd6; font-size: 15px; padding: 4px 0; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a[aria-current] { color: #fff; box-shadow: 0 2px 0 var(--tag); }
.prefs { display: flex; gap: 8px; align-items: center; }
.prefs select, .prefs button, .prefs a { background: #1c2027; color: #fff; border: 1px solid #343a45; border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.prefs a:hover { text-decoration: none; border-color: #fff; }

/* ---------- hero */
.hero { padding: 40px 0 22px; }
.hero h1 mark { background: var(--tag); color: var(--tag-ink); padding: 0 .16em; border-radius: 5px; }
.hero .sub { color: var(--ink-2); max-width: 66ch; margin: 12px 0 0; }
.live { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.search { margin-top: 20px; position: relative; max-width: 660px; }
.search input { width: 100%; font: inherit; font-size: 17px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.search input:focus { outline: 2px solid var(--tag); outline-offset: 1px; }
.results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 40px rgba(0,0,0,.4); max-height: 420px; overflow: auto; display: none; }
.results.open { display: block; }
.results a { display: flex; justify-content: space-between; gap: 14px; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--line); }
.results a:last-child { border-bottom: 0; }
.results a:hover { background: var(--surface-2); text-decoration: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.chips a { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 14px; }
.chips a:hover { border-color: var(--tag); text-decoration: none; }
.chips a b { color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ---------- sections and cards */
section { padding: 24px 0; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.head p { margin: 6px 0 0; color: var(--ink-2); max-width: 72ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; color: var(--ink); overflow: hidden; position: relative; }
.pcard:hover { text-decoration: none; border-color: var(--tag); }
.pcard .pic { background: #fff; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.pcard .pic img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
/* no shop photo: a plain tile with the brand and the box format */
.pcard .pic.none, .phero .pic.none { background: var(--surface-2); flex-direction: column; gap: 6px; text-align: center; padding: 12px; }
.pic.none .ph-brand { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.pic.none .ph-format { font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.phero .pic.none .ph-brand { font-size: 44px; }
.phero .pic.none .ph-format { font-size: 14px; }
.pcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard .kicker { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pcard .name { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .from { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); }
.pcard .price { font-family: var(--display); font-size: 25px; font-weight: 700; line-height: 1.1; display: block; color: var(--ink); }
.pcard .foot { font-size: 12.5px; color: var(--ink-2); }
.badge { position: absolute; top: 10px; right: 10px; background: var(--tag); color: var(--tag-ink); font-family: var(--display); font-weight: 700; font-size: 15px; padding: 3px 9px; border-radius: 6px; }
.dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--good); }
.dot.off { color: var(--muted); }
.dot.off::before { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-2); vertical-align: 1px; }
.chip.warn { border-color: var(--bad); color: var(--bad); }
.btn { display: inline-block; background: var(--tag); color: var(--tag-ink); font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 8px; white-space: nowrap; border: 0; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(.94); }
.btn.big { font-size: 18px; padding: 13px 22px; }
.more { font-size: 14px; }

/* ---------- product page */
.crumbs { font-size: 13px; color: var(--muted); padding: 18px 0 12px; }
.crumbs a { color: var(--muted); }
.phero { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 28px; align-items: start; }
.phero .pic { background: #fff; border-radius: var(--radius); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 18px; border: 1px solid var(--line); }
.phero .pic img { width: 100%; height: 100%; object-fit: contain; }
.phero h1 { font-size: clamp(26px, 3.4vw, 40px); margin-top: 10px; }
.phero .lede { color: var(--ink-2); margin: 12px 0 0; max-width: 62ch; }
.bigprice { font-family: var(--display); font-size: clamp(40px, 6vw, 60px); font-weight: 700; line-height: 1; margin-top: 18px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.bigprice small { font-family: var(--body); font-size: 14px; font-weight: 400; color: var(--muted); }
.cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.flags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.flag { font-size: 13px; padding: 5px 10px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); }
.flag.hot { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; }
.tile span { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tile b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.2; margin-top: 3px; }
.tile small { color: var(--ink-2); font-size: 13px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar select, .toolbar input[type=text] { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.toolbar label { font-size: 14px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.offers { display: flex; flex-direction: column; }
.offer { display: grid; grid-template-columns: 1.4fr .8fr 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.offer:last-child { border-bottom: 0; }
.offer.best { box-shadow: inset 3px 0 0 var(--tag); }
.offer .shop { font-weight: 600; font-size: 16px; }
.offer .shop small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.offer .p { text-align: right; }
.offer .p b { font-family: var(--display); font-size: 22px; font-weight: 700; }
.offer.best .p b { background: var(--tag); color: var(--tag-ink); padding: 1px 8px; border-radius: 6px; }
.offer .p small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.offer.oos { opacity: .62; }
.offer.oos .btn { background: var(--surface-2); color: var(--ink-2); }
.offer[hidden] { display: none; }
.note { font-size: 13px; color: var(--muted); padding: 12px 16px; border-top: 1px solid var(--line); }
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
table.kv tr:last-child td { border-bottom: 0; }
table.kv td:first-child { color: var(--muted); width: 40%; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
table.list tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }

/* ---------- chart */
.chartbox { padding: 14px 16px 8px; position: relative; }
.chartbox svg { width: 100%; height: 250px; display: block; overflow: visible; }
.chartbox .grid { stroke: var(--line); stroke-width: 1; }
.chartbox .axis { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.chartbox .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chartbox .dotm { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.chartbox .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 13px; padding: 6px 9px; border-radius: 6px; transform: translate(-50%, -125%); white-space: nowrap; display: none; z-index: 5; }
.empty { padding: 24px 16px; color: var(--ink-2); }
.ranges { display: flex; gap: 6px; }
.ranges button { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; }
.ranges button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
details.tbl { padding: 0 16px 14px; font-size: 13px; color: var(--ink-2); }
details.tbl table { margin-top: 8px; border-collapse: collapse; }
details.tbl td { padding: 3px 18px 3px 0; }

/* ---------- prose, footer */
.prose { max-width: 74ch; }
.prose h2 { margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose li { margin: 5px 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--ink-2); margin: 8px 0 0; }
footer { margin-top: 30px; border-top: 1px solid var(--line); padding: 22px 0 44px; color: var(--muted); font-size: 13px; }
footer p { max-width: 96ch; margin: 6px 0; }

@media (max-width: 820px) {
  .top { position: static; }
  .phero { grid-template-columns: 1fr; }
  .phero .pic { max-width: 300px; }
  .offer { grid-template-columns: 1fr auto; row-gap: 8px; }
  .offer .shop { grid-column: 1; grid-row: 1; }
  .offer .p { grid-column: 2; grid-row: 1; }
  .offer .st { grid-column: 1; grid-row: 2; }
  .offer .go { grid-column: 2; grid-row: 2; justify-self: end; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .pcard .price { font-size: 21px; }
  .nav { order: 3; flex-basis: 100%; }
}
