/* ==========================================================================
   billigerda.de — public site
   --------------------------------------------------------------------------
   Palette taken from the BilligerDa robin (the app logo):
     robin  — the red breast, used for price tags and nothing decorative
     ink    — the logo's outline
     frost  — the page: a cool winter grey (the robin is a winter bird)
     bark   — the brown of the robin's back, for secondary text
   Type: the app's own fonts — Prompt (prices, headings) + Heebo (text).
   House rules kept here: no font-size under 15px; hover changes colour
   only (never moves, lifts or adds a shadow); text never touches an edge.
   ========================================================================== */

@font-face { font-family: "Prompt"; font-weight: 800; font-display: swap; src: url("../fonts/Prompt-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Prompt"; font-weight: 600; font-display: swap; src: url("../fonts/Prompt-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Heebo";  font-weight: 400; font-display: swap; src: url("../fonts/Heebo-Regular.ttf") format("truetype"); }
@font-face { font-family: "Heebo";  font-weight: 500; font-display: swap; src: url("../fonts/Heebo-Medium.ttf") format("truetype"); }
@font-face { font-family: "Heebo";  font-weight: 700; font-display: swap; src: url("../fonts/Heebo-Bold.ttf") format("truetype"); }

:root {
    --robin: #D70005;
    --robin-deep: #A80004;      /* hover / pressed red */
    --ink: #1A1A18;
    --paper: #FFFFFF;
    --frost: #EEF1F3;
    --bark: #6A5A4C;            /* 5.7:1 on frost, 6.6:1 on paper */
    --line: #D5DBE0;

    --font-display: "Prompt", "Arial Narrow", system-ui, sans-serif;
    --font-text: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;

    --gutter: clamp(16px, 4vw, 40px);
    --card-w: 224px;
    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--frost);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 17px;
    line-height: 1.5;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--robin); outline-offset: 3px; }

/* Numbers that line up (dates, counts) */
.mono { font-variant-numeric: tabular-nums; }

/* A date (YYYY-MM-DD) must never break at its hyphens */
.nowrap, .mono { white-space: nowrap; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
    position: absolute; left: 16px; top: -100px;
    padding: 10px 16px;
    background: var(--ink); color: var(--paper);
    font-size: 16px;
    z-index: 10;
}
.skip:focus { top: 16px; }

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

/* ---------- Header ------------------------------------------------------- */

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }

.masthead__bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    min-height: 76px;
    padding-top: 10px; padding-bottom: 10px;
}

.masthead__logo img { width: 180px; height: auto; }

.masthead__week {
    display: flex; align-items: center; gap: 12px;
    margin: 0;
    font-size: 15px;
    color: var(--bark);
}

/* «KW 40» — a small tag in the same language as the price tags */
.kw {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--ink); color: var(--paper);
    font-family: var(--font-display); font-weight: 800;
    font-size: 17px; letter-spacing: .02em;
}

/* ---------- Intro + jump bar -------------------------------------------- */

.intro { padding: 40px 0 8px; }

