/* ============================================================================
   Singaf storefront - "Atelier" design layer

   Loaded AFTER shop.css and BEFORE a seller's own theme block, so it re-themes
   the existing markup by redefining tokens and restyling components, and a
   seller's colours still win. To switch the whole redesign off, remove the one
   <link> to this file in shop/layout.blade.php.

   Rules this layer keeps:
   - Logical properties only (inline/block), so Arabic is the same CSS mirrored.
   - Colours come from tokens (--ink, --surface, --canvas, --line, --brand), never
     literals, so the dark and tinted seller presets keep working.
   - Motion has a purpose: it says where something came from or went. All of it
     stops under prefers-reduced-motion, and none of it hides content when
     scripts fail (anything that starts invisible is gated behind html.js).
   ========================================================================= */

:root {
    --brand: #d58b14;
    --brand-dark: #b3730c;
    --brand-light: #fbf1dc;
    --brand-glow: rgba(213, 139, 20, .28);
    --on-brand: #1c1305;

    --ink: #1c1917;
    --ink-2: #57534e;
    --ink-3: #78716c;

    --line: #e7e1d8;
    --surface: #ffffff;
    --canvas: #faf8f5;

    --sale: #c2321b;
    --ok: #15803d;

    --r-sm: 12px;
    --r: 18px;
    --r-lg: 26px;

    --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 12px 30px -16px rgba(28, 25, 23, .18);
    --shadow-lg: 0 24px 60px -24px rgba(28, 25, 23, .34);

    --header-h: 60px;

    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-io: cubic-bezier(.65, 0, .35, 1);
    --spring: cubic-bezier(.34, 1.45, .64, 1);
    --d-fast: 140ms;
    --d-base: 260ms;
    --d-slow: 520ms;

    --display: "Cormorant", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --dx: 1;
}

html[dir="rtl"] {
    --display: "Noto Kufi Arabic", "Tahoma", system-ui, sans-serif;
    --dx: -1;
}

/* Derived on the element a seller theme paints (body.shop-theme), not on
   :root, so a custom brand colour carries into these as well. */
body {
    --brand-ink: color-mix(in srgb, var(--brand) 68%, #000);
    --sunken: color-mix(in srgb, var(--ink) 5%, var(--canvas));
    --hairline: color-mix(in srgb, var(--ink) 12%, transparent);
    --scrim: color-mix(in srgb, var(--ink) 52%, transparent);
    --tab-h: 0px;
    --bar-h: 0px;
}

html { scroll-padding-block-start: 84px; }

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

::selection { background: var(--brand-glow); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* A stray button that only exists for scripts must not show before they run. */
[hidden] { display: none !important; }

/* ── type ────────────────────────────────────────────────────────────────── */

h1, h2, h3 { text-wrap: balance; }

.toolbar h1,
.sec-hd h2,
.pdp-info h1,
.store-hero h1,
.authcard h1,
.empty h2,
.summary h2,
.panel > h2 {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: -.005em;
}

html[dir="rtl"] .toolbar h1,
html[dir="rtl"] .sec-hd h2,
html[dir="rtl"] .pdp-info h1,
html[dir="rtl"] .store-hero h1,
html[dir="rtl"] .authcard h1,
html[dir="rtl"] .empty h2,
html[dir="rtl"] .summary h2,
html[dir="rtl"] .panel > h2 { font-weight: 700; letter-spacing: 0; }

.toolbar h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.1; }
.sec-hd h2 { font-size: clamp(25px, 4vw, 32px); line-height: 1.1; }
.pdp-info h1 { font-size: clamp(28px, 4.6vw, 40px); line-height: 1.08; margin: 0; }
html[dir="rtl"] .toolbar h1 { font-size: clamp(22px, 4.2vw, 30px); }
html[dir="rtl"] .sec-hd h2 { font-size: clamp(20px, 3.6vw, 26px); }
html[dir="rtl"] .pdp-info h1 { font-size: clamp(22px, 4vw, 30px); line-height: 1.3; }
.summary h2, .panel > h2 { font-size: 21px; }
html[dir="rtl"] .summary h2, html[dir="rtl"] .panel > h2 { font-size: 17px; }

.price { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
    position: relative;
    isolation: isolate;
    height: 52px;
    padding-inline: 26px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .005em;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--d-fast) var(--ease), background-color var(--d-base) var(--ease),
                border-color var(--d-base) var(--ease), color var(--d-base) var(--ease),
                box-shadow var(--d-base) var(--ease), opacity var(--d-base) var(--ease);
}

.btn:active:not(:disabled) { transform: scale(.972); }

.btn-primary {
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .28) inset, 0 10px 22px -12px var(--brand-glow);
}

.btn-ghost {
    background: transparent;
    border-color: color-mix(in srgb, var(--ink) 24%, transparent);
    color: var(--ink);
}

.btn-sm { height: 40px; padding-inline: 16px; font-size: 13.5px; }

.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }

@media (hover: hover) {
    .btn-primary:hover:not(:disabled) {
        background: var(--brand);
        color: var(--on-brand);
        filter: brightness(1.07) saturate(1.05);
        box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 14px 28px -12px var(--brand-glow);
        transform: translateY(-1px);
    }
    .btn-ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--ink); color: var(--surface); }
}

/* Pending: the label steps aside for a spinner and the button cannot be hit
   twice. The width is unchanged, so nothing around it moves. */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }

.btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    inline-size: 20px;
    block-size: 20px;
    border-radius: 50%;
    border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent);
    border-top-color: var(--on-brand);
    animation: sg-spin .7s linear infinite;
}

.btn-ghost.is-loading::after { border-top-color: var(--ink); }

@keyframes sg-spin { to { transform: rotate(360deg); } }

