/* Preispickerl design system. Plain CSS, no build step. Vocabulary: web/design/README.md */

/* ---- Tokens ---- */
:root {
  color-scheme: light dark;
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f4eee6;
  --text: #231b2e;
  --text-muted: #5f566b;
  --border: #e4dacd;
  --accent: #6b3aa8;
  --accent-hover: #582d90;
  --on-accent: #ffffff;
  --accent-soft: #efe6fa;
  --accent-text: #582d90;
  --sale: #b42318;
  --sale-soft: #fdeceb;
  --ok: #1a6b3c;
  --ok-soft: #e3f4ea;
  --warn: #8a5300;
  --warn-soft: #fff1d6;
  --chain-spar: #e8ecef;
  --chain-billa: #f1ebe3;
  --chain-text: #3d3a45;
  --focus: #0a58c9;
  --shadow: 0 1px 2px rgb(35 27 46 / .06), 0 6px 18px rgb(35 27 46 / .07);
  --chart-line: #6b3aa8;
  --chart-area: rgb(107 58 168 / .14);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --gutter: 16px;
  --max-width: 1200px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16121c;
    --surface: #211b2b;
    --surface-2: #2b2437;
    --text: #f3eefa;
    --text-muted: #b9aecb;
    --border: #3b3249;
    --accent: #b98cf0;
    --accent-hover: #cba6f5;
    --on-accent: #1a1024;
    --accent-soft: #35264a;
    --accent-text: #d3b5f8;
    --sale: #ff9d93;
    --sale-soft: #44211f;
    --ok: #86dca6;
    --ok-soft: #1b3a28;
    --warn: #f2c26b;
    --warn-soft: #3f2f10;
    --chain-spar: #2d3340;
    --chain-billa: #3a3128;
    --chain-text: #e4dcee;
    --focus: #7ab4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 18px rgb(0 0 0 / .35);
    --chart-line: #b98cf0;
    --chart-area: rgb(185 140 240 / .18);
  }
}

