/* Components. Mobile-first: base styles are the phone layout,
   min-width queries add the roomier layouts. */

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: var(--tap);
    padding: var(--sp-3) var(--sp-5);
    border-radius: var(--r-pill);
    font-weight: 500;
    font-size: var(--step-0);
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s var(--ease), transform 0.05s var(--ease);
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background-color: var(--c-brand);
    color: var(--c-text-on-brand);
}

.btn--primary:hover { background-color: var(--c-brand-dark); color: var(--c-text-on-brand); }

.btn--accent {
    background-color: var(--c-accent);
    color: var(--c-text-on-brand);
}

.btn--accent:hover { background-color: var(--c-accent-dark); color: var(--c-text-on-brand); }

.btn--outline {
    background-color: transparent;
    color: var(--c-brand);
    border: 1px solid var(--c-brand);
}

.btn--outline:hover { background-color: var(--c-brand-tint); }

.btn--block { width: 100%; }

.btn__icon {
    flex: 0 0 auto;
    width: 1.25em;
    height: 1.25em;
}

/* =========================================================
   Icons
   ========================================================= */

.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

/* =========================================================
   Header / navigation
   ========================================================= */

.header {
    background-color: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}

/* Mobile: two rows — [hamburger | logo] then a full-width search field.
   The search box is the primary entry point on a comparison site, so on a
   phone it gets its own full-width row rather than being hidden. */
.header__bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding-block: var(--sp-3);
}

.header__logo {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.header__logo img {
    width: auto;
    height: 28px;
    max-width: 100%;
    object-fit: contain;
}

.header__menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    flex: 0 0 auto;
    background-color: var(--c-brand);
    color: var(--c-text-on-brand);
    border-radius: var(--r-md);
    font-size: 1.25rem;
}

.header__nav { display: none; }

.header__search--desktop { display: none; }

.header__search--mobile {
    display: block;
    padding-bottom: var(--sp-3);
}

@media (min-width: 64rem) {
    .header__bar {
        gap: var(--sp-5);
        padding-block: var(--sp-4);
    }

    .header__logo { flex: 0 0 auto; }
    .header__logo img { height: 35px; }

    .header__menu-btn { display: none; }

    .header__nav {
        display: block;
        flex: 0 0 auto;
    }

    .header__nav ul {
        display: flex;
        align-items: center;
        gap: var(--sp-2);
    }

    .header__nav a {
        display: inline-flex;
        align-items: center;
        min-height: var(--tap);
        padding: var(--sp-2) var(--sp-3);
        border-radius: var(--r-sm);
        font-weight: 500;
        color: var(--c-text-soft);
    }

    .header__nav a:hover,
    .header__nav a.active {
        color: var(--c-brand);
        background-color: var(--c-brand-tint);
        text-decoration: none;
    }

    /* Desktop: search sits in the bar; the mobile row disappears. */
    .header__search--mobile { display: none; }

    .header__search--desktop {
        display: block;
        flex: 1 1 auto;
        max-width: 26rem;
        margin-left: auto;
    }
}

/* ---------- Search field ---------- */

.search {
    position: relative;
    display: flex;
    width: 100%;
}

.search__input {
    width: 100%;
    min-height: var(--tap);
    padding: var(--sp-2) var(--sp-4) var(--sp-2) 2.75rem;
    background-color: var(--c-surface-sunken);
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    /* 16px minimum, or iOS Safari zooms the whole page on focus. */
    font-size: 1rem;
}

.search__input::placeholder { color: var(--c-text-muted); }

.search__input:focus {
    background-color: var(--c-surface);
    border-color: var(--c-brand);
    outline: none;
    box-shadow: 0 0 0 3px rgb(11 71 111 / 0.15);
}

.search__btn {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    color: var(--c-text-muted);
    font-size: 1.125rem;
}

.search__btn:hover { color: var(--c-brand); }

/* =========================================================
   Mobile navigation drawer
   ========================================================= */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-backdrop);
    background: rgb(17 17 17 / 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    width: min(20rem, 85vw);
    padding: var(--sp-4);
    padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom));
    background-color: var(--c-brand);
    color: var(--c-text-on-brand);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s var(--ease), visibility 0.25s var(--ease);
}

.drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.drawer--right {
    left: auto;
    right: 0;
    transform: translateX(100%);
    background-color: var(--c-surface);
    color: var(--c-text);
}

.drawer--right.is-open { transform: translateX(0); }

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.drawer__logo {
    background-color: var(--c-surface);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
}

.drawer__logo img { height: 26px; width: auto; }

.drawer__title { font-size: var(--step-1); }

.drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    flex: 0 0 auto;
    border-radius: var(--r-md);
    background-color: var(--c-accent);
    color: var(--c-text-on-brand);
    font-size: 1.125rem;
}

.drawer--right .drawer__close {
    background-color: var(--c-surface-sunken);
    color: var(--c-text);
}

.drawer__search { margin-bottom: var(--sp-4); }

.drawer__search .search__input {
    background-color: rgb(255 255 255 / 0.15);
    color: var(--c-text-on-brand);
}

.drawer__search .search__input::placeholder { color: rgb(255 255 255 / 0.7); }
.drawer__search .search__btn { color: rgb(255 255 255 / 0.8); }

.drawer__search .search__input:focus {
    background-color: var(--c-surface);
    color: var(--c-text);
}

.drawer__nav a {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: var(--tap);
    padding: var(--sp-3) var(--sp-2);
    color: var(--c-text-on-brand);
    font-weight: 500;
    border-bottom: 1px solid rgb(255 255 255 / 0.12);
}

.drawer__body { flex: 1 1 auto; }

/* Lock background scroll while a drawer is open. */
body.is-drawer-open { overflow: hidden; }

@media (min-width: 64rem) {
    /* Category drawer becomes the static rail on desktop. */
    .listing__rail.drawer {
        position: static;
        width: auto;
        max-width: none;
        padding: 0;
        background-color: transparent;
        color: inherit;
        transform: none;
        visibility: visible;
        overflow: visible;
        z-index: auto;
    }

    .listing__rail .drawer__head { display: none; }
}

/* =========================================================
   Sort / filter bar
   ========================================================= */

.sortbar {
    background-color: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}

/* Mobile: a horizontally scrollable chip row. Everything stays reachable
   without hiding it. */
.sortbar__scroll {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding-block: var(--sp-3);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    /* Let chips bleed to the screen edge so it reads as scrollable. */
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
}

.sortbar__scroll::-webkit-scrollbar { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    flex: 0 0 auto;
    min-height: var(--tap);
    padding: var(--sp-2) var(--sp-4);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-pill);
    background-color: var(--c-surface);
    color: var(--c-text);
    font-size: var(--step--1);
    font-weight: 500;
    white-space: nowrap;
    scroll-snap-align: start;
}

.chip:hover {
    border-color: var(--c-brand);
    text-decoration: none;
}

.chip.is-active {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: var(--c-text-on-brand);
}

.chip--filter {
    border-color: var(--c-brand);
    color: var(--c-brand);
    font-weight: 700;
}

.chip__badge {
    padding: 2px var(--sp-2);
    border-radius: var(--r-pill);
    background-color: var(--c-accent);
    color: var(--c-text-on-brand);
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chip.is-active .chip__badge {
    background-color: var(--c-highlight);
    color: var(--c-text);
}

/* The "Filter" chip only exists while the rail is a drawer. */
@media (min-width: 64rem) {
    .sortbar__scroll {
        overflow-x: visible;
        margin-inline: 0;
        padding-inline: 0;
    }

    .chip--filter { display: none; }

    .sortbar__rail-toggle {
        display: inline-flex;
        align-items: center;
        gap: var(--sp-2);
        min-height: var(--tap);
        padding: var(--sp-2) var(--sp-3);
        margin-right: auto;
        font-weight: 500;
        color: var(--c-text);
    }
}

.sortbar__rail-toggle { display: none; }

/* =========================================================
   Category tree (inside the rail / drawer)
   ========================================================= */

/* On mobile the drawer header already carries the title; on desktop that header is
   hidden, so the rail supplies its own. Exactly one is visible at any width. */
.rail__title {
    display: none;
    font-size: var(--step-1);
    margin-bottom: var(--sp-3);
}

@media (min-width: 64rem) {
    .rail__title { display: block; }
}

.cat-tree ul { padding-left: var(--sp-4); }

.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    min-height: var(--tap);
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: 2px;
    border-radius: var(--r-sm);
    font-size: var(--step-0);
    font-weight: 500;
    color: inherit;
    cursor: pointer;
}