.linkbtn {
    font-weight: 650;
    color: var(--brand-ink);
    text-decoration-color: color-mix(in srgb, var(--brand) 45%, transparent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.linkbtn:hover { color: var(--ink); }

.iconbtn {
    inline-size: 44px;
    block-size: 44px;
    border: 0;
    background: transparent;
    color: var(--ink);
    transition: background-color var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}

.iconbtn:active { transform: scale(.92); }

@media (hover: hover) { .iconbtn:hover { background: var(--sunken); color: var(--ink); border-color: transparent; } }

/* The count on the cart. It pops when the number changes (shop-ui.js). */
.iconbtn .dot {
    inset-block-start: 2px;
    inset-inline-end: 0;
    min-inline-size: 19px;
    block-size: 19px;
    background: var(--brand);
    color: var(--on-brand);
    border: 2px solid var(--canvas);
    font-size: 10.5px;
}

.dot.is-bump { animation: sg-pop .5s var(--spring); }

@keyframes sg-pop { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* ── fields ──────────────────────────────────────────────────────────────── */

.formgrid input, .formgrid select, .formgrid textarea,
.formstack input, .formstack select, .formstack textarea,
.guest-verify input, .guest-verify select,
.promo input, .notebox, .qty, .sortsel {
    min-block-size: 52px;
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
    transition: border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease), background-color var(--d-base) var(--ease);
}

.formgrid textarea, .formstack textarea, .notebox { min-block-size: 84px; }

.formgrid :is(input, select, textarea):focus,
.formstack :is(input, select, textarea):focus,
.guest-verify :is(input, select):focus,
.promo input:focus, .notebox:focus, .qty:focus, .sortsel:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-glow);
    background: var(--surface);
}

.formgrid label > span, .formstack label > span {
    font-size: 13.5px;
    font-weight: 650;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0;
}

/* Errors sit next to the field they are about (shop-ui.js). */
.has-error > input, .has-error > select, .has-error > textarea,
.has-error input, .has-error select, .has-error textarea { border-color: var(--sale) !important; }

.has-error input:focus, .has-error select:focus, .has-error textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--sale) 22%, transparent) !important; }

.field-error {
    display: block;
    margin-block-start: 5px;
    color: var(--sale);
    font-size: 13px;
    font-weight: 600;
    font-style: normal;
    animation: sg-rise .28s var(--ease);
}

@keyframes sg-rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── header ──────────────────────────────────────────────────────────────── */

.hdr {
    view-transition-name: sg-hdr;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-block-end: 1px solid transparent;
    transition: transform var(--d-slow) var(--ease), border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease);
}

.hdr.is-stuck { border-block-end-color: var(--hairline); box-shadow: 0 10px 30px -22px rgba(28, 25, 23, .35); }

.hdr.is-away { transform: translateY(-100%); }

.hdr-in { gap: 18px; }

.brand img { height: 32px; }

.search {
    height: 46px;
    border: 1.5px solid transparent;
    background: var(--sunken);
    padding-inline: 16px;
    transition: border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease), background-color var(--d-base) var(--ease);
}

.search:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }

.search input { font-size: 16px; }

.search-go { border: 0; background: none; padding: 0; color: var(--ink-3); display: grid; place-items: center; }

.hdr-actions { gap: 4px; }

.lang, .curpick select {
    border: 0;
    background: transparent;
    block-size: 40px;
    padding-inline: 12px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    transition: background-color var(--d-base) var(--ease), color var(--d-base) var(--ease);
}

@media (hover: hover) {
    .lang:hover, .curpick select:hover { background: var(--sunken); color: var(--ink); border-color: transparent; }
}

.sellbtn { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }

@media (hover: hover) { .sellbtn:hover { background: var(--ink); color: var(--surface); } }

@media (min-width: 760px) {
    .hdr-search { max-inline-size: 560px; margin-inline: auto; }
}

@media (max-width: 759.98px) {
    .hdr-in { gap: 6px 8px; padding-block: 8px 10px; }
    .hdr-actions { gap: 2px; }
    .brand img { height: 30px; }
}

/* The category strip: quiet text chips, the current one filled. */
.catbar { background: transparent; border-block-end: 0; }

.catbar-in { padding-block: 2px 10px; gap: 4px; }

.catbar a {
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-2);
    transition: background-color var(--d-base) var(--ease), color var(--d-base) var(--ease);
}

@media (hover: hover) { .catbar a:hover { background: var(--sunken); color: var(--ink); } }

.catbar a[aria-current="page"] { background: var(--ink); color: var(--surface); }

/* ── drawer ──────────────────────────────────────────────────────────────── */

.drawer { visibility: hidden; transition: visibility 0s linear var(--d-slow); }
.drawer[hidden] { display: block !important; }
.drawer.is-open { visibility: visible; transition-delay: 0s; }

.drawer-back {
    background: var(--scrim);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity var(--d-slow) var(--ease);
}

.drawer.is-open .drawer-back { opacity: 1; }

.drawer-panel {
    width: min(360px, 88vw);
    border-start-start-radius: var(--r-lg);
    border-end-start-radius: var(--r-lg);
    transform: translateX(calc(var(--dx) * 104%));
    transition: transform var(--d-slow) var(--ease);
    will-change: transform;
}

.drawer.is-open .drawer-panel { transform: none; }

.drawer-hd { font-family: var(--display); font-size: 22px; font-weight: 600; border-block-end: 0; }
html[dir="rtl"] .drawer-hd { font-size: 17px; font-weight: 700; }

.drawer-links { padding: 4px 10px; gap: 2px; }

.drawer-links a {
    min-height: 54px;
    padding-inline: 14px;
    border-radius: var(--r-sm);
    font-size: 16px;
    font-weight: 600;
    justify-content: flex-start;
    gap: 14px;
}

.drawer-links a svg { flex: none; color: var(--ink-3); }

/* The links arrive one after another. */
.drawer-links a, .drawer-sell, .drawer-ft { opacity: 0; transform: translateY(10px); }

.drawer.is-open .drawer-links a,
.drawer.is-open .drawer-sell,
.drawer.is-open .drawer-ft {
    opacity: 1;
    transform: none;
    transition: opacity var(--d-slow) var(--ease), transform var(--d-slow) var(--ease);
    transition-delay: calc(80ms + var(--i, 0) * 55ms);
}

.drawer-sell .sellpill { background: var(--ink); color: var(--surface); box-shadow: none; min-height: 52px; }

.drawer-ft { border-block-start: 1px solid var(--line); }

.drawer-ft select, .drawer-ft .lang { border: 1.5px solid var(--line); background: var(--surface); }

/* ── bottom tab bar (phones, browsing pages only) ───────────────────────── */

.tabbar { display: none; }