:root[data-theme="dark"] {
  --bg: #16121c;
  --surface: #211b2b;
  --surface-2: #2b2437;
  --text: #f3eefa;
  --text-muted: #b9aecb;
  --border: #3b3249;
  --accent: #b98cf0;
  --accent-hover: #cba6f5;
  --on-accent: #1a1024;
  --accent-soft: #35264a;
  --accent-text: #d3b5f8;
  --sale: #ff9d93;
  --sale-soft: #44211f;
  --ok: #86dca6;
  --ok-soft: #1b3a28;
  --warn: #f2c26b;
  --warn-soft: #3f2f10;
  --chain-spar: #2d3340;
  --chain-billa: #3a3128;
  --chain-text: #e4dcee;
  --focus: #7ab4ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 18px rgb(0 0 0 / .35);
  --chart-line: #b98cf0;
  --chart-area: rgb(185 140 240 / .18);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 var(--font);
  overflow-wrap: anywhere;
}
main { flex: 1; padding-block: 24px 56px; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.25rem); }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.container { width: 100%; max-width: var(--max-width); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 460px; }
.container-medium { max-width: 760px; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.stack > * + * { margin-top: 16px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; }
.page-head { margin-bottom: 20px; }
.page-head p { color: var(--text-muted); margin: 0; }
.breadcrumb { font-size: .875rem; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a { display: inline-block; padding-block: 10px; }

/* ---- Header, nav, footer ---- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand actions" "search search";
  align-items: center;
  gap: 8px 12px;
  padding-block: 10px;
}
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand img { width: 36px; height: 36px; }
.brand__text span { color: var(--accent-text); }
.search { grid-area: search; display: flex; gap: 8px; }
.search .input { flex: 1; min-width: 0; border-radius: var(--radius-pill); padding-inline: 18px; }
.header-actions { grid-area: actions; justify-self: end; display: flex; align-items: center; gap: 4px; }
.subnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.subnav .container { display: flex; flex-wrap: wrap; gap: 0 4px; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 12px; color: var(--text-muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.list-counter { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 12px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); font-weight: 700; text-decoration: none; }
.list-counter:hover { color: var(--accent-hover); }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding-inline: 7px; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-size: .8125rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.count-alert { background: var(--sale); color: var(--surface); }
.icon-btn { display: inline-grid; place-items: center; position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .count { position: absolute; top: 0; right: 0; min-width: 20px; height: 20px; font-size: .6875rem; }
.site-footer { border-top: 1px solid var(--border); padding-block: 24px; color: var(--text-muted); font-size: .875rem; }
.site-footer a { color: inherit; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 1.5px solid transparent; border-radius: var(--radius-pill); font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-text); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--sale); color: var(--sale); }
.btn-danger:hover { background: var(--sale-soft); color: var(--sale); }
.btn-sm { padding: 6px 14px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent-text); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---- Forms ---- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 700; font-size: .9375rem; }
.input, .select { width: 100%; min-height: 44px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.input::placeholder { color: var(--text-muted); opacity: 1; }
.input:hover, .select:hover { border-color: var(--text-muted); }
.input:focus-visible, .select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--sale); }
.hint { font-size: .875rem; color: var(--text-muted); }
.field-error { font-size: .875rem; font-weight: 600; color: var(--sale); }
.input-group { display: flex; align-items: stretch; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.input-suffix { position: relative; flex: 1; }
.input-suffix .input { padding-right: 40px; }
.input-suffix::after { content: "€"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 0; cursor: pointer; }
.switch-row small { display: block; color: var(--text-muted); font-size: .875rem; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0; border-radius: var(--radius-pill); background: var(--text-muted); cursor: pointer; transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: var(--on-accent); }

/* ---- Notices, banners, badges, chips ---- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); margin-bottom: 16px; }
.notice-success { background: var(--ok-soft); }
.notice-error { background: var(--sale-soft); }
.notice-warn { background: var(--warn-soft); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent); margin-bottom: 20px; }
.banner__text { flex: 1 1 240px; }
.banner__text strong { display: block; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: .8125rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.badge-discount { background: var(--sale-soft); color: var(--sale); }
.badge-chain { background: var(--chain-spar); color: var(--chain-text); font-weight: 600; }
.badge-chain[data-chain="billa"] { background: var(--chain-billa); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-unread { background: var(--accent); color: var(--on-accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---- Shop: filter bar, product grid, price, pagination ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.filter-bar .select { width: auto; min-width: 150px; border-radius: var(--radius-pill); padding-inline: 16px; font-weight: 600; }
.filter-bar__spacer { flex: 1; }
.results-meta { color: var(--text-muted); margin-bottom: 16px; }
.product-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); }
.product-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, border-color .15s; }
.product-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.product-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.product-card__media { position: relative; display: block; background: var(--surface-2); aspect-ratio: 1; }
.product-card__media img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 12%; }
.product-card__media .badge { position: absolute; top: 10px; left: 10px; }
.product-card__body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 12px 14px 8px; }
.product-card__title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__title a { color: var(--text); text-decoration: none; }
.product-card__title a::after { content: ""; position: absolute; inset: 0; }
.product-card__title a:focus-visible { outline: none; }
.product-card__meta { margin: 0; font-size: .875rem; color: var(--text-muted); }
.product-card__body .price { margin-top: auto; padding-top: 6px; }
.product-card__action { position: relative; z-index: 1; padding: 0 14px 14px; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; font-variant-numeric: tabular-nums; }
.price__now { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; }
.price__now.is-sale { color: var(--sale); }
.price__was { font-size: .9375rem; color: var(--text-muted); text-decoration: line-through; }
.price__unit { margin: 0; font-size: .8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.price-lg .price__now { font-size: 2.25rem; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; list-style: none; padding: 0; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding-inline: 12px; border-radius: var(--radius-pill); color: var(--text); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.pagination a:hover { background: var(--surface-2); }
.pagination [aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.pagination [aria-disabled="true"] { color: var(--text-muted); opacity: .6; }

/* ---- Product detail ---- */
.detail { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); margin-bottom: 32px; }
.detail__media { background: var(--surface-2); border-radius: var(--radius); aspect-ratio: 1; max-width: 420px; width: 100%; }
.detail__media img { width: 100%; height: 100%; object-fit: contain; padding: 14%; }
.detail__info > * + * { margin-top: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel > :last-child { margin-bottom: 0; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.stat-row dt { font-size: .8125rem; color: var(--text-muted); }
.stat-row dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-row > div { min-width: 90px; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 12px; }
.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .chart-grid { stroke: var(--border); stroke-width: 1; }
.chart .chart-line { fill: none; stroke: var(--chart-line); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .chart-area { fill: var(--chart-area); stroke: none; }
.chart .chart-dot { fill: var(--surface); stroke: var(--chart-line); stroke-width: 3; }
.chart text { fill: var(--text-muted); font: 12px var(--font); }
.chart figcaption { margin-top: 8px; font-size: .875rem; color: var(--text-muted); }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 200px); gap: 12px; margin: 0; padding: 0 var(--gutter) 8px; margin-inline: calc(var(--gutter) * -1); list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row-scroll > * { scroll-snap-align: start; }
.compare-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.compare-row:first-child { border-top: 0; }
.compare-row__main { flex: 1 1 200px; }
.watch-form { display: grid; gap: 12px; }

/* ---- Shopping list ---- */
.list-group { margin-bottom: 24px; }
.list-group__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 8px; }
.list-group__head h2 { margin: 0; font-size: 1.125rem; }
.list-items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.list-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "check info price" "check actions actions"; align-items: center; gap: 4px 12px; padding: 12px 16px; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item .check { grid-area: check; min-height: 44px; }
.list-item__info { grid-area: info; min-width: 0; }
.list-item__info strong { display: block; }
.list-item__price { grid-area: price; text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.list-item__price small { display: block; font-weight: 400; color: var(--text-muted); }
.list-item__actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.list-item.is-done .list-item__info strong, .list-item.is-done .list-item__price { text-decoration: line-through; color: var(--text-muted); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); }
.stepper__btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--accent-text); font: inherit; font-size: 1.375rem; font-weight: 700; cursor: pointer; }
.stepper__btn:hover { background: var(--accent-soft); }
.stepper__value { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.swap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--text); font-size: .875rem; }
.swap strong { color: var(--ok); }
.totals { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.totals__row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totals__row--grand { margin-top: 8px; padding-top: 14px; border-top: 2px solid var(--border); font-size: 1.25rem; font-weight: 800; }
.layout-aside { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }

/* End view: big, check-off friendly */
.end-view .list-item { padding-block: 16px; font-size: 1.125rem; }
.end-view .check input { width: 32px; height: 32px; }
.print-only { display: none; }

/* ---- Alerts inbox ---- */
.alert-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.alert-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 16px; }
.alert-item + .alert-item { border-top: 1px solid var(--border); }
.alert-item.is-unread { background: var(--accent-soft); }
.alert-item__dot { width: 12px; height: 12px; margin-top: 7px; border-radius: 50%; background: transparent; }
.is-unread .alert-item__dot { background: var(--accent); }
.alert-item__title { margin: 0; font-weight: 700; }
.alert-item__text { margin: 0; color: var(--text-muted); }
.alert-item time { font-size: .8125rem; color: var(--text-muted); white-space: nowrap; }

