@font-face {
  font-family: "Archivo";
  src: url("/static/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/static/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --paper: #f2f4f1;
  --surface: #fbfcfa;
  --ink: #17201c;
  --ink-2: #4e5a54;
  --ink-3: #6b7670;
  --rule: #dde2dd;
  --rule-strong: #c3cbc5;
  --accent: #2a78d6;
  --accent-ink: #1d5fae;
  --down: #006300;
  --down-wash: #e3f1e1;
  --up: #b3261e;
  --up-wash: #f8e5e2;
  --red-price: #c4231b;
  --promo: #7a4a00;
  --promo-wash: #fbefd6;
  --chart-line: #2a78d6;
  --chart-grid: #e1e5e0;
  --chart-axis: #c3cbc5;
  --focus: #2a78d6;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --narrow: 72%;
  --wrap: 1080px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f1412;
    --surface: #18201c;
    --ink: #eef2ef;
    --ink-2: #b5c0ba;
    --ink-3: #8f9a94;
    --rule: #2a332e;
    --rule-strong: #3b4640;
    --accent: #3987e5;
    --accent-ink: #7fb2f0;
    --down: #3cbf3c;
    --down-wash: #183320;
    --up: #f07a72;
    --up-wash: #3a1c1a;
    --red-price: #ff7d74;
    --promo: #f3c36b;
    --promo-wash: #33280f;
    --chart-line: #3987e5;
    --chart-grid: #26302b;
    --chart-axis: #3b4640;
    --focus: #7fb2f0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1412;
  --surface: #18201c;
  --ink: #eef2ef;
  --ink-2: #b5c0ba;
  --ink-3: #8f9a94;
  --rule: #2a332e;
  --rule-strong: #3b4640;
  --accent: #3987e5;
  --accent-ink: #7fb2f0;
  --down: #3cbf3c;
  --down-wash: #183320;
  --up: #f07a72;
  --up-wash: #3a1c1a;
  --red-price: #ff7d74;
  --promo: #f3c36b;
  --promo-wash: #33280f;
  --chart-line: #3987e5;
  --chart-grid: #26302b;
  --chart-axis: #3b4640;
  --focus: #7fb2f0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-stretch: 100%;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.1; margin: 0; font-weight: 800; font-stretch: var(--narrow); letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
h2 { font-size: 1.5rem; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Kop ------------------------------------------------------------------ */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-stretch: var(--narrow); font-size: 1.5rem; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 600; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

/* Zoeken --------------------------------------------------------------- */
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: 8px; padding: 12px 14px;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }
.search button, .button {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 8px;
  background: var(--ink); color: var(--paper); padding: 12px 20px; text-decoration: none; display: inline-block;
}
.search button:hover, .button:hover { background: var(--accent-ink); color: #fff; }
.button-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.button-quiet:hover { background: var(--surface); color: var(--ink); }
.search-compact { padding: 12px 0 16px; max-width: 640px; }
.search-compact input { padding: 10px 12px; }
.search-compact button { padding: 10px 16px; }
.search-hero { max-width: 720px; margin-top: 28px; }
.search-hero input { font-size: 1.125rem; padding: 16px 18px; }
.search-hero button { font-size: 1.125rem; padding: 16px 26px; }

/* Hero ----------------------------------------------------------------- */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--rule); }
.hero-title {
  font-size: clamp(2.75rem, 1.2rem + 6.4vw, 6rem);
  font-weight: 850; font-stretch: 62%; line-height: 0.92; letter-spacing: -0.015em; max-width: 12ch;
}
.hero-lede { margin-top: 20px; max-width: 60ch; font-size: 1.125rem; color: var(--ink-2); }
.facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 32px 0 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--ink-3); font-size: 0.875rem; }
.facts dd { margin: 2px 0 0; font-size: 1.5rem; font-weight: 700; font-stretch: var(--narrow); }