@media (max-width: 759.98px) {
    body.has-tabbar { --tab-h: 64px; padding-block-end: calc(var(--tab-h) + env(safe-area-inset-bottom)); }

    .tabbar {
        view-transition-name: sg-tabbar;
        position: fixed;
        inset-inline: 12px;
        inset-block-end: calc(10px + env(safe-area-inset-bottom));
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        block-size: 60px;
        padding: 5px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--surface) 88%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border: 1px solid var(--hairline);
        box-shadow: 0 18px 40px -18px rgba(28, 25, 23, .45);
        transition: transform var(--d-slow) var(--ease), opacity var(--d-base) var(--ease);
    }

    .tabbar.is-away { transform: translateY(calc(100% + 24px)); opacity: 0; }

    .tab-ind {
        view-transition-name: sg-tabind;
        position: absolute;
        inset-block: 5px;
        inset-inline-start: calc(5px + var(--n, 0) * ((100% - 10px) / 4));
        inline-size: calc((100% - 10px) / 4);
        border-radius: 999px;
        background: var(--brand-light);
        transition: inset-inline-start var(--d-slow) var(--spring);
    }

    .tab {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--ink-3);
        font-size: 11px;
        font-weight: 650;
        -webkit-tap-highlight-color: transparent;
        transition: color var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
    }

    .tab:active { transform: scale(.93); }
    .tab[aria-current="page"] { color: var(--brand-ink); }
    .tab svg { flex: none; }

    .tab .dot {
        position: absolute;
        inset-block-start: 5px;
        inset-inline-start: calc(50% + 6px);
        min-inline-size: 18px;
        block-size: 18px;
        padding-inline: 4px;
        border-radius: 999px;
        background: var(--brand);
        color: var(--on-brand);
        font-size: 10.5px;
        font-weight: 700;
        display: grid;
        place-items: center;
        border: 2px solid var(--surface);
    }

    /* The toasts clear the bar. */
    body.has-tabbar { --bar-h: calc(var(--tab-h) + 16px); }
}

/* ── toasts ──────────────────────────────────────────────────────────────── */

.toasts {
    position: fixed;
    inset-inline: 0;
    inset-block-end: calc(var(--bar-h) + 18px + env(safe-area-inset-bottom));
    z-index: 120;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding-inline: 16px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    max-inline-size: min(460px, 100%);
    padding: 12px 14px 12px 16px;
    padding-inline: 16px 10px;
    border-radius: 16px;
    background: var(--ink);
    color: var(--surface);
    font-size: 14.5px;
    font-weight: 550;
    line-height: 1.4;
    box-shadow: var(--shadow-lg);
    animation: sg-toast-in .46s var(--ease) both;
}

.toast.is-out { animation: sg-toast-out .3s var(--ease-io) both; }

.toast-ico { flex: none; display: grid; place-items: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: var(--ok); color: #fff; }
.toast.is-err .toast-ico { background: var(--sale); }
.toast-msg { flex: 1; min-inline-size: 0; overflow-wrap: anywhere; }

.toast-x {
    flex: none;
    inline-size: 32px;
    block-size: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: .7;
    cursor: pointer;
}

.toast-x:hover { opacity: 1; background: rgba(255, 255, 255, .12); }

@keyframes sg-toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sg-toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* With scripts the inline flash is turned into a toast; without them it stays
   as a plain banner, restyled to match. */
.flash {
    margin-block: 14px 0;
    padding: 14px 16px;
    border-radius: var(--r-sm);
    border-width: 1.5px;
    font-weight: 600;
}

/* ── dialogs and sheets ──────────────────────────────────────────────────── */

html:has(dialog[open]) { overflow: hidden; }

dialog.ask {
    position: fixed;
    inset: auto 0 0 0;
    margin: 0;
    inline-size: 100%;
    max-inline-size: none;
    max-block-size: min(88dvh, 760px);
    padding: 0;
    border: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    translate: 0 100%;
    transition: opacity var(--d-base) var(--ease), translate var(--d-slow) var(--ease),
                overlay var(--d-slow) allow-discrete, display var(--d-slow) allow-discrete;
}

dialog.ask[open] { opacity: 1; translate: 0 0; }

@starting-style { dialog.ask[open] { opacity: 0; translate: 0 100%; } }

dialog.ask::backdrop {
    background: var(--scrim);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity var(--d-slow) var(--ease), overlay var(--d-slow) allow-discrete, display var(--d-slow) allow-discrete;
}

dialog.ask[open]::backdrop { opacity: 1; }

@starting-style { dialog.ask[open]::backdrop { opacity: 0; } }

/* The grab handle, so it reads as a sheet that can be dismissed. */
dialog.ask::before {
    content: "";
    flex: none;
    align-self: center;
    inline-size: 40px;
    block-size: 4px;
    margin-block: 10px 0;
    border-radius: 4px;
    background: var(--hairline);
}

@media (min-width: 640px) {
    dialog.ask {
        inset: 0;
        margin: auto;
        inline-size: min(92vw, 460px);
        max-block-size: min(86dvh, 820px);
        border-radius: var(--r-lg);
        translate: 0 18px;
        scale: .97;
        transition: opacity var(--d-base) var(--ease), translate var(--d-slow) var(--ease), scale var(--d-slow) var(--ease),
                    overlay var(--d-slow) allow-discrete, display var(--d-slow) allow-discrete;
    }

    dialog.ask[open] { translate: 0 0; scale: 1; }

    @starting-style { dialog.ask[open] { opacity: 0; translate: 0 18px; scale: .97; } }

    dialog.ask::before { display: none; }

    dialog.ask.ask-wide { inline-size: min(94vw, 600px); }
}

.ask-form {
    display: grid;
    gap: 14px;
    padding: 18px 22px calc(22px + env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
    min-block-size: 0;
}

.ask-form h3 {
    margin: 0;
    padding-inline-end: 44px;
    font-family: var(--display);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.15;
}

html[dir="rtl"] .ask-form h3 { font-size: 19px; font-weight: 700; }

.ask-form p { margin: 0; color: var(--ink-2); }

.ask-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-block-start: 4px; }
.ask-actions .btn { inline-size: 100%; }

@media (min-width: 640px) {
    .ask-actions { flex-direction: row; justify-content: flex-end; }
    .ask-actions .btn { inline-size: auto; min-inline-size: 132px; }
}

.ask-x {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-end: 12px;
    z-index: 2;
    inline-size: 40px;
    block-size: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--sunken);
    color: var(--ink);
    cursor: pointer;
    transition: background-color var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}