/* inset box-shadow rather than a real border: it reads as an accent bar without
   shifting the label sideways on hover. */
.cat-item:hover,
.cat-item:focus-within {
    background-color: var(--c-brand-tint);
    color: var(--c-brand);
    box-shadow: inset 3px 0 0 var(--c-brand);
    text-decoration: none;
}

.cat-item.is-active {
    background-color: var(--c-brand);
    color: var(--c-text-on-brand);
}

.cat-item.is-active:hover {
    background-color: var(--c-brand-dark);
    color: var(--c-text-on-brand);
    box-shadow: none;
}

.cat-item__count {
    flex: 0 0 auto;
    font-size: var(--step--1);
    font-weight: 400;
    color: var(--c-text-muted);
}

.cat-item.is-active .cat-item__count,
.cat-item:hover .cat-item__count,
.drawer .cat-item__count { color: inherit; opacity: 0.75; }

/* The label navigates, the chevron only expands — so they are separate targets. */
.cat-item > a {
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
}

.cat-item > a:hover { text-decoration: none; }

.cat-item__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--tap);
    height: var(--tap);
    margin: calc(var(--sp-2) * -1) calc(var(--sp-2) * -1) calc(var(--sp-2) * -1) 0;
    border-radius: var(--r-sm);
    color: inherit;
    transition: background-color 0.15s var(--ease);
}

/* The chevron is its own target (it expands, it does not navigate), so it needs its
   own hover or the split is invisible. */
.cat-item__toggle:hover {
    background-color: var(--c-brand-tint-strong);
}

.cat-item__chevron {
    transition: transform 0.2s var(--ease);
}

.cat-item__toggle[aria-expanded="true"] .cat-item__chevron { transform: rotate(180deg); }

.subtree.is-collapsed { display: none; }

/* Inside the blue mobile drawer the tree inherits white text, so the light tint would
   be invisible — invert to a white wash with a white accent bar. */
.drawer .cat-item:hover,
.drawer .cat-item:focus-within {
    background-color: rgb(255 255 255 / 0.22);
    color: var(--c-text-on-brand);
    box-shadow: inset 3px 0 0 var(--c-text-on-brand);
}

.drawer .cat-item__toggle:hover {
    background-color: rgb(255 255 255 / 0.18);
}

.drawer .cat-item.is-active {
    background-color: var(--c-surface);
    color: var(--c-brand);
}

.drawer .cat-item.is-active:hover {
    background-color: var(--c-surface);
    color: var(--c-brand);
    box-shadow: none;
}

/* The category rail keeps its .drawer class at every width — it only *behaves* as a
   drawer below 64rem. Without this, the inverted drawer rules above also apply to the
   desktop rail, painting white text on a 22%-white wash over a white surface: the
   hover was there, it was just invisible. Restore the light scheme once the rail is
   a static rail again. */
@media (min-width: 64rem) {
    .listing__rail .cat-item:hover,
    .listing__rail .cat-item:focus-within {
        background-color: var(--c-brand-tint);
        color: var(--c-brand);
        box-shadow: inset 3px 0 0 var(--c-brand);
    }

    .listing__rail .cat-item__toggle:hover {
        background-color: var(--c-brand-tint-strong);
    }

    .listing__rail .cat-item.is-active,
    .listing__rail .cat-item.is-active:hover {
        background-color: var(--c-brand);
        color: var(--c-text-on-brand);
        box-shadow: none;
    }

    .listing__rail .cat-item.is-active:hover {
        background-color: var(--c-brand-dark);
    }

    .listing__rail .cat-item__count {
        color: var(--c-text-muted);
        opacity: 1;
    }

    .listing__rail .cat-item:hover .cat-item__count,
    .listing__rail .cat-item.is-active .cat-item__count {
        color: inherit;
        opacity: 0.75;
    }
}

/* =========================================================
   Product grid + card
   ========================================================= */

