/* Studealz: "Kassabon". The answer is printed as a till receipt.
   Phone first. All colours are variables here, so a dark mode later only
   needs a second set of values (see BACKLOG.md). The full design rules are
   in DESIGN.md. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  /* "Wijnrood" (chosen October 2026) */
  --belt: #3d0f1e;          /* wine-red belt: header and footer */
  --ground: #ebe2d0;        /* the counter: warm sand page background */
  --paper: #fffcf3;         /* receipt paper: warm cream, like thermal paper */
  --ink: #1f1416;           /* text */
  --ink-soft: #5f5150;      /* secondary text */
  --rule: #cdbfae;          /* dashed and dotted lines */
  --red: #d6304f;           /* "korting" red, watermelon pink: every price per unit */
  --red-text: #b0203d;      /* darker red for small text such as links */
  --red-on-dark: #ff7d8c;   /* the light pink on the wine belt ("DEALZ") */
  --on-dark-soft: #c9a9ae;  /* small print on the wine belt */

  --font: "Archivo", "Arial Narrow", Arial, sans-serif;
  --wide: 125%;             /* receipt-header caps */
  --tooth: 14px;            /* size of the torn receipt edge */

  /* Type: three sizes and two weights, nothing else (the user's review,
     October 2026: "too many sizes, fonts and bold"). Wide caps only in
     the logo. The one big number is the price on a receipt. */
  --small: 13px;
  --body: 16px;
  --title: 20px;
  --price: clamp(36px, 10vw, 44px);
  --headline: clamp(26px, 7.5vw, 32px); /* the title on top of a receipt */
}

* { box-sizing: border-box; }

/* belt black behind the page, so nothing grey shows under the footer */
/* scrollbar-gutter: a short page (Cola Zero) and a long one keep the same
   width on a computer, so nothing shifts when the scrollbar comes and goes */
html { -webkit-text-size-adjust: 100%; background: var(--belt); scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  /* the page grows, so the footer always reaches the bottom of the screen */
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

body.no-scroll { overflow: hidden; }

::selection { background: var(--red); color: var(--paper); }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

h1, h2, h3 { line-height: 1.1; margin: 0 0 0.4em; }

button, input, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
/* headings that only receive focus when a pop-up opens don't need a frame */
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon { flex: none; }

/* ------------------------------------------------------------ header */

.site-header {
  background: var(--belt);
  color: var(--paper);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo {
  font-stretch: 112%;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: var(--paper);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

/* the mark: a stepped gable with a % cut out (the belt shows through the
   window, slash and door). It scales with the word, a bit taller than the
   capitals. */
.logo-mark { width: 0.88em; height: 1.18em; flex: none; display: block; }

.logo-word span { color: var(--red-on-dark); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.site-header .btn-ghost {
  color: var(--paper);
  border-color: var(--paper);
  min-height: 44px;
  padding: 6px 12px;
  font-size: var(--small);
  white-space: nowrap;
}

/* "Mijn winkels" as quiet text: "Producten" stays the one boxed button */
.site-header #shops-button {
  border-color: transparent;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}


.lang { display: flex; border: 2px solid var(--paper); }

.lang button {
  background: transparent;
  color: var(--paper);
  border: 0;
  min-width: 40px;
  min-height: 44px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: var(--small);
  cursor: pointer;
}

.lang button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 0;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease-out;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-small { min-height: 44px; padding: 10px 16px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  font-weight: 700;
  cursor: pointer;
}


.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--red-text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ------------------------------------------------------------ top of the page */

.loading { color: var(--ink-soft); margin: 24px 0; }

/* prices older than two days: an honest, quiet warning */
.stale {
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 2px dashed var(--ink);
  font-size: var(--small);
}







/* "Op je lijst: 24 blikjes Cola Zero, 1 krat Pils · Lijst aanpassen" */
.list-on { color: var(--ink-soft); font-size: var(--small); margin: 0 0 14px; }
.list-on .btn-link { padding: 12px 6px; margin: -12px 0; }


.section-title {
  font-weight: 700;
  font-size: var(--body);
  margin: 0 0 2px;
}

.small, .note { color: var(--ink-soft); font-size: var(--small); }
.note { margin: 4px 0 0; }

.empty { background: var(--paper); padding: 16px; }
.empty p { margin: 0 0 4px; }
.empty .btn-link { padding: 8px 0; }
.empty .row { margin-top: 10px; gap: 8px; }
.empty .row:empty { display: none; }

/* "online" and "aanbieding": small printed marks, never rounded badges */
.mark {
  display: inline-block;
  padding: 3px 5px;
  font-size: var(--small);
  font-weight: 700;
  line-height: 1;
  vertical-align: 0.1em;
  white-space: nowrap;
  background: var(--ink);
  color: var(--paper);
}

/* ------------------------------------------------------------ the shell: menu and columns

   Phone: one column; the menu is a drawer behind "Producten".
   From 900px: the menu on the left, the page in a column as wide as the
   receipt. From 1180px: a product opens in a third column, beside the deals
   (keep that width in step with SIDE_BY_SIDE in app.js). */

.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  background: transparent;
  color: var(--paper);
  border: 2px solid var(--paper);
  font-weight: 700;
  font-size: var(--small);
  cursor: pointer;
}

.header-row .logo { margin-right: auto; }

.shell {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px 0;
}

#main { max-width: 460px; margin: 0 auto; }
#detail:empty { display: none; }

.menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 15;
  width: min(320px, 86vw);
  overflow: hidden auto;
  padding: 20px 16px 32px;
  background: var(--ground);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0.28s;
}
.menu-backdrop { display: none; }
body.menu-open { overflow: hidden; }
body.menu-open .menu {
  transform: none;
  visibility: visible;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 12px 0 32px rgba(20, 20, 20, 0.25);
}
body.menu-open .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(61, 15, 30, 0.6); }

.menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
}
.menu a[aria-current="page"] { box-shadow: inset 0 0 0 3px var(--ink); font-weight: 700; }
.menu .mark { margin-left: auto; }
.menu-top { display: grid; gap: 6px; margin-bottom: 10px; }
/* the home of the site: always a wine block; when you're on it, a ring around it */
.menu a.menu-deals { background: var(--belt); color: var(--paper); font-weight: 700; }
.menu a.menu-deals[aria-current="page"] { box-shadow: 0 0 0 2px var(--ground), 0 0 0 5px var(--ink); }
.menu-group {
  margin: 14px 12px 4px;
  color: var(--ink-soft);
  font-size: var(--small);
  font-weight: 700;
}
.menu-list { list-style: none; margin: 0; padding: 0; }

/* the drawer's own close button (a phone only) */
.menu .menu-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -12px -8px 8px auto;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
}

/* "Mijn winkels (5)", or on small phones "Winkels (5)" */
.label-short { display: none; }

/* NL / EN: in the header, but on a phone in the menu (no room up there) */
.menu-lang { display: none; width: max-content; margin: 24px 12px 0; border-color: var(--ink); }
.menu-lang button { color: var(--ink); }
.menu-lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (max-width: 399px) {
  .label-long { display: none; }
  .label-short { display: inline; }
  /* the logo with its symbol: smaller and tighter, so the header stays on one line */
  .site-header .logo { font-size: 15px; gap: 0.3em; letter-spacing: 0; }
  .site-header .header-row { gap: 6px; padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 639px) {
  .header-actions .lang { display: none; }
  .menu-lang { display: flex; }
  .header-row { gap: 8px; }
  .logo { font-size: 18px; }
  .site-header .btn-ghost, .menu-button { padding: 6px 9px; }
}

@media (min-width: 900px) {
  .menu-button, .menu .menu-close { display: none; }
  .shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 460px);
    gap: 48px;
    justify-content: center;
    align-items: start;
  }
  .menu {
    position: sticky;
    top: 96px;
    width: auto;
    transform: none;
    visibility: visible;
    transition: none;
    padding: 0;
    background: none;
    z-index: auto;
  }
  #main { margin: 0; }
  /* header and footer as wide as the menu and the page together */
  .site-header .wrap, .site-footer .wrap { max-width: calc(240px + 48px + 460px + 32px); }
}

/* Side by side: the page heads share one row, so both receipts start at
   the same height. */
@media (min-width: 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 440px) minmax(0, 440px);
    grid-template-rows: auto 1fr;
    gap: 0 40px;
  }
  .menu { grid-row: 1 / span 2; }
  #main, #detail { grid-row: 1 / span 2; display: grid; grid-template-rows: subgrid; align-content: start; }
  /* no back button (the menu is right there), but its (empty) row stays,
     so both columns start level */
  .shell .page-back { padding: 0; }
  .shell .page-back > * { display: none; }
  .site-header .wrap, .site-footer .wrap { max-width: calc(220px + 2 * 440px + 2 * 40px + 32px); }
}