.ask-x:hover { background: var(--line); }
.ask-x:active { transform: scale(.92); }

.ask-error { color: var(--sale); font-weight: 600; font-size: 13.5px; }

/* A confirmation: an icon names the kind of question, the safe answer sits
   first, the risky one is the only red thing on screen. */
.ask-confirm .ask-form { text-align: center; justify-items: center; padding-block-start: 14px; }
.ask-confirm .ask-form h3 { padding-inline-end: 0; font-size: 23px; }
html[dir="rtl"] .ask-confirm .ask-form h3 { font-size: 18px; }

.ask-badge {
    display: grid;
    place-items: center;
    inline-size: 56px;
    block-size: 56px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-ink);
}

.ask-confirm.is-danger .ask-badge { background: color-mix(in srgb, var(--sale) 12%, var(--surface)); color: var(--sale); }

.btn-danger { background: var(--sale); color: #fff; border-color: transparent; }

@media (hover: hover) { .btn-danger:hover:not(:disabled) { background: var(--sale); filter: brightness(1.08); } }

.ask-confirm .ask-actions { inline-size: 100%; }

@media (min-width: 640px) { .ask-confirm .ask-actions { justify-content: center; } }

/* ============================================================================
   Browsing: home, listings, product tiles
   ========================================================================= */

main.wrap { padding-block-end: 8px; }

.sec { margin-block: 44px; }

.sec-hd { align-items: end; margin-block-end: 18px; }

.sec-hd .more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
    font-size: 14px;
    color: var(--ink);
    padding-block: 6px;
    border-block-end: 1.5px solid var(--brand);
    transition: gap var(--d-base) var(--ease), color var(--d-base) var(--ease);
}

.sec-hd .more::after { content: "\2192"; font-size: 15px; transition: transform var(--d-base) var(--ease); }
html[dir="rtl"] .sec-hd .more::after { content: "\2190"; }

@media (hover: hover) { .sec-hd .more:hover::after { transform: translateX(calc(var(--dx) * 4px)); } }

/* Hero: rounded, calm, with a dot for each slide (shop-ui.js). */
.hero {
    gap: 14px;
    margin-block: 14px 8px;
    padding-block-end: 0;
}

.hero figure {
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    background: var(--sunken);
}

.hero img { transition: transform 1.2s var(--ease); }

.hero-dots { display: flex; justify-content: center; gap: 6px; margin-block: 10px 0; }

.hero-dots button {
    inline-size: 7px;
    block-size: 7px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--hairline);
    cursor: pointer;
    transition: inline-size var(--d-slow) var(--ease), background-color var(--d-base) var(--ease);
}

.hero-dots button[aria-current="true"] { inline-size: 24px; background: var(--ink); }

/* Product tiles: the picture is the card. No box around the words. */
.card {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    gap: 0;
    box-shadow: none;
    transform: none;
    -webkit-tap-highlight-color: transparent;
}

.card:hover { box-shadow: none; transform: none; border-color: transparent; }

.card-img {
    border-radius: var(--r);
    background: var(--sunken);
    isolation: isolate;
}

/* A soft shimmer holds the place of a picture that is still arriving. */
.js .card-img:not(.is-loaded)::before,
.js .line-img:not(.is-loaded)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--surface) 55%, transparent) 50%, transparent 80%);
    background-size: 220% 100%;
    animation: sg-shimmer 1.4s linear infinite;
}

@keyframes sg-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.card-img img { transition: transform .8s var(--ease); }

@media (hover: hover) { .card:hover .card-img img { transform: scale(1.045); } }

.card:active .card-img { transform: scale(.985); }
.card-img { transition: transform var(--d-fast) var(--ease); }

.card-body { padding: 12px 2px 0; gap: 4px; }

.card-store { font-size: 11px; letter-spacing: .09em; color: var(--ink-3); }

.card-name { font-size: 14.5px; font-weight: 550; line-height: 1.4; }

.card-price { padding-block-start: 4px; gap: 8px; }

.card-price .price { font-size: 15px; font-weight: 700; }

.badge {
    inset-block-start: 10px;
    inset-inline-start: 10px;
    padding: 4px 10px;
    background: var(--ink);
    color: var(--surface);
    font-size: 11.5px;
    letter-spacing: .02em;
    z-index: 2;
}

.badge.soldout { background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--ink); inset-inline-end: 10px; backdrop-filter: blur(6px); }

.card:has(.badge.soldout) .card-img img { opacity: .55; filter: grayscale(.5); }

/* Rails: a wider peek of the next tile says there is more to swipe to. */
.rail { grid-auto-columns: 54%; gap: 14px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding-block-end: 4px; }
.rail > * { scroll-snap-align: start; }

@media (min-width: 620px) { .grid, .rail { gap: 28px 18px; } }
@media (max-width: 619.98px) { .grid { gap: 22px 12px; } }

/* Stores: a row of round logos on a phone, a grid on a desk. */
.stores {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 104px;
    grid-template-columns: none;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-inline: -16px;
    padding-inline: 16px;
    padding-block-end: 4px;
}

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

.store-card {
    background: transparent;
    border: 0;
    padding: 0;
    scroll-snap-align: start;
    transition: transform var(--d-base) var(--ease);
}

.store-card:active { transform: scale(.96); }

.store-card .logo {
    inline-size: 84px;
    block-size: 84px;
    margin-block-end: 10px;
    background: var(--sunken);
    box-shadow: 0 0 0 2px var(--canvas), 0 0 0 3.5px color-mix(in srgb, var(--brand) 60%, transparent);
    font-family: var(--display);
    font-size: 30px;
    transition: box-shadow var(--d-base) var(--ease), transform var(--d-base) var(--ease);
}

@media (hover: hover) { .store-card:hover .logo { transform: scale(1.05); box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--brand); } .store-card:hover { box-shadow: none; } }

.store-card b { font-size: 13px; font-weight: 600; }