/* auto-fill + minmax gives 2-up on a 360px phone and scales up on its own —
   no col-* classes, no breakpoints. */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    /* Without this every row only sizes to the tallest card *in that row*, so row 1 can be
       taller than row 3. 1fr in an auto-height grid gives every row the height of the tallest
       card in the whole grid. */
    grid-auto-rows: 1fr;
    gap: var(--sp-4);
}

@media (min-width: 48rem) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
        gap: var(--sp-5);
    }
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--sp-3);
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    color: var(--c-text);
    transition: box-shadow 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.product-card:hover {
    border-color: var(--c-brand);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transform: translateY(-2px);
}

.product-card__media {
    aspect-ratio: 1;
    width: 100%;
    margin-bottom: var(--sp-3);
    padding: var(--sp-2);
    background-color: var(--c-img-bg);
    border-radius: var(--r-sm);
}

.product-card__media img {
    width: 100%;
    height: 100%;
    /* contain, never cover — cropping the product defeats the purpose. */
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* The title runs one or two lines and brand/store count can be empty. Reserving their height
   makes every card the same shape by construction, instead of letting the content decide. */
.product-card__name {
    font-size: var(--step-0);
    font-weight: 400;
    line-height: 1.35;
    min-height: 2.7em; /* 2 lines at line-height 1.35 */
    margin-bottom: var(--sp-2);
    /* Two readable lines beat one truncated one. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__brand {
    font-size: var(--step--1);
    line-height: 1.35;
    min-height: 1.35em;
    color: var(--c-text-muted);
    margin-bottom: var(--sp-2);
}

/* Push price + store count to the bottom so cards line up in the grid. */
.product-card__foot { margin-top: auto; }

.product-card__price {
    font-size: var(--step-2);
    font-weight: 700;
    line-height: 1.2;
    color: var(--c-text);
}

.product-card__price-prefix {
    display: block;
    font-size: var(--step--1);
    font-weight: 400;
    color: var(--c-text-muted);
}

.product-card__stores {
    margin-top: var(--sp-1);
    font-size: var(--step--1);
    font-weight: 500;
    line-height: 1.35;
    min-height: 1.35em;
    color: var(--c-brand);
}

.product-card__soldout { color: var(--c-danger); }

/* =========================================================
   Pagination
   ========================================================= */

.pager {
    display: flex;
    justify-content: center;
    margin-top: var(--sp-6);
}

.pager ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--sp-2);
}

.pager__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap);
    min-height: var(--tap);
    padding: 0 var(--sp-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background-color: var(--c-surface);
    color: var(--c-text-soft);
    font-size: var(--step-0);
    font-weight: 500;
}

.pager__link:hover {
    border-color: var(--c-brand);
    color: var(--c-brand);
    text-decoration: none;
}

.pager__link.is-active {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: var(--c-text-on-brand);
}

.pager__link.is-disabled {
    color: var(--c-border-strong);
    pointer-events: none;
}

.pager__gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--sp-5);
    color: var(--c-text-muted);
}

/* =========================================================
   Empty state
   ========================================================= */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    min-height: 20rem;
    padding: var(--sp-6) var(--sp-4);
    text-align: center;
    color: var(--c-text-muted);
}

.empty img { max-width: 15rem; opacity: 0.5; }

/* =========================================================
   Breadcrumb
   ========================================================= */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    padding-block: var(--sp-3);
    font-size: var(--step--1);
    color: var(--c-text-muted);
}

.breadcrumb a { color: var(--c-text-soft); }
.breadcrumb a:hover { color: var(--c-brand); }
.breadcrumb__sep { color: var(--c-border-strong); }
.breadcrumb [aria-current="page"] { color: var(--c-text); font-weight: 500; }

/* =========================================================
   Product gallery
   ========================================================= */

.gallery__main {
    aspect-ratio: 1;
    width: 100%;
    padding: var(--sp-4);
    background-color: var(--c-img-bg);
    border-radius: var(--r-lg);
}

.gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.gallery__thumbs {
    display: flex;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    overflow-x: auto;
    scrollbar-width: none;
}

.gallery__thumbs::-webkit-scrollbar { display: none; }

.gallery__thumb {
    flex: 0 0 auto;
    width: 4.5rem;
    height: 4.5rem;
    padding: var(--sp-2);
    background-color: var(--c-img-bg);
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
}

.gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.gallery__thumb.is-active { border-color: var(--c-brand); }