/* ------------------------------------------------------------ page heads */

.page-head { padding-bottom: 12px; }
.page-head:empty { padding: 0; }
.page-title {
  font-weight: 700;
  font-size: var(--title);
  line-height: 1.2;
  text-wrap: balance;
  overflow-wrap: break-word;
  margin: 0 0 4px;
}
.page-lead { margin: 0; }
.back {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

/* ------------------------------------------------------------ "Deals van deze week" */


.alcohol-tear {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: var(--small);
  color: var(--ink-soft);
}
.deal-lines { list-style: none; margin: 0; padding: 0; }
.deal-lines li + li { border-top: 1px dashed var(--rule); }

/* Two short rows: product and price; shop, saving and "per blikje" under
   them. The arrow on the right says: tap a deal for the details. */
.deal-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  grid-template-areas: "name price go" "shop per go" "labels labels go" "cheaper cheaper cheaper";
  align-items: baseline;
  column-gap: 12px;
  padding: 12px 0;
  color: var(--ink);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.deal-name { grid-area: name; font-weight: 700; overflow-wrap: break-word; }
.deal-name .mark { margin-left: 6px; }
.deal-price { grid-area: price; color: var(--red); font-weight: 700; font-size: var(--title); line-height: 1; text-align: right; }
.deal-shop { grid-area: shop; color: var(--ink-soft); font-size: var(--small); }
.deal-shop b { color: var(--ink); }
.deal-labels { grid-area: labels; margin-top: 2px; }
.deal-per { grid-area: per; color: var(--ink-soft); font-size: var(--small); text-align: right; }
.deal-go { grid-area: go; align-self: center; display: flex; color: var(--ink); }
/* another of your shops is cheaper without an offer: say so, plainly */
.deal-cheaper { grid-area: cheaper; margin-top: 2px; color: var(--ink-soft); font-size: var(--small); }
.deal-none { color: var(--ink-soft); }
/* the deal whose receipt is open beside the deals (wide screen) */
.deal-line[aria-current] .deal-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* the brand drop-down ("Merk: Alle merken"), in the receipt head */
.brand-select { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.brand-select label { font-weight: 700; font-size: var(--small); }
.brand-select select {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 40px 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%231f1416' stroke-width='3' stroke-linecap='square'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink);
  font: inherit;
  appearance: none;
  cursor: pointer;
}
.empty .brand-select { justify-content: flex-start; }
/* a deal's varieties (kleur, wit, zwart), each with its price */
.deal-varieties { margin-top: 6px; }

/* alcohol: its own torn-off block at the bottom of the receipt */
.alcohol-block { margin-top: 20px; padding-top: 14px; border-top: 2px dashed var(--ink); }
.alcohol-note, .alcohol-off { margin-top: 6px !important; color: var(--ink-soft); font-size: var(--small); }
.alcohol-off .btn-link { padding: 10px 4px; margin: -10px 0; }

/* the list, under the deals receipt */
/* a quiet line under the receipt: the receipt is the main thing on the page */
.list-teaser {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin-top: 18px;
  padding: 10px 0;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.list-teaser > span:first-child { flex: 1; }
.list-teaser-price { font-weight: 700; font-variant-numeric: tabular-nums; }

/* wide screen, no product chosen yet: an empty slip where its receipt will print */
.detail-hint { margin: 0; padding: 28px 24px; border: 2px dashed var(--rule); color: var(--ink-soft); }

/* ------------------------------------------------------------ "Kies je winkels" */

.chain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; }
.chain-grid .chain { background: var(--paper); min-height: 56px; }
.chain-grid .chain-detail:empty { display: none; }
.online-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--small); cursor: pointer; }
.online-toggle input { flex: none; width: 20px; height: 20px; accent-color: var(--ink); }
.shops-go { width: 100%; margin-top: 12px; }
.near-help { padding: 16px; border: 2px dashed var(--ink-soft); }
.near-help-title { display: block; margin: 0 0 8px; font-weight: 700; }
.near-help .message { margin: 8px 0 0; }
/* a folded extra ("Of kies je winkels zelf"): only opens when you need it */
.fold { margin: 16px 0 0; }
.fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.fold > summary span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; font-size: 20px; line-height: 1; }
.fold[open] > summary::after { content: "−"; }
.fold > summary + * { margin-top: 8px; }
.near-row { display: flex; gap: 8px; }
.near-row input, .near-row select {
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px; /* 16px or more: phones don't zoom in on the field */
}
.near-row input { flex: 1 1 auto; min-width: 0; }
.near-row .btn { flex: none; }
.near-privacy { margin: 8px 0 0; color: var(--ink-soft); font-size: var(--small); }
.skip { display: block; margin: 16px 0 0; padding: 10px 0; }

