/* Accent colour defaults. Replaced at runtime with app_splash.bg_color (api/_brand_accent.php;
   applied by js/rp-config.js and js/brand-theme.js). Inserted by scripts/brand-accent.mjs: keep
   it in every file that uses var(--rp-accent) or var(--rp-o-*). */
:root {
    --rp-accent: #F97D09;
    --rp-accent-rgb: 249, 125, 9;
    --rp-o-62401c: 98, 64, 28;
    --rp-o-b35320: 179, 83, 32;
    --rp-o-e84700: 232, 71, 0;
    --rp-o-ee4900: 238, 73, 0;
    --rp-o-fa5807: 250, 88, 7;
    --rp-o-fcf0e8: 252, 240, 232;
    --rp-o-ff6404: 255, 100, 4;
    --rp-o-ff6508: 255, 101, 8;
    --rp-o-ff7906: 255, 121, 6;
    --rp-o-ff8109: 255, 129, 9;
    --rp-o-ff960d: 255, 150, 13;
    --rp-o-ffab36: 255, 171, 54;
    --rp-o-ffac17: 255, 172, 23;
    --rp-o-ffac37: 255, 172, 55;
    --rp-o-ffb879: 255, 184, 121;
    --rp-o-ffbf49: 255, 191, 73;
    --rp-o-ffc071: 255, 192, 113;
    --rp-o-ffca91: 255, 202, 145;
    --rp-o-ffcd65: 255, 205, 101;
    --rp-o-ffd082: 255, 208, 130;
    --rp-o-ffd77a: 255, 215, 122;
    --rp-o-ffe1b6: 255, 225, 182;
    --rp-o-ffe3b8: 255, 227, 184;
    --rp-o-fff0e4: 255, 240, 228;
    --rp-o-fff4eb: 255, 244, 235;
}
/* Righty orb defaults; js/brand-theme.js turns them with the splash colour (--rp-ry-*). */
:root { --rp-ry-o1: 255, 243, 163; --rp-ry-o2: 255, 200, 196; --rp-ry-o3: 255, 174, 245; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) {
        --cart-thumb-size: clamp(28px, 8vw, 44px);
        --cart-thumb-step: clamp(10px, 3.5vw, 24px);
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--mobile-nav-height) + var(--mobile-bottom-safe) + 4px);
        height: var(--mobile-cart-height, 70px);
        max-height: 70px;
        padding: 0;
        overflow: hidden;
        isolation: isolate;
        border: 1px solid rgb(var(--rp-o-ffac37));
        border-radius: clamp(18px, 3.6vw, 28px);
        background: linear-gradient(175deg, rgb(var(--rp-o-ff960d)) 0%, rgb(var(--rp-o-ff8109)) 30%, rgb(var(--rp-o-ff6404)) 65%, rgb(var(--rp-o-ee4900)) 100%);
        box-shadow: inset 0 0 3px rgb(var(--rp-o-ffd082)), 0 4px 12px rgba(var(--rp-o-b35320), .149);
        color: #fff;
        font-family: Arial, Helvetica, sans-serif;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar)::before,
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar)::after {
        content: "";
        position: absolute;
        z-index: -1;
        pointer-events: none;
        border-radius: 50%;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar)::before {
        width: 89%;
        height: 125%;
        left: -10%;
        top: 0;
        transform: rotate(14deg);
        background: linear-gradient(180deg, rgba(var(--rp-o-ff7906), .149), rgba(var(--rp-o-e84700), .22));
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar)::after {
        width: 88%;
        height: 65%;
        left: -22%;
        bottom: -45%;
        background: rgba(var(--rp-o-ffac17), .149);
        transform: rotate(8deg);
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-attached-inner {
        height: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-left-section {
        min-width: 0;
        height: 100%;
        padding: 6px 12px;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) max-content;
        grid-template-rows: minmax(0, 1fr) 6px 11px;
        gap: 3px 8px;
        align-items: center;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-delivery-badge {
        display: grid;
        place-items: center;
        width: 100%;
        aspect-ratio: 1.3;
        margin-left: 0;
        border-radius: 50%;
        background: linear-gradient(145deg, rgba(var(--rp-o-ffcd65), .349), rgba(var(--rp-o-ffbf49), .22));
        box-shadow: inset 0 1px 1px rgba(var(--rp-o-ffd77a), .251);
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-delivery-badge svg { width: 90%; height: auto; }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        line-height: 1.1;
        white-space: nowrap;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info strong {
        font-size: clamp(14px, 3.5vw, 16px);
        font-weight: 700;
        letter-spacing: -.35px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info .text-light-green {
        font-size: clamp(10px, 2.2vw, 11px);
        color: rgb(var(--rp-o-ffe1b6));
        font-weight: 500;
        letter-spacing: 0;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-total {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        gap: 2px;
        line-height: 1.1;
        white-space: nowrap;
        text-align: right;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-label {
        color: rgb(var(--rp-o-ffe1b6));
        font-size: 9px;
        font-weight: 500;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-total strong {
        color: #fff;
        font-size: clamp(12px, 3.5vw, 16px);
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        letter-spacing: -.2px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-bar {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
        height: 6px;
        border-radius: 20px;
        background: linear-gradient(180deg, rgb(var(--rp-o-ffca91)), rgb(var(--rp-o-ffb879)));
        box-shadow: inset 0 0 1px 1px rgba(var(--rp-o-ffe3b8), .439);
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-fill {
        border-radius: inherit;
        background: linear-gradient(180deg, #04b649, #00a13f);
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-delivery-hint {
        grid-column: 1 / -1;
        font-size: clamp(8px, 1.57vw, 9px);
        line-height: 1.2;
        font-weight: 500;
        white-space: nowrap;
        padding-left: 1px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-delivery-hint-unlocked { display: none; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar)[data-confetti-fired="true"] .cart-delivery-hint-pending { display: none; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar)[data-confetti-fired="true"] .cart-delivery-hint-unlocked { display: block; }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-right-section {
        height: 44px;
        min-width: 0;
        display: grid;
        grid-template-columns: max-content 14px;
        gap: 12px;
        align-items: center;
        padding: 0 10px;
        border-left: 2px solid rgba(var(--rp-o-ffc071), .502);
    }

    /* The cart updater supplies up to five images, with descending z-index.
       Each successive circle tucks beneath the preceding one. */
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art {
        display: flex;
        align-items: center;
        width: max-content;
        height: var(--cart-thumb-size);
        isolation: isolate;
        overflow: visible;
        background: transparent;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img {
        display: block;
        position: relative;
        flex: 0 0 var(--cart-thumb-size);
        width: var(--cart-thumb-size);
        height: var(--cart-thumb-size);
        margin: 0;
        padding: 2px;
        border: 2px solid #00a85a;
        border-radius: 50%;
        background: #fff;
        object-fit: contain;
        box-shadow: 0 1px 2px #005d3830;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img + img {
        margin-left: calc(var(--cart-thumb-step) - var(--cart-thumb-size));
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img:nth-child(1) { z-index: 5; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img:nth-child(2) { z-index: 4; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img:nth-child(3) { z-index: 3; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img:nth-child(4) { z-index: 2; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img:nth-child(5) { z-index: 1; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img:nth-child(n + 6) {
        display: none;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-expand-chevron { width: 100%; height: auto; }


/* Preserve the product footer stacking while matching the cart surface. */
#offcanvasProductView .pv-inner-cart-bar {
    border-radius: clamp(18px, 3.6vw, 28px) !important;
    box-shadow: inset 0 0 3px rgb(var(--rp-o-ffd082)), 0 4px 12px rgba(var(--rp-o-b35320), .149) !important;
}

/* Shared cart design for the mobile navigation and product-view footer.
   cart.js supplies totals, delivery progress and product images. */
@media (max-width: 767px) {
    body:has(.bottom-nav) {
        --mobile-nav-height: clamp(70px, 12.45vw, 96px);
        --mobile-cart-height: 70px;
        --mobile-bottom-safe: env(safe-area-inset-bottom, 0px);
        padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-bottom-safe) + 12px + var(--rp-righty-lift, 0px));
    }

    body:has(> #bottomCartBar:not(.d-none)) {
        padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-bottom-safe) + var(--mobile-cart-height) + 18px + var(--rp-righty-lift, 0px));
    }

    /* The account panel scrolls independently of body. Reserve its own
       clearance for the fixed navigation and the optional cart bar. */
    #offcanvasAccount .app-scroll-body-account {
        --account-footer-clearance: calc(var(--mobile-nav-height, 70px) + var(--mobile-bottom-safe, 0px) + 16px + var(--rp-righty-lift, 0px));
        min-height: 0;
        padding-bottom: var(--account-footer-clearance);
        scroll-padding-bottom: var(--account-footer-clearance);
    }

    /* .rp-cart-bar-on is kept by cart.js with the bar's d-none. Not a :has(): body:has(> #bottomCartBar
       :not(.d-none)) #offcanvasAccount ... (and a :has(~ #bottomCartBar) on the panel just the same)
       restyled every <span> in the document on each re-check (see the body.rp-sheet-open note, main_style.css). */
    #offcanvasAccount.rp-cart-bar-on .app-scroll-body-account {
        --account-footer-clearance: calc(var(--mobile-nav-height, 70px) + var(--mobile-bottom-safe, 0px) + var(--mobile-cart-height, 70px) + 20px + var(--rp-righty-lift, 0px));
    }

    body .bottom-nav.mobile-only {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        box-sizing: border-box;
        height: calc(var(--mobile-nav-height) + var(--mobile-bottom-safe));
        padding: 5px max(9px, env(safe-area-inset-right, 0px)) calc(13px + var(--mobile-bottom-safe)) max(9px, env(safe-area-inset-left, 0px));
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 3px;
        border: 1px solid #fff;
        border-radius: clamp(24px, 4.8vw, 38px) clamp(24px, 4.8vw, 38px) 0 0;
        background: linear-gradient(165deg, #fff 0%, #f9faff 60%, #f0f3fb 100%);
        box-shadow: 0 -3px 14px #505e7721, inset 0 -2px 0 #dce2f0;
        font-family: Arial, Helvetica, sans-serif;
    }

    body .bottom-nav.mobile-only::after {
        content: "";
        position: absolute;
        width: 23.5%;
        height: clamp(4px, .95vw, 7px);
        left: 38.25%;
        bottom: calc(4px + var(--mobile-bottom-safe));
        border-radius: 20px;
        background: #586170;
    }

    body .bottom-nav .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 100%;
        box-sizing: border-box;
        text-decoration: none;
        background: transparent;
        border: 0;
        min-width: 0;
        height: 100%;
        gap: clamp(4px, .9vw, 7px);
        padding: 5px 0 7px;
        overflow: visible;
        border-radius: clamp(20px, 4vw, 32px);
        color: #596170;
        font-size: clamp(10px, 1.85vw, 14px);
        line-height: 1.1;
        font-weight: 700;
        white-space: nowrap;
    }

    body .bottom-nav .bottom-nav-icon {
        width: clamp(25px, 4vw, 31px);
        height: clamp(25px, 4vw, 31px);
        flex-shrink: 0;
    }

    body .bottom-nav .bottom-nav-item.active {
        color: rgb(var(--rp-o-fa5807));
        background: radial-gradient(ellipse at 50% 40%, rgb(var(--rp-o-fff0e4)), rgba(var(--rp-o-fcf0e8), .8) 70%, rgba(var(--rp-o-fff4eb), .502));
    }

    body .bottom-nav .bottom-nav-item.active::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 31%;
        width: 38%;
        height: clamp(3px, .68vw, 5px);
        border-radius: 8px;
        background: rgb(var(--rp-o-ff6508));
    }

    body .bottom-nav .bottom-nav-item.active .nav-home-icon {
        filter: drop-shadow(0 -1px 0 rgb(var(--rp-o-ffab36)));
    }

    /* Righty (righty.html), in the middle slot that was Self Billing's until
       2026-11-04 (Self Billing is now a card in My Account). A pastel orb that
       rises out of the bar, the Righty mark over its name. Compact on purpose:
       this is in the home screen's inlined critical CSS (40 KB budget). */
    body .bottom-nav .rp-nav-righty {
        z-index: 1;
    }
    body .bottom-nav .rp-righty-orb {
        position: absolute;
        left: 50%;
        bottom: 2px;
        width: min(64px, 18vw);
        aspect-ratio: 1;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4%;
        border-radius: 50%;
        background: linear-gradient(90deg, rgb(var(--rp-ry-o1)), rgb(var(--rp-ry-o2)) 50%, rgb(var(--rp-ry-o3)));
        box-shadow: 0 0 0 5px #fff, 0 -3px 10px #0f172a26;
        color: #0b0f19;
        font-weight: 800;
    }
    body .bottom-nav .rp-righty-orb img {
        width: 50%;
        height: auto;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar):focus-visible,
    body .bottom-nav .bottom-nav-item:focus-visible {
        outline: 2px solid rgb(var(--rp-o-62401c));
        outline-offset: -3px;
    }

    body.recipe-page .detail-overlay {
        height: calc(100% - var(--mobile-nav-height) - var(--mobile-bottom-safe));
        height: calc(100dvh - var(--mobile-nav-height) - var(--mobile-bottom-safe));
    }

    body.recipe-page .fab-cart-btn,
    body.recipe-page .ip-cart-toast,
    body.food-page .fp-fab-cart,
    body.food-page .fp-toast {
        bottom: calc(var(--mobile-nav-height) + var(--mobile-bottom-safe) + 10px);
    }
}

/* 360px–720px screens: the nav is 5.5% of the screen height (vh, not dvh,
   so it doesn't resize as the browser toolbar slides in and out): ~43px on
   a 360×780 phone, ~46px at 390×844, ~70px on a 720×1280 tablet.
   Design (Navigation_Bar_UI.png): a floating white pill with a grey rim that
   turns into a green→yellow→orange edge along the bottom, a glossy tile
   in the splash colour behind the active item with a bar under it, navy icons and
   labels, the raised Righty orb in the middle, hairline dividers between the
   inactive items and a navy indicator bar in the middle.
   Every size inside is a fraction of the bar's height (--nav-h), so the
   proportions hold at any screen height. The pill floats 6px above the
   bottom edge; that gap is folded into --mobile-bottom-safe, so the cart
   bar, body padding and the account panel's clearance (which all read
   --mobile-nav-height + --mobile-bottom-safe) still clear it. */
@media (min-width: 360px) and (max-width: 720px) {
    body:has(.bottom-nav) {
        --mobile-nav-height: 5.5vh;
        --mobile-bottom-safe: calc(env(safe-area-inset-bottom, 0px) + 6px);
    }

    /* The Righty orb rises about a quarter bar above the nav: the cart bar and the
       bottom clearances (body, Account panel) add a little more, so it covers none
       of them. The :has() is load-bearing: the base rule's :is(#bottomCartBar,
       #offcanvasProductView .pv-inner-cart-bar) has id+class specificity. */
    body:has(.rp-nav-righty) {
        --rp-righty-lift: calc(var(--mobile-nav-height) * .3);
    }
    /* The cart bar docks on the nav: its inner row (.cart-attached-inner, inside the
       bar's 1px border) sits 6px above the nav's top edge. */
    /* On the bar itself, not body:has(.rp-nav-righty) #bottomCartBar (same reason as above). */
    #bottomCartBar:has(~ .bottom-nav .rp-nav-righty) {
        bottom: calc(var(--mobile-nav-height) + var(--mobile-bottom-safe) + 5px);
    }

    body .bottom-nav.mobile-only {
        --nav-h: var(--mobile-nav-height);
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: var(--mobile-bottom-safe);
        width: auto;
        height: var(--nav-h);
        padding: calc(var(--nav-h) * .06) calc(var(--nav-h) * .12) calc(var(--nav-h) * .13);
        gap: calc(var(--nav-h) * .05);
        border: 1px solid transparent;
        border-bottom-width: max(2px, calc(var(--nav-h) * .045));
        border-radius: calc(var(--nav-h) * .45);
        /* Written compactly (hex alpha, implicit stops): this block is in the
           home screen's inlined critical CSS, which has a 40 KB budget. */
        background:
            linear-gradient(#fff, #fcfcfd) padding-box,
            linear-gradient(#e6e7ea 35%, #e6e7ea00 75%) border-box,
            linear-gradient(90deg, #22c33b, #8fcb1c 30%, #d9cc17, #fb9a1a 72%, #ff5f14) border-box;
        box-shadow: 0 4px 14px #0f172a1f, 0 1px 3px #0f172a0f;
    }

    /* Navy indicator bar, centred on the bottom edge. */
    body .bottom-nav.mobile-only::after {
        width: 21.5%;
        left: 39.25%;
        height: max(3px, calc(var(--nav-h) * .05));
        bottom: calc(var(--nav-h) * .025);
        background: #151b2b;
    }

    body .bottom-nav .bottom-nav-item {
        gap: calc(var(--nav-h) * .05);
        padding: 0;
        border-radius: calc(var(--nav-h) * .24);
        color: #141b2d;
        font-size: clamp(9px, calc(var(--nav-h) * .21), 14px);
        font-weight: 600;
        letter-spacing: -.01em;
    }

    body .bottom-nav .bottom-nav-icon {
        width: calc(var(--nav-h) * .34);
        height: calc(var(--nav-h) * .34);
    }

    /* Hairline dividers between two inactive items. */
    body .bottom-nav .bottom-nav-item:not(.active) + .bottom-nav-item:not(.active)::before {
        content: "";
        position: absolute;
        left: calc(var(--nav-h) * -.025 - .5px);
        top: 24%;
        width: 1px;
        height: 52%;
        background: #d3d6dc;
        pointer-events: none;
    }

    /* Righty: the orb is 1x the bar's height, ringed in white. Its top sits 12px
       below the point where 30% of it would overlap the docked cart bar (user,
       2026-11-05). Placed from the nav item's top edge, which is the nav's 1px
       border + .06 padding below the nav's top. */
    body .bottom-nav .rp-righty-orb {
        --rp-orb-d: var(--nav-h);
        width: var(--rp-orb-d);
        top: calc(5px - var(--nav-h) * .06 - var(--rp-orb-d) * .3);
        bottom: auto;
        box-shadow: 0 0 0 calc(var(--nav-h) * .065) #fff, 0 -2px 8px #0f172a1f;
        font-size: clamp(9px, calc(var(--nav-h) * .2), 14px);
    }

    /* Active item: glossy tile in the splash-screen colour (--rp-accent,
       set at runtime by brand-theme.js from app_splash.bg_color), white icon
       and label. The gloss is white/black overlays on top of the accent, so
       any splash colour gets the same lighter top and deeper bottom. */
    body .bottom-nav .bottom-nav-item.active {
        color: #fff;
        font-weight: 700;
        background:
            linear-gradient(#ffffff4d, #ffffff14 38%, #0000000f),
            var(--rp-accent);
        box-shadow:
            inset 0 1px #ffffff8c,
            inset 0 -2px 4px #0000001a,
            0 2px 8px rgba(var(--rp-accent-rgb), .35);
    }

    /* Accent bar under the active tile, level with the indicator bar. */
    body .bottom-nav .bottom-nav-item.active::after {
        left: 25%;
        width: 50%;
        bottom: calc(var(--nav-h) * -.1);
        height: max(2px, calc(var(--nav-h) * .05));
        border-radius: 99px;
        background: var(--rp-accent);
    }

    /* Drop the base rule's accent-shade edge on the home icon. */
    body .bottom-nav .bottom-nav-item.active .nav-home-icon {
        filter: none;
    }
}

/* Keep the delivery message, total and all five thumbnails aligned on
   narrow phones without increasing the cart bar's height. */
@media (max-width: 389px) {
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) {
        --cart-thumb-size: 24px;
        --cart-thumb-step: 8px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-left-section {
        padding-inline: 8px;
        grid-template-columns: 26px minmax(0, 1fr) max-content;
        column-gap: 6px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info strong { font-size: 12px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info .text-light-green { font-size: 9px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-total strong { font-size: 12px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-right-section { padding-inline: 6px; gap: 6px; }
}

/* 360–389px: the cart bar drops from 70px to 58px. The block above already
   narrows the columns and type for this width but keeps the full height, so
   the bar sat tall over a 360px screen. --mobile-cart-height drives both the
   bar and the body/account-panel clearance above it, so lowering it frees
   12px of page as well. Inside, the padding, the progress bar and its hint
   row, the delivery badge, both text stacks, the thumbnails and the chevron
   are scaled down to fit the 50px of content height without clipping. */
@media (min-width: 360px) and (max-width: 389px) {
    body:has(.bottom-nav) {
        --mobile-cart-height: 58px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) {
        --cart-thumb-size: 21px;
        --cart-thumb-step: 7px;
        height: var(--mobile-cart-height, 58px);
        border-radius: 16px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-left-section {
        padding: 4px 8px 5px;
        grid-template-columns: 22px minmax(0, 1fr) max-content;
        grid-template-rows: minmax(0, 1fr) 5px 10px;
        gap: 2px 6px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info,
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-total {
        gap: 1px;
    }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info strong { font-size: 11px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info .text-light-green { font-size: 8.5px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-label { font-size: 8px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-total strong { font-size: 11px; }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-bar {
        height: 5px;
    }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-delivery-hint {
        font-size: 7.5px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-right-section {
        height: 36px;
        grid-template-columns: max-content 12px;
        gap: 5px;
        padding-inline: 6px;
    }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img {
        padding: 1.5px;
        border-width: 1.5px;
    }
}

/* 390–479px: the cart bar (and .cart-attached-inner, which fills it) drops
   from 70px to 62px — one step above the 360–389px block's 58px, since the
   wider screen has room for slightly larger type. As there,
   --mobile-cart-height also moves the body/account-panel clearance, and the
   contents are scaled to fit the 52px of content height. */
@media (min-width: 390px) and (max-width: 479px) {
    body:has(.bottom-nav) {
        --mobile-cart-height: 62px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) {
        --cart-thumb-size: 26px;
        --cart-thumb-step: 9px;
        height: var(--mobile-cart-height, 62px);
        border-radius: 18px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-left-section {
        padding: 5px 10px;
        grid-template-columns: 30px minmax(0, 1fr) max-content;
        grid-template-rows: minmax(0, 1fr) 5px 10px;
        gap: 2px 7px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info,
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-total {
        gap: 1px;
    }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info strong { font-size: 13px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-info .text-light-green { font-size: 9.5px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-label { font-size: 8.5px; }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-summary-total strong { font-size: 13px; }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-bar {
        height: 5px;
    }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-delivery-hint {
        font-size: 8px;
    }

    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-right-section {
        height: 40px;
        grid-template-columns: max-content 13px;
        gap: 6px;
        padding-inline: 8px;
    }
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-basket-art img {
        padding: 1.5px;
        border-width: 1.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar), :is(#bottomCartBar, #offcanvasProductView .pv-inner-cart-bar) .cart-prog-fill { transition: none; }
}
