/* ================================================================
   shop.css — public storefront (home, listing, product, cart, checkout)
   ================================================================
   Colours come from the theme variables in layout.css, so dark and
   light mode work without any hardcoded colour here.
   ================================================================ */

:root {
    --shop-radius: 12px;
    --shop-gap: 16px;
    --shop-price: var(--accent);
    --shop-sale: #e11d48;
    --shop-star: #f59e0b;
    --shop-ok: #16a34a;
    --shop-warn: #d97706;
}

.shop-body {
    background: var(--bg-base);
    color: var(--tx-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip; /* no stray element can make the page scroll sideways; unlike hidden it keeps the sticky header working */
}

.shop-main {
    flex: 1;
    padding: 20px 0 8px;
}

.shop-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── Top strip ──────────────────────────────────────────────── */
.shop-strip {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--tx-secondary);
}

.shop-strip .shop-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    gap: 12px;
}

.shop-strip a,
.shop-strip button {
    color: var(--tx-secondary);
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    cursor: pointer;
}

.shop-strip a:hover,
.shop-strip button:hover {
    color: var(--accent);
}

/* ── Header ─────────────────────────────────────────────────── */
.shop-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.shop-header__bar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 68px;
}

.shop-header .brand-logo {
    --logo-h: 40px;
}

/* Matches layout.css's mobile breakpoint, where the stacked lockup takes over. */
@media (max-width: 768px) {
    .shop-header .brand-logo {
        --logo-h: 48px;
    }
}

/* Search: a soft pill with the category chip, the input and a round button set inside it */
.shop-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 4px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.shop-search:focus-within {
    background: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* The select is the chip itself, so all of it is tappable; the two icons ride on top of it */
.shop-search__cat {
    position: relative;
    flex: none;
}

.shop-search__cat i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tx-muted);
    font-size: 0.8125rem;
    pointer-events: none;
}

.shop-search__cat i:first-child {
    left: 14px;
}

.shop-search__cat i:last-child {
    right: 13px;
    font-size: 0.625rem;
}

.shop-search select {
    max-width: 210px;
    height: 38px;
    padding: 0 32px 0 36px;
    appearance: none;
    background: var(--bg-hover);
    border: 0;
    border-radius: 999px;
    outline: none;
    color: var(--tx-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-overflow: ellipsis;
    cursor: pointer;
}

.shop-search select option {
    background: var(--bg-surface);
    color: var(--tx-primary);
}

.shop-search input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    appearance: none;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--tx-primary);
    font-size: 1rem; /* 16px: iOS Safari zooms the page into any smaller field */
    text-overflow: ellipsis;
}