@media (min-width: 48rem) {
    .gallery__thumb { width: 5.5rem; height: 5.5rem; }
}

/* =========================================================
   Product info (hero)
   ========================================================= */

.product-info__title {
    font-size: var(--step-3);
    margin-bottom: var(--sp-3);
}

.product-info__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    font-size: var(--step--1);
    color: var(--c-text-muted);
    margin-bottom: var(--sp-4);
}

.product-info__meta strong { color: var(--c-text); font-weight: 500; }

/* Trust signals. Every claim here must be derivable from real data —
   no invented delivery or stock promises. */
.trust {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    margin-bottom: var(--sp-4);
    background-color: var(--c-success-tint);
    border-radius: var(--r-md);
    font-size: var(--step--1);
}

.trust__item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--c-success);
    font-weight: 500;
}

/* The trust list is green by default; "sold out everywhere" is the one line that isn't reassuring. */
.trust__item--warning { color: var(--c-danger); }

.trust__item .icon { width: 1.1em; height: 1.1em; }

.product-info__specs {
    display: grid;
    gap: var(--sp-1);
    margin-bottom: var(--sp-4);
    font-size: var(--step-0);
}

.product-info__specs li {
    display: flex;
    gap: var(--sp-2);
}

.product-info__specs strong { font-weight: 500; color: var(--c-text-soft); }

.product-info__desc {
    margin-bottom: var(--sp-4);
    color: var(--c-text-soft);
    font-size: var(--step-0);
}

/* The buy box: price + primary CTA. On mobile this stacks and the CTA
   goes full width. */
.buybox {
    padding: var(--sp-4);
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.buybox__label {
    display: block;
    font-size: var(--step--1);
    color: var(--c-text-muted);
}

.buybox__info {
    min-width: 0;
}

.buybox__price {
    display: block;
    font-size: var(--step-price);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--sp-1);
    /* Never let "€ 8,33" break across two lines. */
    white-space: nowrap;
}

.buybox__note {
    display: block;
    font-size: var(--step--1);
    color: var(--c-text-muted);
    margin-bottom: var(--sp-4);
}

@media (min-width: 48rem) {
    .buybox {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--sp-4);
    }

    .buybox__info { flex: 1 1 8rem; }
    .buybox__note { margin-bottom: 0; }

    /* flex-shrink allowed: the CTA gives way before it can push the box
       past the column and cause a horizontal scrollbar. */
    .buybox__cta {
        flex: 0 1 auto;
        width: auto;
        min-width: 10rem;
    }
}

/* =========================================================
   Sticky mobile CTA
   ========================================================= */

.sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--gutter);
    padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
    background-color: var(--c-surface);
    border-top: 1px solid var(--c-border);
    box-shadow: var(--shadow-up);
    transform: translateY(110%);
    visibility: hidden;
    /* Must not swallow taps on the content behind it while hidden. */
    pointer-events: none;
    transition: transform 0.25s var(--ease), visibility 0.25s var(--ease);
}