@media (min-width: 900px) {
    .stores { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-auto-columns: auto; overflow: visible; margin-inline: 0; padding-inline: 0; }
}

/* Listing toolbar and the store header. */
.toolbar { margin-block: 26px 20px; align-items: end; }
.toolbar .count { font-size: 14px; color: var(--ink-3); }

.sortsel {
    min-block-size: 44px;
    padding: 8px 40px 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 14px center;
}

html[dir="rtl"] .sortsel { padding: 8px 16px 8px 40px; background-position: left 14px center; }

.store-hero { border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); padding: 20px; gap: 18px; }
.store-hero .logo { inline-size: 76px; block-size: 76px; background: var(--sunken); font-family: var(--display); }
.store-banner { border-radius: var(--r-lg); overflow: hidden; margin-block-start: 14px; }

.empty { padding: 72px 20px; }

.empty svg {
    inline-size: 84px;
    block-size: 84px;
    padding: 22px;
    border-radius: 50%;
    background: var(--sunken);
    color: var(--ink-3);
    margin-block-end: 18px;
}

.empty h2 { font-size: 26px; }
html[dir="rtl"] .empty h2 { font-size: 20px; }

.pager { margin-block: 36px 8px; }

/* The app banner and footer. */
.appbar {
    border: 0;
    border-radius: var(--r-lg);
    background: var(--ink);
    color: var(--surface);
    box-shadow: var(--shadow-lg);
}

.appbar h2, .appbar p { color: inherit; }
.appbar p { opacity: .72; }

.appbar .links a {
    border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--surface) 38%, transparent);
    background: transparent;
    color: var(--surface);
    transition: background-color var(--d-base) var(--ease), color var(--d-base) var(--ease);
}

@media (hover: hover) { .appbar .links a:hover { background: var(--surface); color: var(--ink); } }

.ftr { background: var(--ink); color: color-mix(in srgb, var(--surface) 66%, transparent); border: 0; margin-block-start: 56px; padding-block: 34px; }
.ftr nav a { color: color-mix(in srgb, var(--surface) 84%, transparent); font-weight: 500; }
@media (hover: hover) { .ftr nav a:hover { color: var(--brand); } }

/* ============================================================================
   Product page
   ========================================================================= */

.pdp { margin-block: 8px 28px; gap: 26px; }

.pdp-media {
    border: 0;
    border-radius: var(--r-lg);
    background: var(--sunken);
    box-shadow: var(--shadow);
}

.pdp-slide > img { cursor: zoom-in; transition: opacity .5s var(--ease); }

.pdp-count {
    inset-block-end: 14px;
    inset-inline-end: 14px;
    background: color-mix(in srgb, var(--ink) 72%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 5px 11px;
    font-size: 12.5px;
    letter-spacing: .02em;
}

.pdp-arrow { background: color-mix(in srgb, var(--surface) 92%, transparent); border: 0; box-shadow: var(--shadow); transition: transform var(--d-fast) var(--ease), background-color var(--d-base) var(--ease); }
.pdp-arrow:active { transform: translateY(-50%) scale(.92); }
html[dir="rtl"] .pdp-arrow:active { transform: translateY(-50%) scaleX(-1) scale(.92); }

.pdp-thumb { border-radius: 12px; box-shadow: none; opacity: .62; transition: opacity var(--d-base) var(--ease), border-color var(--d-base) var(--ease), transform var(--d-fast) var(--ease); }
.pdp-thumb.is-on { opacity: 1; border-color: var(--ink); box-shadow: none; }
@media (hover: hover) { .pdp-thumb:hover { opacity: 1; border-color: var(--hairline); } .pdp-thumb.is-on:hover { border-color: var(--ink); } }

.favfloat {
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: var(--shadow);
    transition: transform var(--d-fast) var(--ease), color var(--d-base) var(--ease);
}

.favfloat:active { transform: scale(.88); }
.favfloat.on svg { animation: sg-pop .5s var(--spring); }

.pdp .store-line {
    padding: 6px 14px 6px 6px;
    padding-inline: 6px 14px;
    border-radius: 999px;
    background: var(--sunken);
    color: var(--ink);
    font-weight: 650;
    transition: background-color var(--d-base) var(--ease);
}

@media (hover: hover) { .pdp .store-line:hover { background: var(--line); } }

.pdp .store-line .logo { inline-size: 28px; block-size: 28px; background: var(--surface); }

.pdp-price { gap: 12px; align-items: center; }
.pdp-price .price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.pdp-price s { color: var(--ink-3); font-size: 16px; }
.pdp-price .off { background: color-mix(in srgb, var(--sale) 11%, var(--surface)); }

.stock { padding: 4px 12px 4px 10px; padding-inline: 10px 12px; border-radius: 999px; background: color-mix(in srgb, currentColor 9%, transparent); font-size: 13px; }
.stock.in::before { animation: sg-breathe 2.4s ease-in-out infinite; }

@keyframes sg-breathe { 50% { transform: scale(1.5); opacity: .55; } }

/* Options. A chip for a size, a ring for a colour, one question per row. */
.buy { gap: 0; }
.buy > * + * { margin-block-start: 22px; }

.opt legend { font-size: 14px; font-weight: 650; color: var(--ink); text-transform: none; letter-spacing: 0; margin-block-end: 12px; }

.opt-list.is-sizes { gap: 10px; }

.opt-list.is-sizes .size, .opt .size.addon, .size.measure {
    min-inline-size: 52px;
    block-size: 48px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 650;
    transition: background-color var(--d-base) var(--ease), border-color var(--d-base) var(--ease), color var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}

.opt .size.addon, .size.measure { block-size: auto; min-block-size: 48px; padding: 10px 18px; }

.opt-list.is-sizes .size:active, .size.measure:active { transform: scale(.94); }

.opt-list.is-sizes .size:has(input:checked), .size.measure:has(input:checked), .opt .size.addon:has(input:checked) {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--surface);
    box-shadow: none;
}

@media (hover: hover) { .opt-list.is-sizes .size:hover { border-color: var(--ink); } }

.size.addon i { font-style: normal; font-weight: 500; opacity: .75; margin-inline-start: 6px; }
/* The ticked pill is dark: its price takes the pill's own colour. */
.opt .size.addon:has(input:checked) i { color: inherit; }
/* A pick-only-one group: round marks, as radio buttons have. */
.size.addon.addon-one::before { border-radius: 50%; }