.shop-search button {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.shop-search button:hover {
    background: var(--accent-soft);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* With its label (xl and up) the button is a pill, not a circle */
@media (min-width: 1200px) {
    .shop-search button {
        padding: 0 18px;
    }
}

.shop-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: none;
    color: var(--tx-primary);
    font-size: 1.125rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.shop-icon-btn:hover {
    background: var(--bg-hover);
}

.shop-cart-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--shop-sale);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.shop-cart-badge:empty,
.shop-cart-badge[data-count="0"] {
    display: none;
}

.shop-signin {
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
}

.shop-signin:hover {
    filter: brightness(1.08);
    color: #fff;
}

/* ── Category bar + mega menu ───────────────────────────────── */
.shop-nav {
    position: relative; /* the mega menu spans the whole bar */
    z-index: 1020; /* above the page content, under the sticky header (1030) */
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.shop-nav__list {
    display: flex;
    align-items: stretch;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.shop-nav__list::-webkit-scrollbar {
    display: none;
}

.shop-nav__link {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    white-space: nowrap;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--tx-secondary);
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* Hover states belong to the desktop bar; on touch the links are chips (see the mobile block) */
@media (min-width: 992px) {
    .shop-nav__item:hover > .shop-nav__link,
    .shop-nav__item:focus-within > .shop-nav__link {
        color: var(--accent);
        background: var(--bg-hover);
        border-bottom-color: var(--accent);
    }
}

.shop-nav__drawer-btn {
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.shop-nav__link.active {
    color: var(--accent);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

.shop-nav__chevron {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.shop-nav__item:hover .shop-nav__chevron,
.shop-nav__item:focus-within .shop-nav__chevron {
    transform: rotate(180deg);
}

/* Mega menu: opens after a short pause and closes after one, so sweeping the
   mouse over the bar does not flash every menu and a diagonal move into the
   panel does not close it. */
.shop-mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 2px solid var(--accent);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease 0.15s, transform 0.15s ease 0.15s, visibility 0s linear 0.3s;
}

/* Keeps the hover alive across the small gap while the panel slides in */
.shop-mega::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 10px;
}

.shop-nav__item:hover > .shop-mega,
.shop-nav__item:focus-within > .shop-mega {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.15s ease 0.12s, transform 0.15s ease 0.12s, visibility 0s linear 0.12s;
}

.shop-mega__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 16px 24px;
}

.shop-mega__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.shop-mega__root {
    font-size: 1.05rem;
    font-weight: 700;
}

.shop-mega__head a,
.shop-mega__more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.875rem;
}

.shop-mega__head a i {
    margin-left: 4px;
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.shop-mega__head a:hover i {
    transform: translateX(3px);
}

.shop-mega__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px 28px;
}

.shop-mega__title {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.shop-mega__title:hover,
.shop-mega__sub a:hover,
.shop-mega__head a:hover,
.shop-mega__more:hover {
    color: var(--accent);
    text-decoration: underline;
}

.shop-mega__sub {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.shop-mega__sub a {
    color: var(--tx-secondary);
    font-size: 0.9rem;
}

/* Dims the page while a menu is open; browsers without :has() simply skip it */
.shop-main::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1010;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease 0.15s, visibility 0s linear 0.3s;
}

body:has(.shop-nav__item:hover > .shop-mega) .shop-main::after {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.15s ease 0.12s, visibility 0s linear 0.12s;
}

@media (max-width: 991.98px) {
    .shop-mega {
        display: none !important;
    }

    /* Category chips: a sideways-scrolling row, faded at the right edge to show there is more */
    .shop-nav__list {
        gap: 8px;
        padding: 8px 0;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }

    .shop-nav__link {
        height: 34px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--bg-hover);
        font-size: 0.875rem;
    }

    .shop-nav__link.active {
        color: var(--accent);
        background: var(--bg-active);
        border-color: var(--accent);
    }

    .shop-nav__drawer-btn {
        color: #fff;
        background: var(--accent);
        border-color: var(--accent);
    }

    .shop-nav__chevron {
        display: none;
    }

    .shop-main::after {
        display: none;
    }
}

/* Tablets: logo and actions on the first row, the search full width below them */
@media (min-width: 768px) and (max-width: 991.98px) {
    .shop-header__bar {
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px; /* only vertical: the shorthand would wipe the container's 16px side gutters */
    }

    .shop-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .shop-header__actions {
        margin-left: auto;
    }
}

/* Phones: logo, search and actions share one row; typing hands the whole bar to the search
   (!important beats the .d-flex on the actions; browsers without :has() just keep the small pill) */
@media (max-width: 767.98px) {
    .shop-header__bar {
        gap: 8px;
    }

    .shop-header__bar:has(.shop-search:focus-within) > :not(.shop-search) {
        display: none !important;
    }
}

/* ── Section heads ──────────────────────────────────────────── */
.shop-section {
    margin-bottom: 36px;
}

.shop-section__title {
    font-size: 1.375rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 6px;
}

.shop-section__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 44px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.shop-section__more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
}

/* ── Product rails and grids ────────────────────────────────── */
.shop-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(176px, 214px);
    gap: var(--shop-gap);
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.shop-rail > * {
    scroll-snap-align: start;
}

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

/* Phones: two columns with a tighter gutter */
@media (max-width: 575.98px) {
    .shop-grid {
        gap: 12px;
    }
}

/* Tablets and up: as many columns as fit at 170px or more, so a card never grows past ~225px */
@media (min-width: 576px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

/* ── Product card ───────────────────────────────────────────── */
.product-card {
    --card-inset: 8px; /* how far the badges and the bestseller chip sit from the photo edge */
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

/* Only where there is a real pointer: on touch screens a hover state sticks after the tap */
@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-4px);
        border-color: var(--accent);
        box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.28);
    }

    .product-card:hover .product-card__media img {
        transform: scale(1.06);
    }
}

/* Portrait 3:4 photo, inset in the card with its own rounded corners */
.product-card__media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    margin: 6px 6px 0;
    border-radius: 10px;
    background: var(--bg-hover);
    overflow: hidden;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.product-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: var(--tx-muted);
}

.product-card__badges {
    position: absolute;
    top: var(--card-inset);
    left: var(--card-inset);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    max-width: calc(100% - 2 * var(--card-inset));
    pointer-events: none;
}

.shop-badge {
    padding: 3px 9px;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #fff;
    background: var(--shop-sale);
}