/* Secties -------------------------------------------------------------- */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px 56px; padding: 40px 0 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-sub { color: var(--ink-3); margin-top: 4px; font-size: 0.9375rem; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding: 32px 0 12px; }
.page-head h1 { overflow-wrap: anywhere; }
.count { color: var(--ink-3); }
.empty { margin-top: 20px; color: var(--ink-2); }
.notice { margin: 40px 0 64px; padding: 24px; background: var(--surface); border-radius: 8px; border: 1px solid var(--rule); max-width: 680px; }
.notice h1, .notice h2 { font-size: 1.75rem; margin-bottom: 8px; }
.notice p + p { margin-top: 12px; }
.notice-error { border-left: 4px solid var(--up); }

/* Kassabon-regels ------------------------------------------------------ */
.receipt { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.receipt-results { margin-top: 8px; }
.line { border-bottom: 1px solid var(--rule); }
.line-link { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: inherit; text-decoration: none; }
.line-link:hover { background: var(--surface); }
.line-link:hover .name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.thumb { width: 56px; height: 56px; flex: none; object-fit: contain; background: #fff; border-radius: 6px; }
.thumb-empty { display: block; background: var(--rule); }
.thumb-empty.big { width: 100%; aspect-ratio: 1; border-radius: 8px; }
.line-name { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; }
.name { font-weight: 600; overflow-wrap: anywhere; }
.meta { color: var(--ink-3); font-size: 0.875rem; }
.meta-item + .meta-item::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); margin: 0 8px; vertical-align: middle; }
.leader { flex: 1 1 24px; min-width: 16px; align-self: center; border-bottom: 2px dotted var(--rule-strong); height: 0; margin-top: 8px; }
.line-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; gap: 2px; }
.price { font-weight: 800; font-stretch: var(--narrow); font-size: 1.375rem; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-red { color: var(--red-price); }
.price-none { font-size: 1rem; color: var(--ink-3); font-weight: 600; }
.old { color: var(--ink-3); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.unit { color: var(--ink-3); font-size: 0.8125rem; white-space: nowrap; }
.line-unavailable .name, .line-unavailable .price { color: var(--ink-3); }
.line-unavailable .thumb { opacity: 0.55; }
.promo-flag { color: var(--promo); font-weight: 600; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 0.8125rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta-down { color: var(--down); background: var(--down-wash); }
.delta-up { color: var(--up); background: var(--up-wash); }

/* Filters & paginering ------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 8px 0 4px; color: var(--ink-2); font-size: 0.9375rem; }
.filters label { display: inline-flex; align-items: center; gap: 8px; }
.filters select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 6px; padding: 6px 8px; }
.filters input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; }
.segmented a { padding: 7px 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.segmented a + a { border-left: 1px solid var(--rule-strong); }
.segmented a:hover { background: var(--surface); color: var(--ink); }
.segmented a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.pager { display: flex; flex-wrap: wrap; gap: 4px; padding: 24px 0 56px; }
.pager a, .pager span { min-width: 40px; padding: 8px 12px; text-align: center; border-radius: 6px; text-decoration: none; font-weight: 600; }
.pager a { color: var(--ink-2); }
.pager a:hover { background: var(--surface); color: var(--ink); }
.pager span[aria-current] { background: var(--ink); color: var(--paper); }

/* Productpagina -------------------------------------------------------- */
.product { padding: 32px 0 64px; }
.product-top { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 40px; align-items: start; }
.product-image { margin: 0; background: #fff; border-radius: 8px; padding: 16px; }
.product-brand { color: var(--ink-2); font-weight: 600; }
.product-name { margin-top: 4px; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); overflow-wrap: anywhere; }
.product-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-3); margin-top: 10px; }
.product-long { color: var(--ink-2); margin-top: 6px; max-width: 60ch; }

/* Het schaplabel */
.tag { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; margin-top: 28px; padding: 18px 22px 20px; background: var(--surface); border-radius: 8px; border-top: 6px solid var(--ink); max-width: 560px; }
.tag-red { border-top-color: var(--red-price); }
.tag-price { display: flex; align-items: flex-start; font-weight: 900; font-stretch: 62%; line-height: 0.8; font-variant-numeric: lining-nums; letter-spacing: -0.02em; }
.tag-red .tag-price { color: var(--red-price); }
.tag-cur { font-size: 2.25rem; margin: 0.35rem 0.2rem 0 0; font-weight: 800; }
.tag-eur { font-size: clamp(5rem, 3rem + 8vw, 8rem); }
.tag-cents { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 3.75rem); margin-top: 0.2rem; }
.tag-none { font-size: 2.5rem; color: var(--ink-3); }
.tag-side { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.tag-unit { font-weight: 700; font-size: 1.0625rem; }
.tag-delta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.9375rem; }
.tag-note { color: var(--ink-2); font-size: 0.9375rem; }
.offer, .promo, .warning { margin-top: 12px; max-width: 560px; padding: 10px 14px; border-radius: 6px; }
.offer { background: var(--surface); border-left: 4px solid var(--accent); font-weight: 600; }
.promo { background: var(--promo-wash); color: var(--promo); font-weight: 600; }
.promo + .promo { margin-top: 6px; }
.warning { background: var(--up-wash); color: var(--ink); }
.times { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 24px 0 0; }
.times dt { color: var(--ink-3); font-size: 0.875rem; }
.times dd { margin: 2px 0 0; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.history { margin-top: 56px; }
.chart { position: relative; margin-top: 20px; background: var(--surface); border-radius: 8px; padding: 12px 8px 4px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart-svg .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-svg .axis { stroke: var(--chart-axis); stroke-width: 1; }
.chart-svg .tick { fill: var(--ink-3); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-svg .line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-svg .area { fill: var(--chart-line); opacity: 0.1; }
.chart-svg .end-dot, .chart-svg .hover-dot { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
.chart-svg .crosshair { stroke: var(--ink-3); stroke-width: 1; }
.chart-svg .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; top: 8px; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: 6px; padding: 6px 10px; font-size: 0.875rem; display: flex; flex-direction: column; white-space: nowrap; transform: translateX(-50%); }
.chart-tip[hidden] { display: none; }
.chart-tip strong { font-size: 1.0625rem; font-stretch: var(--narrow); }
.chart-tip span { color: var(--rule-strong); }

.history-table { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 0.9375rem; }
.history-table th { text-align: left; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); }
.history-table td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.history-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-table td.num span:not(.delta):not(.muted) { font-weight: 700; }

/* API-documentatie ----------------------------------------------------- */
.prose { padding-top: 32px; padding-bottom: 64px; max-width: 820px; }
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 40px; }
.prose p, .prose dd { max-width: 70ch; }
.prose pre { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font-size: 0.875rem; line-height: 1.45; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.prose :not(pre) > code { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 0 4px; }
.fields dt { margin-top: 14px; }
.fields dd { margin: 4px 0 0 0; color: var(--ink-2); }

/* Voet ----------------------------------------------------------------- */
.footer { border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 0.875rem; }
.footer-row { padding-top: 24px; padding-bottom: 32px; display: grid; gap: 6px; }
.footer a { color: var(--ink-2); }

@media (max-width: 720px) {
  .hero { padding: 36px 0 28px; }
  .product-top { grid-template-columns: 1fr; gap: 20px; }
  .product-image { max-width: 200px; }
  .hide-sm { display: none; }
  .thumb { width: 44px; height: 44px; }
  .line-link { gap: 10px; }
  .leader { display: none; }
  .line-name { flex: 1 1 auto; }
  .price { font-size: 1.1875rem; }
  .search-hero { flex-direction: column; }
  .search-hero button { width: 100%; }
  /* De SVG schaalt mee; grotere labels in viewBox-eenheden blijven zo leesbaar. */
  .chart-svg .tick { font-size: 26px; }
  .chart { padding: 8px 4px 0; }
}

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

@media (forced-colors: active) {
  .chart-svg .line { stroke: CanvasText; }
  .delta { border: 1px solid CanvasText; }
}