.opt-list.is-colours { gap: 12px; }

.opt-list.is-colours .swatch i {
    inline-size: 38px;
    block-size: 38px;
    border-color: var(--hairline);
    box-shadow: 0 0 0 3px var(--canvas);
    transition: box-shadow var(--d-base) var(--ease), transform var(--d-base) var(--spring);
}

.opt-list.is-colours .swatch:active i { transform: scale(.9); }
.opt-list.is-colours .swatch:has(input:checked) i { box-shadow: 0 0 0 3px var(--canvas), 0 0 0 5px var(--ink); transform: scale(1.02); }

.depnote { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; margin-block-end: 10px; }

.measure-block { padding: 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.measure-block legend { float: inline-start; inline-size: 100%; padding: 0; margin-block-end: 12px; }
.measure-block legend + * { clear: both; }

.giftmeasure, .deposit {
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    padding: 14px 16px;
    transition: border-color var(--d-base) var(--ease), background-color var(--d-base) var(--ease);
}

.giftmeasure:has(input:checked), .deposit:has(input:checked) { border-color: var(--ink); background: var(--sunken); }

.deposit input, .giftmeasure input { accent-color: var(--ink); }

/* Quantity: a stepper wraps the number box (shop-ui.js). Without scripts the
   plain number field is left alone. */
.qty-step {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    padding: 3px;
}

.qty-step .qty { border: 0; box-shadow: none !important; min-block-size: 44px; inline-size: 52px; padding: 0; text-align: center; background: transparent; appearance: textfield; -moz-appearance: textfield; font-weight: 650; }
.qty-step .qty::-webkit-outer-spin-button, .qty-step .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.qty-step button {
    inline-size: 44px;
    block-size: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--sunken);
    color: var(--ink);
    font-size: 20px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}

.qty-step button:active:not(:disabled) { transform: scale(.88); background: var(--line); }
.qty-step button:disabled { opacity: .35; cursor: default; }

/* The note is tucked away until wanted: one field fewer on the way to buying. */
.opt-fold { border: 1.5px dashed var(--line); border-radius: var(--r-sm); }
.opt-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; font-weight: 650; font-size: 14.5px; }
.opt-fold > summary::-webkit-details-marker { display: none; }
.opt-fold > summary svg { color: var(--ink-3); transition: transform var(--d-base) var(--ease); }
.opt-fold[open] > summary svg { transform: rotate(45deg); }
.opt-fold[open] { border-style: solid; }
.opt-fold > div { padding: 0 16px 16px; }

/* Details accordion that opens smoothly where the browser can animate it. */
.pdp-acc { border-color: var(--line); }
.pdp-acc > summary { font-size: 15.5px; }

@supports (interpolate-size: allow-keywords) {
    .pdp-acc { interpolate-size: allow-keywords; }
    .pdp-acc::details-content { block-size: 0; overflow: clip; transition: block-size var(--d-slow) var(--ease), content-visibility var(--d-slow) allow-discrete; }
    .pdp-acc[open]::details-content { block-size: auto; }
}

.specs li svg { color: var(--brand-ink); }

/* The buy bar: two actions, one primary. Pinned on phones. */
.buybar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }

.buybar .btn-primary { grid-column: 1 / -1; }
.buybar-add { grid-column: 1 / -1; }
.buybar-add svg { flex: none; }

@media (min-width: 720px) {
    .buy .buybar { grid-template-columns: 1fr 1.4fr; gap: 12px; margin-block-start: 26px; }
    .buybar .buybar-price { display: none; }
    .buybar .buybar-add { grid-column: 1; grid-row: 1; }
    .buybar .btn-primary { grid-column: 2; grid-row: 1; }
}

@media (max-width: 719.98px) {
    .pdp-media-wrap { margin-inline: -16px; }
    .pdp-media { border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: none; block-size: min(62vh, 480px); }
    .pdp-thumbs { display: none; }
    .pdp { gap: 20px; }

    .pdp .buybar {
        grid-template-columns: auto 52px minmax(0, 1fr);
        gap: 10px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border-block-start: 1px solid var(--hairline);
        box-shadow: 0 -14px 36px -22px rgba(28, 25, 23, .4);
        view-transition-name: sg-pinbar;
    }

    .buybar .buybar-price { font-size: 18px; font-weight: 750; letter-spacing: -.01em; }

    .buybar .buybar-add { grid-column: auto; inline-size: 52px; padding: 0; }
    .buybar .buybar-add span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .buybar .btn-primary { grid-column: auto; }

    .pdp { padding-block-end: 96px; }
}

.buybar-note { margin-block-start: 12px; }

/* ============================================================================
   Cart and checkout
   ========================================================================= */

/* The three steps, shown wherever somebody is part-way through buying. */
.buysteps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-block: 22px 4px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.buysteps li {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    position: relative;
    color: var(--ink-3);
    font-size: 12.5px;
    font-weight: 650;
    text-align: center;
    counter-increment: step;
}

.buysteps li::before {
    content: counter(step);
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    inline-size: 30px;
    block-size: 30px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--line);
    font-size: 13px;
    font-weight: 700;
    transition: background-color var(--d-slow) var(--ease), border-color var(--d-slow) var(--ease), color var(--d-slow) var(--ease), transform var(--d-slow) var(--spring);
}

/* The line between two steps fills as one is completed. */
.buysteps li + li::after {
    content: "";
    position: absolute;
    inset-block-start: 14px;
    inset-inline-end: 50%;
    inline-size: 100%;
    block-size: 2px;
    background: var(--line);
    z-index: 0;
    transition: background-color var(--d-slow) var(--ease);
}

.buysteps li.is-done::before { content: "✓"; background: var(--ink); border-color: var(--ink); color: var(--surface); }
.buysteps li.is-done, .buysteps li.is-now { color: var(--ink); }
.buysteps li.is-now::before { background: var(--brand); border-color: var(--brand); color: var(--on-brand); transform: scale(1.1); box-shadow: 0 0 0 5px var(--brand-glow); }
.buysteps li.is-done::after, .buysteps li.is-now::after { background: var(--ink); }