/* On the card every badge (discount, deal, bestseller, out of stock) is the same pill */
.product-card .shop-badge {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: normal;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.shop-badge--deal {
    background: var(--shop-ok);
}

/* Bestseller: a frosted pill on the bottom-left of the photo, clear of the badges */
.shop-badge--hot {
    color: var(--shop-warn);
    background: rgba(255, 255, 255, 0.92);
}

.product-card__hot {
    position: absolute;
    bottom: var(--card-inset);
    left: var(--card-inset);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

/* Out of stock: a faded grey photo and a dark pill, so the product stays recognisable */
.product-card:has(.product-card__sold-out) .product-card__media img {
    filter: grayscale(1);
    opacity: 0.55;
}

.product-card__sold-out {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.product-card .product-card__sold-out .shop-badge { /* outranks the phone badge size below */
    padding: 5px 12px;
    font-size: 0.8125rem;
    background: rgba(17, 24, 39, 0.78);
}

.product-card__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px 12px;
    flex: 1;
}

/* Up to two lines; a short name leaves no empty line, the button keeps to the bottom of the card */
.product-card__name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__name:hover {
    color: var(--accent);
}

/* Rating and sold count on one line: one star, the average, the count, then "· 120 sold" */
.product-card__meta {
    --meta-gap: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px var(--meta-gap);
    font-size: 0.75rem;
    color: var(--tx-secondary);
}

/* Card rating: one star, the average and the count, so it fits the narrowest card */
.product-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.product-card__rating i {
    font-size: 0.7rem;
    color: var(--shop-star);
}

.product-card__rating-value {
    font-weight: 700;
    color: var(--tx-primary);
}

.product-card__rating + .product-card__sold::before {
    content: "·";
    margin-right: var(--meta-gap);
    color: var(--tx-muted);
}

.shop-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--tx-secondary);
}

.shop-rating__stars {
    position: relative;
    display: inline-block;
    color: var(--tx-muted);
    letter-spacing: 1px;
    line-height: 1;
}

.shop-rating__stars::before {
    content: "★★★★★";
}

.shop-rating__fill {
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: var(--shop-star);
    white-space: nowrap;
}

.shop-rating__fill::before {
    content: "★★★★★";
}

.shop-price__now {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--shop-price);
}

.shop-price__was {
    font-size: 0.85rem;
    color: var(--tx-muted);
    text-decoration: line-through;
}

.shop-price__from {
    font-size: 0.75rem;
    color: var(--tx-secondary);
}

.product-card__price {
    margin-top: 2px;
}

.product-card__price .shop-price__now {
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

.product-card__price .shop-price__was {
    font-size: 0.8rem;
}

/* Low stock: the warning and a thin Bootstrap progress bar of what is left */
.product-card__stock {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--shop-warn);
}

.product-card__stock .progress {
    --bs-progress-height: 4px;
    --bs-progress-bg: var(--bg-hover);
    --bs-progress-bar-bg: var(--shop-warn);
}

.product-card__action {
    margin-top: auto;
    padding-top: 8px;
}

.product-card__action .btn {
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

/* One soft button on every card, so a full grid reads calm; it fills when pointed at */
.product-card__btn {
    background: var(--bg-active);
    color: var(--accent-soft);
    font-weight: 600;
    transition: background-color 0.18s ease, color 0.18s ease;
}

@media (hover: hover) {
    .product-card__btn:hover {
        background: var(--accent);
        color: #fff;
    }
}

/* Phones: two cards side by side, so everything is a notch smaller */
@media (max-width: 575.98px) {
    .product-card {
        --card-inset: 6px;
        border-radius: 12px;
    }

    .product-card__media {
        margin: 5px 5px 0;
        border-radius: 9px;
    }

    .product-card__badges {
        gap: 4px;
    }

    .product-card .shop-badge {
        padding: 2px 7px;
        font-size: 0.6875rem;
    }

    .product-card__body {
        gap: 4px;
        padding: 8px 9px 10px;
    }

    .product-card__name {
        font-size: 0.8125rem;
    }

    .product-card__meta {
        --meta-gap: 6px;
        font-size: 0.6875rem;
    }

    .product-card__price .shop-price__now {
        font-size: 1rem;
    }

    .product-card__price .shop-price__was {
        font-size: 0.75rem;
    }

    .product-card__action .btn {
        min-height: 34px;
        padding: 5px 8px;
        font-size: 0.8125rem;
        gap: 5px;
    }
}

/* ── Listing ────────────────────────────────────────────────── */
.shop-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--tx-secondary);
    margin-bottom: 10px;
}

/* Phones: it still wraps (the last crumb names the page there), only smaller and tighter */
@media (max-width: 767.98px) {
    .shop-breadcrumb {
        gap: 2px 6px;
        font-size: 0.8125rem;
    }
}