/* ------------------------------------------------------------ the receipt (the winner) */

.receipt-wrap { filter: drop-shadow(0 10px 14px rgba(20, 20, 20, 0.14)) drop-shadow(0 1px 1px rgba(20, 20, 20, 0.12)); }

.receipt {
  background: var(--paper);
  padding: 18px 20px calc(var(--tooth) + 22px);
  /* torn bottom edge */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
  animation: receipt-print 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

/* the signature move: the receipt feeds out of the printer */
@keyframes receipt-print {
  from { clip-path: inset(0 0 72% 0); transform: translateY(-28px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

.receipt p { margin: 0; }




/* the head of a receipt: what it is (the product), then where and when */
.receipt-head {
  text-align: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--rule);
}

.receipt-meta {
  color: var(--ink-soft);
  font-size: var(--small);
  font-variant-numeric: tabular-nums;
}

.receipt-heading {
  font-size: var(--headline);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 8px;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.receipt-title { font-weight: 700; margin: 0 0 2px; }

.receipt-product { font-weight: 700; overflow-wrap: break-word; }
.receipt-labels { margin: 2px 0 0; }

/* quality labels ("extra vierge · A-merk"); "huismerk" stands out (DESIGN.md) */
.labels { display: inline-block; color: var(--ink-soft); font-size: var(--small); font-weight: 400; text-decoration: none; }
.label-house-brand { color: var(--belt); font-weight: 700; }

.receipt-lines { margin: 12px 0 0; font-variant-numeric: tabular-nums; }

.receipt-line { display: flex; justify-content: space-between; gap: 12px; }
.receipt-line dt, .receipt-line dd { margin: 0; }
.receipt-line.is-muted { color: var(--ink-soft); }
.receipt-line.is-saving { font-weight: 700; }
.receipt-line.is-saving dd { color: var(--red); }

.receipt-offer { color: var(--ink-soft); font-size: var(--small); margin-top: 4px !important; }

/* Mijn lijst on the receipt: one line per item, what you buy underneath */
.list-lines { display: grid; gap: 12px; margin-top: 0; }
.list-line { align-items: baseline; }
.list-line dt { min-width: 0; overflow-wrap: break-word; }
.list-line dd { font-weight: 700; white-space: nowrap; }
.list-line dt a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.list-line dt a:hover { text-decoration-color: var(--red); }
.list-amount { margin-left: 6px; color: var(--ink-soft); font-size: var(--small); }
.list-packs { display: block; margin-top: 2px; color: var(--ink-soft); font-size: var(--small); line-height: 1.4; }

/* the total line of a till receipt: double rule, label, dotted leader, price */
.receipt-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 4px double var(--ink);
}

.receipt-total-label {
  font-weight: 700;
  white-space: nowrap;
}

.receipt-total .leader {
  flex: 1 1 12px;
  min-width: 12px;
  border-bottom: 2px dotted var(--rule);
}

.receipt-price {
  color: var(--red);
  font-weight: 700;
  font-size: var(--price);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.receipt-sum {
  text-align: right;
  margin-top: 6px !important;
  color: var(--ink-soft);
  font-size: var(--small);
  font-variant-numeric: tabular-nums;
}

.receipt-note { color: var(--ink-soft); font-size: var(--small); margin-top: 8px !important; }
/* under an online winner: the best you can buy in a shop, easy to spot */
.receipt-inshop {
  color: var(--ink);
  font-weight: 700;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
}
.receipt-link { margin-top: 18px; width: 100%; }

.receipt-link .icon { transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
.receipt-link:hover .icon { transform: translateX(3px); }


/* ------------------------------------------------------------ the list per shop */

.shops { margin-top: 36px; }
.shops > .small { margin: 0 0 12px; }

.shop-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  border-top: 2px solid var(--ink);
}

.shop-list > li { border-bottom: 1px dashed var(--rule); }

.shop-row { scroll-margin-top: 84px; }

.shop-row summary {
  display: grid;
  grid-template-columns: 26px minmax(0, max-content) minmax(16px, 1fr) auto 20px;
  grid-template-areas:
    "rank name leader price chevron"
    ".    gap  gap    .     .";
  align-items: center;
  column-gap: 10px;
  padding: 14px 0 12px;
  min-height: 64px;
  cursor: pointer;
  list-style: none;
}

.shop-row summary::-webkit-details-marker { display: none; }

.rank {
  grid-area: rank;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.shop-name {
  grid-area: name;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* dotted line from the shop to its price, like a receipt */
.leader {
  grid-area: leader;
  align-self: end;
  margin-bottom: 7px;
  border-bottom: 2px dotted var(--rule);
}

.shop-price {
  grid-area: price;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* pink only for the cheapest: the one price that matters */
.is-first .shop-price { color: var(--red-text); }

.chevron { grid-area: chevron; transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.shop-row[open] .chevron { transform: rotate(180deg); }
.shop-row summary:hover .shop-name { text-decoration: underline; text-underline-offset: 3px; }

.gap {
  grid-area: gap;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: var(--small);
  font-variant-numeric: tabular-nums;
}

/* Mijn lijst: shops that miss something, at the bottom without a price */
.shop-missing {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  padding: 12px 0;
}
.shop-missing .shop-name { grid-area: 1 / 2; color: var(--ink-soft); }
.shop-missing .gap { grid-area: 2 / 2; }


.empty-list { padding: 20px; }
.empty-list p { font-weight: 400; max-width: 60ch; margin-bottom: 4px; }
.empty-list .section-title { margin-bottom: 6px; }

.packs {
  list-style: none;
  margin: 0;
  padding: 0 0 18px 36px;
  display: grid;
  gap: 16px;
}

.pack p { margin: 0; }

/* pack line (and its marks) on the left, the price per can always top right */
.pack-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 12px;
  font-size: var(--small);
  font-variant-numeric: tabular-nums;
}

.pack-size { font-weight: 700; }

.pack-marks { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; }
.pack-marks .mark { vertical-align: 0; }

.pack-price {
  font-weight: 700;
  font-size: var(--body);
  font-variant-numeric: tabular-nums;
}

.pack-offer { color: var(--ink-soft); font-size: var(--small); margin-top: 2px !important; }

.pack-items { list-style: none; margin: 4px 0 0; padding: 0; }

.pack-items a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: var(--ink);
  font-size: var(--small);
  line-height: 1.35;
  overflow-wrap: break-word;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pack-items a:hover { text-decoration-color: var(--red); }

/* ------------------------------------------------------------ "is this right?" */

.check {
  margin-top: 32px;
  border: 2px dashed var(--ink-soft);
  padding: 14px 16px;
  font-size: var(--small);
}

.check h2 {
  font-weight: 700;
  font-size: var(--body);
}

.check p { margin: 0; }
.check ul { margin: 6px 0 0; padding-left: 18px; }

/* ------------------------------------------------------------ pop-ups */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(61, 15, 30, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px); /* the real visible height on phones */
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  padding: 24px 20px;
}

.panel h1, .panel h2 {
  font-weight: 700;
  font-size: var(--title);
}

.panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
}

.panel-close + h2 { padding-right: 40px; }

/* above every other pop-up: it can open from the list pop-up */
#age-gate { align-items: center; z-index: 30; }

/* the 18+ check is a receipt slip too */
.panel-age {
  text-align: center;
  padding-bottom: calc(var(--tooth) + 26px);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
}

.panel-age .row { justify-content: center; }

.age-mark {
  margin: 0 0 6px;
  color: var(--red);
  font-weight: 700;
  font-size: var(--price);
  line-height: 1;
}


/* "Toon deals" stays at the bottom of the pop-up, within thumb reach */
.panel-actions {
  position: sticky;
  bottom: -24px;
  margin: 8px -20px -24px;
  padding: 12px 20px 20px;
  background: var(--paper);
  border-top: 1px dashed var(--rule);
}

@media (max-width: 639px) {
  .overlay:not(#age-gate) { padding: 16px 0 0; }
  .overlay:not(#age-gate) .panel { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .panel-actions { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

.panel-actions .message { margin: 0 0 8px; min-height: 0; }
.panel-actions .row { flex-wrap: nowrap; align-items: stretch; }
.panel-actions .row > * { flex: 1 1 0; padding-left: 12px; padding-right: 12px; }


.chain-list { display: grid; gap: 8px; margin-bottom: 8px; }

.chain {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  align-items: center;
  border: 2px solid var(--rule);
  padding: 10px 12px;
  cursor: pointer;
}

.chain:has(input:checked) { border-color: var(--ink); }
.chain input { width: 20px; height: 20px; accent-color: var(--ink); grid-row: span 2; }
.chain-name { font-weight: 700; }
.chain-detail { font-size: var(--small); color: var(--ink-soft); grid-column: 2; }

/* Mijn lijst pop-up: a ticked product gets a - amount + bar under it */
.list-item { display: grid; }
.list-item .chain-name .mark { margin-left: 4px; }

.stepper { display: flex; align-items: stretch; border: 2px solid var(--ink); border-top: 0; }

.stepper button {
  width: 52px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  cursor: pointer;
}

.stepper button:first-child { border-right: 2px solid var(--ink); }
.stepper button:last-child { border-left: 2px solid var(--ink); }
.stepper output {
  flex: 1;
  align-self: center;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}


/* ------------------------------------------------------------ footer */

.site-footer {
  position: relative;
  margin-top: 64px;
  background: var(--belt);
  color: var(--paper);
  padding: 32px 0 40px;
  font-size: var(--small);
}


.site-footer p { margin: 4px 0; }

/* the NIX18 logo with "Geniet, maar drink met mate", only with alcohol on screen */
.slogan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-weight: 700;
  font-size: var(--title);
  line-height: 1.2;
  margin-bottom: 16px;
}
.slogan[hidden] { display: none; }
.nix18 { display: block; height: auto; }
.slogan .nix18 { width: 163px; }
/* the same on a receipt with alcohol prices: in the ad itself, at least
   1.25% of the screen (Reclamecode art. 32) */
.nix-line { display: flex; align-items: center; gap: 12px; margin-top: 14px !important; font-weight: 700; font-size: var(--small); }
.nix-line .nix18 { width: 118px; flex: none; }
.footer-link { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }
/* a page of plain text (privacy) */
.text-page { max-width: 34em; }
.text-page p { margin: 0 0 12px; }

.credit { color: var(--on-dark-soft); }

/* ------------------------------------------------------------ sizes */

/* the smallest phones: keep the header on one line */
@media (max-width: 359px) {
  .logo { font-size: 15px; }
  .header-row { gap: 6px; }
  .header-actions { gap: 4px; }
  .site-header .btn-ghost { padding: 6px 7px; }
  .lang button { min-width: 38px; padding: 4px 6px; }
  .header-row { padding-left: 12px; padding-right: 12px; }
}

@media (min-width: 640px) {
  .logo { font-size: 24px; font-stretch: var(--wide); }
  .overlay { align-items: center; }
  .receipt { padding: 22px 26px calc(var(--tooth) + 26px); }
  .receipt-link { width: auto; }
}

/* Colour changes on hover only with a real mouse: on a phone a tapped
   button would otherwise stay red until you tap somewhere else. */
@media (hover: hover) {
  .site-header .btn-ghost:hover { background: var(--paper); color: var(--ink); }
  .btn:hover { background: var(--red); }
  .btn-ghost:hover { background: var(--ink); color: var(--paper); }
  .menu a:hover:not([aria-current]) { background: var(--paper); }
  .menu-button:hover { background: var(--paper); color: var(--ink); }
  .deal-line:hover .deal-name, .list-teaser:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }
  .back:hover { background: var(--ink); color: var(--paper); }
  .menu a.menu-deals:hover { background: var(--ink); }
  .stepper button:hover { background: var(--ground); }
  .panel-close:hover { background: var(--ground); }
}

/* Windows high contrast: marks lose their fill, so give them a border */
@media (forced-colors: active) {
  .mark { border: 1px solid CanvasText; }
  .receipt-total .leader, .leader { border-bottom-color: CanvasText; }
}

@media (prefers-reduced-motion: reduce) {
  .receipt { animation: none; }
  .chevron, .receipt-link .icon, .menu { transition: none; }
}