.cartgrid { gap: 22px; margin-block: 20px 8px; }

.panel {
    border: 0;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 22px;
}

.line {
    border: 0;
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 14px;
    gap: 16px;
    transition: opacity var(--d-slow) var(--ease), transform var(--d-slow) var(--ease), max-height var(--d-slow) var(--ease), margin var(--d-slow) var(--ease), padding var(--d-slow) var(--ease);
}

.line.is-leaving { opacity: 0; transform: translateX(calc(var(--dx) * 40px)) scale(.98); pointer-events: none; }

.line-img { border-radius: 14px; background: var(--sunken); position: relative; isolation: isolate; }
.line-name { font-size: 15.5px; font-weight: 650; }
.line-meta { font-size: 13.5px; line-height: 1.55; }

.stepper { border: 1.5px solid var(--line); padding: 3px; }
.step { inline-size: 36px; block-size: 36px; background: var(--sunken); transition: background-color var(--d-base) var(--ease), transform var(--d-fast) var(--ease); }
.step:active:not(:disabled) { transform: scale(.85); }
.step-n { min-inline-size: 34px; font-size: 15px; }

.xbtn { color: var(--ink-3); transition: background-color var(--d-base) var(--ease), color var(--d-base) var(--ease), transform var(--d-fast) var(--ease); }
.xbtn:active { transform: scale(.85); }

.summary {
    border: 0;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    gap: 12px;
}

.sumrow { font-size: 15px; }
.sumrow.total { padding-block-start: 16px; border-block-start: 1px dashed var(--line); font-size: 16px; }
.sumrow.total b { font-size: 24px; letter-spacing: -.02em; }

.promo-d { border: 1.5px dashed var(--line); border-radius: var(--r-sm); }
.promo-d > summary { list-style: none; cursor: pointer; padding: 13px 16px; font-weight: 650; font-size: 14.5px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.promo-d > summary::-webkit-details-marker { display: none; }
.promo-d > summary svg { color: var(--ink-3); transition: transform var(--d-base) var(--ease); }
.promo-d[open] { border-style: solid; }
.promo-d[open] > summary svg { transform: rotate(45deg); }
.promo-d > .promo { padding: 0 12px 12px; margin: 0; }
.promo .btn { block-size: 52px; }

/* Delivery addresses read as cards you tick. */
.addr {
    position: relative;
    padding: 16px 16px 16px 14px;
    padding-inline: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    transition: border-color var(--d-base) var(--ease), background-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}

.addr:active { transform: scale(.992); }
.addr input { accent-color: var(--ink); inline-size: 20px; block-size: 20px; margin-block-start: 2px; }
.addr.on { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.addr b { font-size: 15px; }

.addr-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    inline-size: 100%;
    min-block-size: 52px;
    border: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent);
    border-radius: var(--r);
    background: transparent;
    color: var(--ink);
    font-weight: 650;
    font-size: 14.5px;
    cursor: pointer;
    transition: background-color var(--d-base) var(--ease), border-color var(--d-base) var(--ease);
}

@media (hover: hover) { .addr-add:hover { background: var(--sunken); border-color: var(--ink); } }

.colline { grid-template-columns: 56px minmax(0, 1fr) auto; padding-block: 12px; border-block-start-color: var(--line); }
.colline-img { border-radius: 10px; background: var(--sunken); }

@media (max-width: 719.98px) {
    .summary .paybar, .cartgrid .paybar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border-block-start: 1px solid var(--hairline);
        box-shadow: 0 -14px 36px -22px rgba(28, 25, 23, .4);
        view-transition-name: sg-pinbar;
    }

    .paybar-total bdi { font-size: 19px; letter-spacing: -.01em; }
    .cartgrid { padding-block-end: 96px; }
    .panel, .summary { padding: 18px; }
}

.paybar-second { margin-block-start: 4px; }

.summary .btn-ghost.paybar-second { border-color: transparent; text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 4px; block-size: 44px; }

.note { color: var(--ink-3); font-size: 13px; line-height: 1.55; }

/* ============================================================================
   Sign in, account, everything else
   ========================================================================= */

.authcard {
    border: 0;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 34px 26px 28px;
    margin-block: 30px;
}

.authcard h1 { font-size: 34px; line-height: 1.05; margin-block-end: 8px; }
html[dir="rtl"] .authcard h1 { font-size: 25px; line-height: 1.3; }

.authlede { font-size: 15px; }

.otp { letter-spacing: .6em; font-size: 26px !important; padding-inline-start: calc(16px + .6em) !important; }

.progress-dots { display: flex; gap: 6px; margin-block-end: 18px; }
.progress-dots i { flex: 1; block-size: 4px; border-radius: 4px; background: var(--line); transition: background-color var(--d-slow) var(--ease); }
.progress-dots i.is-on { background: var(--brand); }

.settings { max-inline-size: 640px; margin-inline: auto; margin-block-start: 22px; }

.setgroup { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); background: var(--surface); overflow: hidden; }

.setrow { transition: background-color var(--d-base) var(--ease); }
@media (hover: hover) { a.setrow:hover, button.setrow:hover { background: var(--sunken); } }

.seticon { border-radius: 12px; background: var(--sunken); color: var(--ink); }

.setrow.is-profile { padding-block: 22px; }
.setrow.is-profile .seticon { inline-size: 56px; block-size: 56px; border-radius: 50%; background: var(--brand-light); color: var(--brand-ink); }

.tablewrap { border-radius: var(--r); }

/* ============================================================================
   Motion
   ========================================================================= */

/* Things settle into place as they come into view (shop-ui.js sets the delay). */
.js [data-reveal] { opacity: 0; transform: translateY(22px); }

.js [data-reveal].is-in {
    opacity: 1;
    transform: none;
    transition: opacity .7s var(--ease), transform .8s var(--ease);
    transition-delay: calc(var(--i, 0) * 55ms);
}