.shop-breadcrumb a:hover {
    color: var(--accent);
}

.shop-breadcrumb i {
    font-size: 0.6rem;
    color: var(--tx-muted);
}

.shop-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-base);
    color: var(--tx-primary);
    font-size: 0.9375rem;
}

.shop-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.shop-input.is-invalid {
    border-color: var(--shop-sale);
}

/* A select must read as a dropdown, like the admin form-select: its own caret, since
   appearance: none drops the native one. One slate caret works on both themes. */
select.shop-input {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 6.5 4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    cursor: pointer;
}

/* Light: a ready field is white like the admin form controls — on a white card the base
   grey read as greyed out, so an open select felt disabled */
[data-theme="light"] .shop-input:not(:disabled) {
    background-color: var(--bg-surface);
}

/* Waiting on the field above it (district before a division, upazila before a district):
   plainly out of reach, and plainly different from a field that is ready */
.shop-input:disabled {
    background-color: var(--bg-hover);
    color: var(--tx-muted);
    cursor: not-allowed;
}

.shop-empty {
    text-align: center;
    padding: 56px 16px;
    border: 1px dashed var(--border);
    border-radius: var(--shop-radius);
    color: var(--tx-secondary);
}

.shop-empty i {
    font-size: 2.4rem;
    color: var(--tx-muted);
    margin-bottom: 12px;
}

.shop-empty h2 {
    font-size: 1.2rem;
    color: var(--tx-primary);
    margin-bottom: 6px;
}

.cart-panel {
    padding: 6px 20px;
}

.cart-panel--summary {
    padding: 20px;
}

@media (min-width: 992px) {
    .cart-panel--summary {
        position: sticky;
        top: 84px;
    }
}

/* Quantity − / + : product page and cart lines (cart page, mini cart) */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-base);
    overflow: hidden;
}

.qty-stepper button,
.qty-stepper input {
    height: 38px;
    border: 0;
    background: none;
    color: var(--tx-primary);
}

.qty-stepper button {
    width: 36px;
    font-size: 1rem;
    cursor: pointer;
}

.qty-stepper button:hover:not(:disabled) {
    background: var(--bg-hover);
}

.qty-stepper button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qty-stepper input {
    width: 46px;
    text-align: center;
    font-weight: 700;
}

.qty-stepper input:focus {
    outline: none;
}

.cart-line {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.cart-line:last-child {
    border-bottom: 0;
}

.cart-line__image {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tx-muted);
    font-size: 1.6rem;
}

.cart-line__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-line__name {
    font-weight: 700;
    line-height: 1.3;
}

.cart-line__name:hover {
    color: var(--accent);
}

.cart-line__variant {
    color: var(--tx-secondary);
    font-size: 0.8125rem;
    margin-top: 2px;
}

.cart-line__promo {
    margin-top: 2px;
    font-size: 0.8rem;
    color: var(--shop-ok);
}

.cart-line__promo i {
    font-size: 0.7rem;
}

.cart-line__links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 0.8125rem;
}

.cart-line__links button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
}

.cart-line__links button:hover {
    text-decoration: underline;
}

.cart-line__links .danger {
    color: var(--shop-sale);
}

.cart-line__right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.cart-line__total {
    font-weight: 800;
    font-size: 1.05rem;
}

.cart-line__warn {
    margin-top: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--shop-warn);
}

.cart-line__warn.out {
    color: var(--shop-sale);
}

.cart-line.is-unavailable .cart-line__image,
.cart-line.is-unavailable .cart-line__name {
    opacity: 0.55;
}

@media (max-width: 575.98px) {
    .cart-line {
        grid-template-columns: 68px minmax(0, 1fr);
    }

    .cart-line__image {
        width: 68px;
        height: 68px;
    }

    .cart-line__right {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    color: var(--tx-secondary);
}

.summary-row--total {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 14px;
    color: var(--tx-primary);
    font-size: 1.2rem;
    font-weight: 800;
}

.summary-row .save {
    color: var(--shop-ok);
}

.cart-skeleton {
    height: 96px;
    margin: 18px 0;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-surface) 37%, var(--bg-hover) 63%);
    background-size: 400% 100%;
    animation: shop-shimmer 1.4s ease infinite;
}

@keyframes shop-shimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

/* mini cart (offcanvas) */
.mini-cart .offcanvas-body {
    padding: 0 18px;
}

.mini-cart .cart-line {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 14px 0;
}

.mini-cart .cart-line__image {
    width: 64px;
    height: 64px;
}