/* ---- Account, 2FA ---- */
.qr { display: grid; place-items: center; width: 200px; max-width: 100%; aspect-ratio: 1; margin-inline: auto; border: 2px dashed var(--border); border-radius: var(--radius); background: #fff; color: #444; font-size: .875rem; text-align: center; padding: 12px; }
.code-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.code-list li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font: 600 1rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: center; letter-spacing: .04em; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 24px 48px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; }

/* ---- Empty state ---- */
.empty { max-width: 440px; margin: 40px auto; text-align: center; }
.empty img { width: 220px; max-width: 70%; height: auto; margin-bottom: 16px; }
.empty p { color: var(--text-muted); }
.empty .btn { margin-top: 4px; }

/* ---- Wide screens ---- */
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .site-header__bar { grid-template-columns: auto minmax(240px, 560px) 1fr; grid-template-areas: "brand search actions"; gap: 24px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
  .detail { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; }
  .layout-aside { grid-template-columns: minmax(0, 1fr) 320px; }
  .layout-aside > aside { position: sticky; top: 16px; }
  .row-scroll { margin-inline: 0; padding-inline: 0; grid-auto-columns: 210px; }
}
@media (max-width: 419px) {
  .brand__text { display: none; }
  .list-counter__label { display: none; }
  .form-card { padding: 20px 16px; }
}