.sticky-cta.is-visible {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

.sticky-cta__price {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
}

.sticky-cta__amount {
    display: block;
    font-size: var(--step-2);
    font-weight: 700;
}

.sticky-cta__label {
    display: block;
    font-size: var(--step--1);
    color: var(--c-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sticky-cta__btn { flex: 0 0 auto; }

/* Desktop keeps the CTA in the buy box; no need for a bar. */
@media (min-width: 64rem) {
    .sticky-cta { display: none; }
}

/* =========================================================
   Provider (offer) table -> cards on mobile
   ========================================================= */

.offers { padding-block: var(--sp-5); }

/* Mobile: the table restacks into one card per offer. Single semantic
   <table> in the DOM — no duplicated markup, no sideways scrolling. */
.offer-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.offer-table,
.offer-table tbody,
.offer-table tr,
.offer-table td {
    display: block;
}

.offer-table tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--sp-1) var(--sp-3);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
}

.offer-table tr.is-best {
    border-color: var(--c-success);
    border-width: 2px;
}

.offer-table td { padding: 0; }

/* Label each cell from its data-label so the card still reads as a table. */
.offer-table td::before {
    content: attr(data-label);
    display: block;
    font-size: var(--step--1);
    color: var(--c-text-muted);
}

.offer__shop {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: var(--step-1);
}

.offer__shop::before { display: none !important; }

.offer__price,
.offer__shipping { font-size: var(--step-0); }

.offer__total {
    grid-column: 1 / -1;
    font-size: var(--step-2);
    font-weight: 700;
}

.offer__cta { grid-column: 1 / -1; margin-top: var(--sp-2); }
.offer__cta::before { display: none !important; }
.offer__cta .btn { width: 100%; }

.offer__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 2px var(--sp-2);
    margin-left: var(--sp-2);
    border-radius: var(--r-pill);
    background-color: var(--c-success);
    color: var(--c-text-on-brand);
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.offer__badge--out { background-color: var(--c-danger); }

/* Delivery text under the shop name. Needs its own block/weight/size: .offer__shop is bold and,
   on mobile, spans the full card width. */
.offer__stock {
    display: block;
    margin-top: 2px;
    color: var(--c-text-muted);
    font-size: var(--step--1);
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.offer__stock-icon {
    width: 0.875em;
    height: 0.875em;
    margin-right: var(--sp-1);
    vertical-align: -0.125em;
}

/* Sold out: dim the numbers, never the CTA. The row stays readable and clickable — the shop page
   is still where a visitor goes to check back. */
.offer-table tr.is-unavailable .offer__price,
.offer-table tr.is-unavailable .offer__shipping,
.offer-table tr.is-unavailable .offer__total { color: var(--c-text-muted); }

.offer__free { color: var(--c-success); font-weight: 500; }

/* Tablet and up: a real table again. */
@media (min-width: 48rem) {
    .offer-table { display: table; }
    .offer-table thead {
        position: static;
        width: auto;
        height: auto;
        clip-path: none;
        display: table-header-group;
    }
    .offer-table tbody { display: table-row-group; }

    .offer-table tr {
        display: table-row;
        padding: 0;
        margin: 0;
        border: none;
        border-bottom: 1px solid var(--c-border);
        background-color: transparent;
        border-radius: 0;
    }

    .offer-table tr.is-best { border-color: var(--c-border); background-color: var(--c-success-tint); }

    .offer-table th {
        padding: var(--sp-3) var(--sp-4);
        background-color: var(--c-surface-sunken);
        color: var(--c-brand);
        font-weight: 500;
        text-align: left;
    }

    .offer-table th:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
    .offer-table th:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }

    .offer-table td {
        display: table-cell;
        padding: var(--sp-4);
        vertical-align: middle;
    }

    .offer-table td::before { display: none; }

    .offer__total { font-size: var(--step-1); }
    .offer__cta { margin-top: 0; text-align: right; }
    .offer__cta .btn { width: auto; }
}

/* Sortable column headers are real buttons: keyboard-reachable and
   big enough to tap. */
.offer-table__sort {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    min-height: var(--tap);
    color: inherit;
    font: inherit;
    font-weight: 500;
}

.offer-table__sort:hover { color: var(--c-brand-dark); }
.offer-table__sort .sort-indicator { font-size: 0.625rem; }

/* =========================================================
   Tabs (description / specs)
   ========================================================= */

.tabs { padding-block: var(--sp-5); }

.tabs__menu {
    display: flex;
    gap: var(--sp-2);
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs__menu::-webkit-scrollbar { display: none; }

.tabs__btn {
    flex: 0 0 auto;
    min-height: var(--tap);
    padding: var(--sp-2) var(--sp-4);
    border-bottom: 2px solid transparent;
    color: var(--c-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.tabs__btn:hover { color: var(--c-brand); text-decoration: none; }

.tabs__btn.is-active {
    border-bottom-color: var(--c-brand);
    color: var(--c-brand);
}

.tabs__panel { padding-block: var(--sp-4); }
.tabs__panel.is-hidden { display: none; }
.tabs__panel p { color: var(--c-text-soft); margin-bottom: var(--sp-3); }
.tabs__panel ul { display: grid; gap: var(--sp-2); }

.spec-table td {
    padding: var(--sp-3);
    border-bottom: 1px solid var(--c-border);
    font-size: var(--step-0);
}

.spec-table tr:nth-child(odd) { background-color: var(--c-surface-sunken); }
.spec-table td:first-child { font-weight: 500; width: 40%; }

/* =========================================================
   Price chart
   ========================================================= */

.chart-section { padding-block: var(--sp-5); }

.chart-section__ranges {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    overflow-x: auto;
    scrollbar-width: none;
}

.chart-section__ranges::-webkit-scrollbar { display: none; }

/* =========================================================
   Related products
   ========================================================= */

.related {
    background-color: var(--c-brand);
    padding-block: var(--sp-6);
}

.related__title {
    color: var(--c-text-on-brand);
    text-align: center;
    margin-bottom: var(--sp-5);
}

.related .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

/* =========================================================
   Brands page
   ========================================================= */

.brands { padding-block: var(--sp-6); }

.brands__title { text-align: center; margin-bottom: var(--sp-5); }
.brands__title span { color: var(--c-brand); }

.brands__controls {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}

.brands__letters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.brands__letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap);
    min-height: var(--tap);
    border: 1px solid var(--c-brand);
    border-radius: var(--r-pill);
    color: var(--c-text);
    font-size: var(--step--1);
    font-weight: 500;
}

.brands__letter:hover { background-color: var(--c-brand-tint); text-decoration: none; }

.brands__letter.is-active {
    background-color: var(--c-brand);
    color: var(--c-text-on-brand);
}

.brand-group { margin-bottom: var(--sp-6); }
.brand-group[hidden] { display: none; }

.brands__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--sp-3);
    margin-top: var(--sp-3);
}