.intro__title {
    margin: 0;
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(34px, 6vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.intro__text { margin: 12px 0 0; max-width: 60ch; color: var(--bark); font-size: 18px; }

.jump { margin-top: 24px; }

/* The chips wrap on wide screens and scroll on a phone */
.jump__list {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin: 0; padding: 0; list-style: none;
}

.jump__chip {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 48px;
    padding: 6px 14px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    text-decoration: none;
    font-size: 15px; font-weight: 500;
    transition: border-color .15s, color .15s;
}
.jump__chip:hover { border-color: var(--robin); color: var(--robin); }
.jump__chip img { width: auto; max-width: 56px; height: 28px; object-fit: contain; }

.jump__count {
    font-variant-numeric: tabular-nums;
    color: var(--bark);
    font-size: 15px;
}

/* ---------- Notices (error / empty) ------------------------------------- */

.notice {
    margin-top: 32px; margin-bottom: 32px;
    padding-top: 24px; padding-bottom: 24px;
    background: var(--paper);
    border-left: 6px solid var(--robin);
    border-radius: var(--radius);
}
.notice__title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.notice p { margin: 0; color: var(--bark); }

/* ---------- A retailer row (the «shelf») -------------------------------- */

.shelf { padding: 36px 0 8px; }
.shelf + .shelf { border-top: 1px solid var(--line); }

.shelf__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.shelf__who { display: flex; align-items: center; gap: 16px; min-width: 0; }

.shelf__logo {
    flex: none;
    display: grid; place-items: center;
    width: 88px; height: 56px;
    padding: 8px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.shelf__logo img { width: auto; max-width: 72px; max-height: 40px; object-fit: contain; }

.shelf__name {
    margin: 0;
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.1;
}

.shelf__count { margin: 2px 0 0; color: var(--bark); font-size: 15px; }

.shelf__nav { display: flex; gap: 8px; flex: none; }
.shelf__nav[hidden] { display: none; }

.icon-btn {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    padding: 0;
    border: 1px solid var(--line); border-radius: 50%;
    background: var(--paper); color: var(--ink);
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--robin); color: var(--robin); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* The track bleeds to the screen edge on small screens, so a half-visible
   card at the right says «there is more» without any extra hint. */
.wrap--track { padding-right: 0; }

.track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--card-w);
    gap: 16px;
    margin: 0;
    padding: 14px var(--gutter) 24px 2px;   /* top room for the tilted tags */
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}
.track:focus-visible { outline-offset: -3px; }

@media (min-width: 1360px) {
    .wrap--track { padding-right: var(--gutter); }
    .track { padding-right: 2px; }
}

/* ---------- Offer card --------------------------------------------------- */

.offer { scroll-snap-align: start; display: flex; }

.offer__card {
    display: flex; flex-direction: column;
    width: 100%;
    padding: 12px 14px 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color .15s;
}
a.offer__card:hover { border-color: var(--robin); }
a.offer__card:hover .offer__name { color: var(--robin); }

/* The photo frame is ALWAYS a square of the card's width. The image is taken
   out of the flow (absolute) on purpose: in the flow, a portrait photo (a
   bottle, a dress — Alnatura, dm, Kaufland) pushes the frame taller than
   aspect-ratio asks, and every card of the row ends up a different size. */
.offer__photo {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    margin: 0 -2px;
    background: var(--paper);
}
.offer__photo img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;            /* the whole product, letterboxed */
}

/* Shown only when the photo fails to load (site.js adds .is-missing) */
.offer__nophoto {
    display: none;
    position: absolute; inset: 0;
    place-items: center;
    background: var(--frost) url("../icons/icon-192.png") center 22% / 64px no-repeat;
    border-radius: 6px;
    padding: 58% 12px 0;             /* text right under the robin, above the price tag */
    align-content: start;
    text-align: center;
    color: var(--bark);
    font-size: 15px;
}
.offer__photo.is-missing img { visibility: hidden; }
.offer__photo.is-missing .offer__nophoto { display: grid; }

/* --- The price tag: stuck onto the photo's lower edge, slightly askew,
       like the red «Aktion» stickers on a German shelf. The one bold move. */
.tag {
    align-self: flex-start;
    display: inline-flex; flex-direction: column; align-items: flex-start;
    margin: -34px 0 0 -4px;
    padding: 4px 14px 6px 12px;
    background: var(--robin);
    color: var(--paper);
    border-radius: 6px 6px 6px 2px;
    transform: rotate(-3deg);
    transform-origin: left bottom;
    position: relative; z-index: 1;
}

.tag__saving {
    font-family: var(--font-display); font-weight: 800;
    font-size: 15px; line-height: 1.2;
    letter-spacing: .01em;
}

.tag__price {
    display: inline-flex; align-items: flex-start;
    font-family: var(--font-display); font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.tag__eur { font-size: 42px; letter-spacing: -0.02em; }
.tag__ct  { font-size: 22px; margin: 4px 0 0 2px; }                 /* the raised cents */
.tag__cur { font-size: 18px; margin: 5px 0 0 3px; font-weight: 600; }

.tag__text { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.2; padding: 4px 0; }

.offer__before {
    margin-top: 8px;
    color: var(--bark);
    font-size: 15px;
    text-decoration: line-through;
    text-decoration-color: var(--robin);
    text-decoration-thickness: 2px;
}

.offer__name {
    display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    transition: color .15s;
}

.offer__meta { margin-top: 4px; color: var(--bark); font-size: 15px; line-height: 1.35; }

.offer__foot {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    margin-top: auto;
    padding-top: 12px;
    font-size: 15px;
    color: var(--bark);
}

.offer__label {
    padding: 1px 8px;
    border: 1px solid var(--robin);
    border-radius: 4px;
    color: var(--robin);
    font-weight: 500;
}

/* ---------- Footer ------------------------------------------------------- */

.footer { margin-top: 48px; background: var(--paper); border-top: 1px solid var(--line); }

.footer__bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
    padding-top: 24px; padding-bottom: 24px;
    color: var(--bark);
    font-size: 15px;
}
.footer__bar p { margin: 0; }
.footer__bar p:last-child { margin-left: auto; }