/* Moving between pages. Supported browsers morph a tapped product's picture
   into the product page; everything else just navigates, as before. The
   header and bars keep their own names so they stay put while the page moves
   beneath them. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }

    ::view-transition-group(root) { animation-duration: 340ms; animation-timing-function: var(--ease); }

    ::view-transition-old(root) { animation: sg-vt-out 180ms var(--ease-io) both; }
    ::view-transition-new(root) { animation: sg-vt-in 380ms var(--ease) 60ms both; }

    ::view-transition-group(sg-hdr), ::view-transition-group(sg-tabbar), ::view-transition-group(sg-pinbar) { animation-duration: 0s; }

    ::view-transition-group(sg-tabind) { animation-duration: 420ms; animation-timing-function: var(--spring); }

    ::view-transition-group(sg-product) { animation-duration: 460ms; animation-timing-function: var(--ease); }
    ::view-transition-old(sg-product), ::view-transition-new(sg-product) { block-size: 100%; object-fit: cover; }
}

@keyframes sg-vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes sg-vt-in { from { opacity: 0; transform: translateY(14px); } }

/* The picture that flies to the cart when something is added. */
.fly {
    position: fixed;
    z-index: 130;
    pointer-events: none;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

/* The "added to your cart" sheet. */
.added { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; text-align: start; }
.added-img { inline-size: 76px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--sunken); }
.added-img img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.added-name { font-weight: 650; font-size: 15.5px; line-height: 1.35; color: var(--ink); }
.added-meta { color: var(--ink-3); font-size: 13.5px; margin-block-start: 2px; }
.added-ok { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; font-size: 14px; }
.added-ok i { display: grid; place-items: center; inline-size: 22px; block-size: 22px; border-radius: 50%; background: var(--ok); color: #fff; animation: sg-pop .6s var(--spring) .1s both; }

/* The full-screen picture viewer. */
dialog.lightbox {
    inset: 0;
    margin: 0;
    inline-size: 100vw;
    max-inline-size: none;
    block-size: 100dvh;
    max-block-size: none;
    border: 0;
    padding: 0;
    background: color-mix(in srgb, #000 94%, transparent);
    color: #fff;
    opacity: 0;
    transition: opacity var(--d-slow) var(--ease), overlay var(--d-slow) allow-discrete, display var(--d-slow) allow-discrete;
}

dialog.lightbox[open] { opacity: 1; }
@starting-style { dialog.lightbox[open] { opacity: 0; } }
dialog.lightbox::backdrop { background: transparent; }

.lb-track { display: flex; block-size: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; padding: 56px 12px 64px; }
.lb-slide img, .lb-slide video { max-inline-size: 100%; max-block-size: 100%; object-fit: contain; border-radius: 10px; }

.lb-x, .lb-nav {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    inline-size: 46px;
    block-size: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background-color var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}

.lb-x { inset-block-start: calc(12px + env(safe-area-inset-top)); inset-inline-end: 12px; }
.lb-x:hover, .lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-x:active, .lb-nav:active { transform: scale(.9); }
.lb-nav { inset-block-start: 50%; margin-block-start: -23px; }
.lb-nav.is-prev { inset-inline-start: 12px; }
.lb-nav.is-next { inset-inline-end: 12px; }
html[dir="rtl"] .lb-nav svg { transform: scaleX(-1); }
@media (hover: none) { .lb-nav { display: none; } }

.lb-count { position: absolute; inset-block-end: calc(18px + env(safe-area-inset-bottom)); inset-inline: 0; text-align: center; z-index: 3; font-size: 13.5px; font-weight: 650; letter-spacing: .04em; opacity: .85; }

@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { opacity: 1; transform: none; }
    .hdr, .tabbar, .drawer-panel, .drawer-back, dialog.ask, dialog.ask::backdrop { transition: none !important; }
    .toast, .field-error, .dot.is-bump, .favfloat.on svg { animation: none !important; }
    .js .card-img:not(.is-loaded)::before { animation: none; }
}

/* ============================================================================
   Small pieces that belong to several pages
   ========================================================================= */

/* A cart line while its change is on the way to the server. */
.line.is-busy .stepper { opacity: .6; pointer-events: none; }
.line.is-busy .xbtn { pointer-events: none; }

/* The sheet shown after adding to the cart. */
.ask-added .ask-form { gap: 16px; }
.ask-added .sumrow { padding-block-start: 14px; border-block-start: 1px dashed var(--line); }
.ask-added .ask-actions .btn { text-decoration: none; }

/* Account and order lists keep their own look, on softer surfaces. */
.orders .order, .order-card { border: 0; box-shadow: var(--shadow); border-radius: var(--r); }

/* Anything still using a hard-coded white card picks up the new shadow. */
.authcard .btn, .formstack .btn { inline-size: 100%; }

/* The sign-in cards sit a little lower and breathe. */
.authcard .formstack { margin-block: 22px 18px; }
.authfoot { padding-block-start: 18px; }

/* Print: none of the chrome. */
@media print {
    .hdr, .tabbar, .toasts, .drawer, .appbar, .ftr, .buybar, .paybar { display: none !important; }
    .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* A product that cannot be bought has one button, not the pair. */
.buybar.is-soldout { grid-template-columns: auto minmax(0, 1fr); }

@media (max-width: 719.98px) {
    .pdp .buybar.is-soldout { grid-template-columns: auto minmax(0, 1fr); }
}

/* Three reasons to trust the page, under the hero. */
.perks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.perks li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 6px;
    border-radius: var(--r);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.3;
    text-align: center;
}

.perks svg { color: var(--brand-ink); }

@media (min-width: 720px) {
    .perks { gap: 14px; margin-top: 24px; }
    .perks li { flex-direction: row; justify-content: center; gap: 12px; padding: 18px; font-size: 14px; }
}

/* Edges: leave room for a notch when the phone is turned sideways. */
.wrap { padding-inline: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }

/* The count sits at the end of the row, whichever way the page reads. */
.drawer-links .dot { margin-inline-start: auto; background: var(--brand); color: var(--on-brand); }

/* A full-screen viewer is nearly black; the page behind should not read through it. */
dialog.lightbox { background: color-mix(in srgb, #000 97%, transparent); }

/* Under a pinned bar, the footer keeps its last line clear of it. */
@media (max-width: 719.98px) {
    body:has(.paybar) .ftr, body:has(.buybar) .ftr { padding-block-end: calc(34px + 92px + env(safe-area-inset-bottom)); }
}

/* The steps do not need the whole width of a wide screen. */
.buysteps { max-inline-size: 640px; margin-inline: auto; }