.mini-cart .cart-line__right {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.mini-cart__footer {
    padding: 16px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
    max-height: 50%;
    overflow-y: auto;
}

/* ── Toast ──────────────────────────────────────────────────── */
.shop-toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    display: grid;
    gap: 8px;
}

.shop-toast {
    padding: 12px 16px;
    min-width: 220px;
    max-width: 340px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--shop-ok);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    font-size: 0.9rem;
}

.shop-toast.error {
    border-left-color: var(--shop-sale);
}

.shop-modal .modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--tx-primary);
}

.shop-modal .modal-header,
.shop-modal .modal-footer {
    border-color: var(--border);
}

/* ── Delivery: say what is charged and why (the product page has its own box in shop-product.css) ── */
.delivery-note {
    margin: 4px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-base);
    border: 1px dashed var(--border);
    font-size: 0.8125rem;
    color: var(--tx-secondary);
}

.delivery-note ul {
    list-style: none;
    margin: 6px 0 0;
    display: grid;
    gap: 3px;
}

.delivery-note__own {
    margin-top: 6px;
    color: var(--shop-warn);
}

.cart-line__delivery {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--shop-warn);
}

.delivery-breakdown {
    margin: 8px 0;
    padding: 8px 0;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
}

.delivery-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.875rem;
}

.delivery-hint {
    margin: 8px 0;
    font-size: 0.8125rem;
    color: var(--tx-secondary);
}

/* ── Category drawer (phones and tablets) ───────────────────── */
.cat-drawer {
    --bs-offcanvas-width: min(320px, 86vw);
    background: var(--bg-surface);
    color: var(--tx-primary);
}

.cat-drawer .offcanvas-header {
    border-bottom: 1px solid var(--border);
}

.cat-drawer__body {
    padding: 0;
}

.cat-drawer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    color: var(--tx-primary);
    font-weight: 500;
    list-style: none;
    cursor: pointer;
}

.cat-drawer__row::-webkit-details-marker {
    display: none;
}

.cat-drawer__row:hover {
    background: var(--bg-hover);
}

.cat-drawer__row.active {
    color: var(--accent);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--accent);
}

.cat-drawer__group[open] > .cat-drawer__row {
    color: var(--accent);
}

.cat-drawer__chevron {
    font-size: 0.7rem;
    color: var(--tx-muted);
    transition: transform 0.2s ease;
}

.cat-drawer__group[open] > .cat-drawer__row .cat-drawer__chevron {
    transform: rotate(180deg);
}

.cat-drawer__children {
    background: var(--bg-base);
}

.cat-drawer__children .cat-drawer__row {
    padding-left: 34px;
    font-size: 0.9375rem;
}

.cat-drawer__children .cat-drawer__children .cat-drawer__row {
    padding-left: 48px;
    font-size: 0.875rem;
}

.cat-drawer__all {
    color: var(--accent);
    font-weight: 600;
}

/* ── Bottom navigation (phones; never for an admin) ─────────── */
.shop-bnav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030; /* like the header: the drawers (1045) and modals (1055) open over it */
    display: flex;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.shop-bnav__item {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 2px 7px;
    border: 0;
    background: none;
    color: var(--tx-secondary);
    font-size: 0.6875rem;
    line-height: 1.2;
    white-space: nowrap;
}

.shop-bnav__item i {
    font-size: 1.15rem;
}

.shop-bnav__item.active {
    color: var(--accent);
    font-weight: 600;
}

.shop-bnav .shop-cart-badge {
    top: 2px;
    right: calc(50% - 26px);
}

@media (max-width: 767.98px) {
    /* The bar is about 51px tall: keep the end of the page and the toasts clear of it */
    .has-bnav {
        padding-bottom: 56px;
    }

    .has-bnav .shop-toasts {
        bottom: 68px;
    }
}

/* Account menu of the bottom bar: opens upwards, in the theme colours */
.shop-bnav__drop {
    flex: 1;
    min-width: 0;
    display: flex;
}

.shop-bnav__menu {
    --bs-dropdown-bg: var(--bg-surface);
    --bs-dropdown-color: var(--tx-primary);
    --bs-dropdown-border-color: var(--border);
    --bs-dropdown-border-radius: 14px;
    --bs-dropdown-link-color: var(--tx-primary);
    --bs-dropdown-link-hover-color: var(--tx-primary);
    --bs-dropdown-link-hover-bg: var(--bg-hover);
    --bs-dropdown-link-active-bg: var(--bg-active);
    --bs-dropdown-divider-bg: var(--border);
    min-width: 230px;
    margin-bottom: 8px !important;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.22);
}

.shop-bnav__menu .dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.9375rem;
}

.shop-bnav__who {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
}