.brands__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    min-height: var(--tap);
    padding: var(--sp-3);
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    color: var(--c-text);
    font-weight: 500;
}

.brands__item:hover { border-color: var(--c-brand); color: var(--c-brand); text-decoration: none; }
.brands__item span { color: var(--c-text-muted); font-size: var(--step--1); font-weight: 400; }

/* display:flex would otherwise beat the [hidden] attribute the filter sets. */
.brands__item[hidden] { display: none; }

@media (min-width: 48rem) {
    .brands__controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .brands__controls .search { max-width: 20rem; }
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
    padding-block: var(--sp-6);
    padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
    background-color: var(--c-surface-sunken);
    border-top: 1px solid var(--c-border);
    text-align: center;
    color: var(--c-text-muted);
    font-size: var(--step--1);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-2) var(--sp-4);
    margin-bottom: var(--sp-3);
}

.footer__links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    color: var(--c-text-soft);
    font-weight: 500;
}

/* =========================================================
   Cookie / consent banner
   ========================================================= */

.consent {
    position: fixed;
    left: var(--sp-3);
    right: var(--sp-3);
    bottom: var(--sp-3);
    bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
    z-index: calc(var(--z-drawer) + 10);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    max-width: 32rem;
    margin-inline: auto;
    padding: var(--sp-4);
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    font-size: var(--step--1);
}

.consent[hidden] { display: none; }

.consent__actions {
    display: flex;
    gap: var(--sp-2);
}

.consent__actions .btn { flex: 1 1 0; }

/* =========================================================
   Category content (bottom of category listing)
   ========================================================= */

.category-content {
    padding-block: var(--sp-6) var(--sp-7);
}

.category-content__facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    margin: 0 0 var(--sp-4);
    padding: 0;
    list-style: none;
    font-size: var(--step--1);
    color: var(--c-text-soft);
}

.category-content__facts li {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}

/* Interpunct between facts, but not before the first one. */
.category-content__facts li + li::before {
    content: "·";
    color: var(--c-border-strong);
}

.category-content__prose {
    max-width: 70ch;
    color: var(--c-text-soft);
    font-size: var(--step-0);
    line-height: 1.7;
}

.category-content__prose h2 {
    margin: 0 0 var(--sp-3);
    color: var(--c-text);
    font-size: var(--step-2);
}

.category-content__prose h3 {
    margin: var(--sp-5) 0 var(--sp-2);
    color: var(--c-text);
    font-size: var(--step-1);
}

.category-content__prose p { margin: 0 0 var(--sp-3); }

.category-content__prose ul,
.category-content__prose ol { margin: 0 0 var(--sp-3) var(--sp-5); }

.category-content__prose a {
    color: var(--c-brand);
    text-decoration: underline;
}