/* ---------- Search (header) and results -------------------------------- */

.search {
    flex: 1 1 360px;
    max-width: 560px;
    display: flex;
    margin: 0 8px;
}
.search__input {
    flex: 1; min-width: 0;
    height: 46px; padding: 0 16px;
    border: 1px solid var(--line); border-right: 0;
    border-radius: 10px 0 0 10px;
    background: var(--frost); color: var(--ink);
    font: 400 16px var(--font-text);
    transition: border-color .15s, background-color .15s;
}
.search__input::placeholder { color: var(--bark); opacity: 1; }
.search__input:focus { outline: 0; border-color: var(--ink); background: var(--paper); }
.search__btn {
    display: grid; place-items: center;
    width: 52px; height: 46px;
    border: 1px solid var(--ink); border-radius: 0 10px 10px 0;
    background: var(--ink); color: var(--paper);
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.search__btn:hover { background: var(--robin); border-color: var(--robin); }

.search-head { padding: 24px 0 8px; }
.block--first { padding-top: 16px; }
.block__count {
    display: inline-block; vertical-align: middle;
    margin-left: 8px; padding: 2px 10px;
    border-radius: 999px; background: var(--ink); color: var(--paper);
    font-family: var(--font-text); font-size: 16px; font-weight: 700;
}

/* A catalogue product: same frame as an offer, but the price in ink — the
   red shelf tag stays reserved for offers. */
.product__price {
    margin-top: 10px;
    font-family: var(--font-display); font-weight: 800;
    font-size: 24px; line-height: 1.1;
    color: var(--ink);
}

/* Retailer logo on an offer photo (mixed lists: search, similar offers) */
.offer__retail {
    position: absolute; top: 0; left: 0; z-index: 1;
    display: grid; place-items: center;
    min-width: 56px; height: 34px; padding: 4px 8px;
    background: var(--paper);
    border: 1px solid var(--line); border-radius: 8px;
    font-size: 15px; font-weight: 700; color: var(--ink);
}
.offer__retail img { width: auto; max-width: 56px; max-height: 24px; object-fit: contain; }

/* Retailer logos under a catalogue product */
.product__retails { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.product__retail {
    display: grid; place-items: center;
    min-width: 48px; height: 32px; padding: 3px 6px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
    font-size: 15px; color: var(--ink);
}
.product__retail img { width: auto; max-width: 44px; max-height: 22px; object-fit: contain; }
.product__more { font-size: 15px; font-weight: 700; color: var(--bark); }

/* ---------- Crumbs, links in rows ---------------------------------------- */

.crumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 20px 0 0;
    font-size: 15px;
    color: var(--bark);
}
.crumbs a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; transition: color .15s; }
.crumbs a:hover { color: var(--robin); }
.crumbs [aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

.shelf__all { color: var(--ink); font-weight: 500; text-underline-offset: 3px; transition: color .15s; }
.shelf__all:hover { color: var(--robin); }

/* ---------- Retailer page ------------------------------------------------ */

.retail-head { display: flex; align-items: center; gap: 20px; padding-top: 24px; padding-bottom: 24px; }
.retail-head__title {
    margin: 0;
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(30px, 5vw, 48px); line-height: 1.05;
}
.shelf__logo--big { width: 120px; height: 72px; }
.shelf__logo--big img { max-width: 96px; max-height: 56px; }

/* Cards in a wrapping grid (the rows on the home page scroll instead) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px 16px;
    margin: 0; padding: 14px 0 8px;   /* top room for the tilted tags */
    list-style: none;
}

/* ---------- Pager: count left · pages centre · per page right ------------ */

.pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    padding: 0 12px;
}
.pager__count { justify-self: start; margin: 0; font-size: 15px; font-weight: 500; color: var(--bark); }
.pager__nav { justify-self: center; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager__btn {
    display: inline-grid; place-items: center;
    min-width: 42px; height: 42px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--paper); color: var(--ink);
    font-size: 15px; font-weight: 700; text-decoration: none;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s, color .15s;
}
a.pager__btn:hover { border-color: var(--robin); color: var(--robin); }
.pager__btn.is-cur { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pager__btn.is-off { opacity: .35; }
.pager__gap { padding: 0 2px; color: var(--bark); }
.pager__per { justify-self: end; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--bark); }
.pager__select {
    height: 42px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--paper); color: var(--ink);
    font: 700 15px var(--font-text);
}
.pager__apply {
    height: 42px; padding: 0 14px;
    border: 1px solid var(--ink); border-radius: 10px;
    background: var(--ink); color: var(--paper);
    font: 700 15px var(--font-text); cursor: pointer;
}
.js .pager__apply { display: none; }     /* site.js submits on change */

/* ---------- Offer detail ------------------------------------------------- */

.detail {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 40px;
    padding-top: 24px; padding-bottom: 16px;
}

.detail__photo {
    margin: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.detail__photo img { padding: 24px; }
.detail__photo .offer__nophoto { padding-top: 60%; background-size: 120px; background-position: center 35%; }

.detail__retail {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 10px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--paper);
    font-size: 15px; font-weight: 500; text-decoration: none;
    transition: border-color .15s, color .15s;
}
.detail__retail:hover { border-color: var(--robin); color: var(--robin); }
.detail__retail img { width: auto; max-width: 56px; height: 28px; object-fit: contain; }

.detail__name {
    margin: 16px 0 0;
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(28px, 4vw, 42px); line-height: 1.1;
    overflow-wrap: anywhere;
}
.detail__desc { margin: 10px 0 0; color: var(--bark); max-width: 60ch; }

.detail__price { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; margin: 30px 0 6px; }
.tag--big { margin: 0; transform: rotate(-2deg); padding: 6px 18px 10px 16px; }
.tag--big .tag__eur { font-size: 72px; }
.tag--big .tag__ct { font-size: 34px; margin-top: 8px; }
.tag--big .tag__cur { font-size: 26px; margin-top: 10px; }
.tag--big .tag__saving { font-size: 20px; }
.detail__before { margin: 0; font-size: 18px; }

/* Facts: label | value, two columns of a definition list */
.facts { margin: 24px 0 0; border-top: 1px solid var(--line); }
.facts__row {
    display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 16px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--bark); font-size: 15px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts--stack .facts__row { grid-template-columns: 1fr; gap: 2px; }

.detail__valid { margin: 18px 0 0; color: var(--bark); }
.notice--inline { margin: 16px 0 0; padding: 12px 16px; }

.btn {
    display: inline-flex; align-items: center; gap: 10px;
    margin-top: 24px;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--robin); color: var(--paper);
    font-weight: 700; font-size: 16px; text-decoration: none;
    transition: background-color .15s;
}
.btn:hover { background: var(--robin-deep); }

/* ---------- Content blocks under the offer ------------------------------- */

.block { padding-top: 40px; }
.block__title {
    margin: 0;
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(24px, 3vw, 32px); line-height: 1.1;
}
.block__intro { margin: 6px 0 18px; color: var(--bark); max-width: 70ch; }
.block__source { margin: 14px 0 0; font-size: 15px; color: var(--bark); }
.block__source a { color: var(--ink); text-underline-offset: 3px; }

/* The four history figures */
.stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
    margin: 0 0 18px;
}
.stats__item { padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.stats dt { font-size: 15px; color: var(--bark); }
.stats dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; }

/* ---------- Price chart (HTML labels over a stretched SVG) --------------- */

.chart { margin: 0; padding: 20px 20px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.chart__plot {
    position: relative;
    height: 280px;
    margin: 10px 16px 40px 84px;        /* room for the y labels (left) and dates (below) */
}
.chart__plot:focus-visible { outline-offset: 8px; }
.chart__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart__line { fill: none; stroke: var(--robin); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

.chart__ytick {
    position: absolute; right: calc(100% + 12px);
    transform: translateY(-50%);
    font-size: 15px; color: var(--bark); white-space: nowrap;
}
.chart__xtick {
    position: absolute; top: calc(100% + 10px);
    transform: translateX(-50%);
    font-size: 15px; color: var(--bark); white-space: nowrap;
}
.chart__xtick:first-of-type { transform: none; }
.chart__xtick:last-of-type { transform: translateX(-100%); }

/* Promotion day: ≥ 8px marker with a 2px surface ring */
.chart__dot, .chart__keydot {
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--robin);
    box-shadow: 0 0 0 2px var(--paper);
}
.chart__dot { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.chart__key { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--bark); }
.chart__keydot { display: inline-block; box-shadow: none; }

.chart__last {
    position: absolute; transform: translate(10px, -130%);
    font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.chart__last[style*="left: 100%"] { transform: translate(-100%, -130%); }

/* Hover / keyboard layer (site.js) */
.chart__cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--bark); pointer-events: none; }
.chart__hover {
    position: absolute; width: 13px; height: 13px; border-radius: 50%;
    background: var(--paper); border: 3px solid var(--robin);
    transform: translate(-50%, -50%); pointer-events: none;
}
.chart__tip {
    position: absolute; top: 0; z-index: 2;
    min-width: 170px; padding: 10px 12px;
    background: var(--ink); color: var(--paper);
    border-radius: 8px;
    font-size: 15px; line-height: 1.4;
    pointer-events: none;
}
.chart__tip strong { display: block; font-family: var(--font-display); font-size: 20px; }