/* ---- Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .product-card:hover, .btn:active { transform: none; }
}

/* ---- Print: shopping list on paper ---- */
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #000; --text-muted: #333; --border: #999; --shadow: none; color-scheme: light; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .subnav, .site-footer, .no-print, .btn, .stepper, .swap, .icon-btn, .breadcrumb { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; }
  .container { max-width: none; padding: 0; }
  .list-items, .totals { border: 0; box-shadow: none; border-radius: 0; }
  .list-item { break-inside: avoid; padding: 6px 0; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "check info price"; }
  .check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border: 1.5px solid #000; border-radius: 3px; }
  .check input:checked::after { content: "✓"; display: block; text-align: center; line-height: 13px; }
  .list-group { break-inside: avoid-page; }
  .layout-aside { display: block; }
  a { color: #000; text-decoration: none; }
}

/* ---- Utilities ---- */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.product-card__body .badge { align-self: flex-start; }
.product-grid > li { display: flex; }
.product-grid > li > .product-card { width: 100%; }
.subnav .container { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-link { white-space: nowrap; }
@media (max-width: 719px) { .nav-link { padding-inline: 10px; } }

/* ---- Product photos (real images from /img/p/{id}) ---- */
.list-item__media { display: block; flex: none; width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.list-item__media img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.list-item:has(.list-item__media) { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "check media info price" "check media actions actions"; }
.list-item__media { grid-area: media; }
.alert-item:has(.list-item__media) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.alert-item .list-item__media { width: 48px; height: 48px; }
@media print { .list-item:has(.list-item__media) { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "check media info price"; } }
.product-card__media img, .detail__media img { object-fit: contain; padding: 8%; }
.detail__media { background: var(--surface-2); overflow: hidden; }

/* ---- Review fixes: fixed-ratio image boxes, long names, narrow list rows, nav hint ---- */
.product-card__media, .detail__media { position: relative; aspect-ratio: 1; overflow: hidden; }
.product-card__media img, .detail__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.detail__media { max-height: 420px; }
.list-item__info, .alert-item > div, .detail__info, .product-card__body { min-width: 0; overflow-wrap: anywhere; }
.list-item > :first-child:not(.check):not(.list-item__media):not(.list-item__info) { grid-area: check; }
@media screen and (max-width: 479px) {
  /* thumbnail beside the name; price and controls stack underneath */
  .list-item:has(.list-item__media) { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "media info" "check price" "actions actions"; }
  .list-item__price { text-align: right; }
  .list-item__actions { justify-content: flex-start; }
}
@media (max-width: 719px) {
  .subnav .container.has-more { mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .chart text { font-size: 21px; }
}
@media (min-width: 480px) and (max-width: 719px) { .chart text { font-size: 14px; } }
@media (min-width: 720px) { .chart text { font-size: 12px; } }
.subnav .container { position: relative; }
@media screen and (max-width: 479px) { .list-item__media { align-self: start; } }

/* Long retailer names: wrap inside their column */
.product-name { overflow-wrap: anywhere; min-width: 0; }

/* ---- Review fixes 5 ---- */
.chart svg { max-height: 260px; margin-inline: auto; }
.container-narrow, .container-medium { margin-inline: auto; }
.list-item__info > a, .list-item__info > span { display: block; }
.list-item__info > .muted { margin-top: 2px; }
.list-item > form { grid-area: price; justify-self: end; }
.empty:has(+ .section) { margin-block: 8px 0; }
.empty:has(+ .section) img { width: auto; max-height: 120px; margin-bottom: 8px; }
@media screen and (max-width: 479px) {
  .list-item > form { grid-area: actions; justify-self: start; }
  .nav-link { padding-inline: 8px; font-size: .9375rem; }
}
.list-item:not(:has(.check)):not(:has(.list-item__media)) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info price"; }
@media screen and (max-width: 479px) { .list-item:not(:has(.check)):not(:has(.list-item__media)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "info" "price"; } }
@media screen and (max-width: 479px) { .list-item:not(:has(.check)):not(:has(.list-item__media)) > form { grid-area: price; justify-self: start; } }