.chart__table { margin-top: 12px; }
.chart__table summary { cursor: pointer; font-size: 15px; font-weight: 500; padding: 6px 0; }

/* ---------- Tables ------------------------------------------------------- */

.table-scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-size: 15px; font-weight: 700; color: var(--bark); background: var(--frost); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table a { color: var(--ink); text-underline-offset: 3px; transition: color .15s; }
.table a:hover { color: var(--robin); }
.table tr.is-this td { background: #FFF4F4; }

.pill {
    display: inline-block; margin-left: 8px;
    white-space: nowrap;
    padding: 1px 8px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--frost);
    font-size: 15px; font-weight: 500; color: var(--ink);
}
.pill--best { border-color: var(--robin); background: var(--paper); color: var(--robin); }

/* ---------- Nutrition (Open Food Facts) ---------------------------------- */

.nutrition { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }

.scores { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.score {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 6px 6px 14px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
    font-size: 15px;
}
.score strong {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
    font-family: var(--font-display); font-size: 20px; color: #fff;
}
/* The official Nutri-Score / Eco-Score letter colours */
.score--a strong { background: #038141; }
.score--b strong { background: #5A8A1F; }
.score--c strong { background: #F5C000; color: var(--ink); }
.score--d strong { background: #E07000; }
.score--e strong { background: #D93A10; }
.score--nova strong { background: var(--ink); }
.pill--flag { margin-left: 0; align-self: center; padding: 6px 12px; }

.table--nutrition { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table--nutrition caption { caption-side: top; text-align: left; padding: 0 0 8px; font-size: 15px; color: var(--bark); }
.table--nutrition th[scope="row"] { font-weight: 500; }
.table--nutrition tr.is-sub th { padding-left: 32px; color: var(--bark); font-weight: 400; }

/* ---------- Small screens ----------------------------------------------- */

@media (max-width: 640px) {
    :root { --card-w: 176px; }

    .masthead__bar { min-height: 64px; flex-wrap: wrap; row-gap: 10px; }
    .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
    .masthead__logo img { width: 140px; }
    .masthead__range { display: none; }             /* the intro repeats the dates */

    .intro { padding-top: 28px; }

    /* One scrolling line of chips instead of a tall wrapped block */
    .jump__list {
        flex-wrap: nowrap; overflow-x: auto;
        margin-right: calc(var(--gutter) * -1);
        padding: 2px var(--gutter) 8px 2px;
        scrollbar-width: none;
    }
    .jump__list li { flex: none; }

    .shelf__logo { width: 72px; height: 48px; }
    .shelf__nav { display: none; }                  /* swipe on touch screens */

    .tag__eur { font-size: 36px; }
    .tag__ct { font-size: 20px; }

    .footer__bar p:last-child { margin-left: 0; }

    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .pager { grid-template-columns: 1fr; justify-items: center; }
    .pager__count, .pager__per { justify-self: center; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats dd { font-size: 22px; }
    .chart { padding: 16px 12px 10px; }
    .chart__plot { height: 220px; margin-left: 74px; margin-right: 8px; }
    .chart__xtick--mid { display: none; }
    .tag--big .tag__eur { font-size: 56px; }
    .tag--big .tag__ct { font-size: 28px; }
}

/* Stack the two-column parts when half the width is too narrow */
@media (max-width: 860px) {
    .detail, .nutrition { grid-template-columns: 1fr; gap: 24px; }
    .detail__photo { max-width: 520px; }
}

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