/* ProntoNube storefront — global stylesheet.

   Everything here is what Blazor CSS isolation cannot reach: @font-face, @keyframes, and the
   html/body pinning of the public store. All *component* styling lives in the companion
   `.razor.css` files, and all design tokens live on `.storefront-layout`
   (StorefrontLayout.razor.css), from where they inherit into every descendant.

   Static file: changes take effect on a plain browser refresh, no rebuild. */

/* ---------------------------------------------------------------- Typography ---
   Self-hosted (never a CDN). Both are variable fonts covering 400-700 in a single
   file, same pattern as the Fredoka brand font in brand.css. Licence: SIL OFL 1.1. */

@font-face {
    font-family: 'Schibsted Grotesk';
    src: url('/fonts/schibsted-grotesk-latin-variable.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Hanken Grotesk';
    src: url('/fonts/hanken-grotesk-latin-variable.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

/* -------------------------------------------------------------------- Tokens ---
   The storefront's design tokens. Declared once here rather than in the layout's scoped
   CSS: custom properties inherit to every descendant regardless of Blazor's scope
   attributes, so every component reads them without redeclaring anything.

   The storefront is light-only: the design has a single warm palette and shoppers are
   anonymous, so the backoffice's `app_theme` cookie must not bleed into the public store.
   `.theme-dark` is stripped from <html> on storefront routes by the inline script in
   App.razor; `color-scheme` additionally pins form controls and scrollbars to light. */

.storefront-layout {
    color-scheme: light;

    /* Accent — the purple that carries every primary action and active state. */
    --sf-accent: #5b4be0;
    --sf-accent-hover: #4c3fce;
    --sf-accent-soft: #efedfb;
    --sf-accent-soft-border: #e2ddfa;

    /* Ink — text, the announcement bar, and the footer field. */
    --sf-ink: #26211d;
    --sf-ink-2: #5b5349;
    --sf-muted: #8a8177;
    --sf-muted-2: #a49a8d;
    --sf-hairline: #cabfae;

    /* Surfaces — warm cream page over white cards. */
    --sf-bg: #f6f3ee;
    --sf-surface: #ffffff;
    --sf-surface-2: #f2eee7;
    --sf-surface-3: #faf7f2;
    --sf-border: #ece6dc;
    --sf-border-strong: #e4ddd1;
    --sf-divider: #ddd4c6;

    /* Status */
    --sf-sale: #e23b4e;
    --sf-success: #0f7a4a;
    --sf-success-soft: #f0faf3;
    --sf-success-border: #cfebd7;
    --sf-whatsapp: #25d366;

    /* Footer, which sits on the ink field. */
    --sf-footer-text: #cfc7bb;
    --sf-footer-muted: #a89f92;
    --sf-footer-border: #3a342e;

    /* Type */
    --sf-font-display: 'Schibsted Grotesk', system-ui, -apple-system, "Segoe UI", sans-serif;
    --sf-font-body: 'Hanken Grotesk', system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Radii */
    --sf-r-sm: 9px;
    --sf-r-md: 12px;
    --sf-r-lg: 14px;
    --sf-r-xl: 18px;
    --sf-r-2xl: 20px;
    --sf-r-3xl: 22px;
    --sf-r-pill: 999px;

    /* Elevation */
    --sf-shadow-card: 0 1px 2px rgba(38, 33, 29, 0.03);
    --sf-shadow-hover: 0 10px 24px -14px rgba(38, 33, 29, 0.28);
    --sf-shadow-float: 0 14px 34px -16px rgba(38, 33, 29, 0.32);
    --sf-shadow-accent: 0 10px 22px -10px rgba(91, 75, 224, 0.7);
    --sf-shadow-accent-sm: 0 6px 16px -6px rgba(91, 75, 224, 0.7);
    --sf-shadow-dialog: 0 40px 90px -30px rgba(0, 0, 0, 0.5);

    /* Rhythm */
    --sf-gutter: 16px;
    --sf-gap: 12px;
    --sf-max-width: 1180px;

    /* Height of the sticky header — the offset the chip row docks at, and the
       scrollspy's trigger line. Kept as a token so both agree by construction. */
    --sf-header-h: 60px;
}

/* ---------------------------------------------------------------- Utilities ---
   Shared across components, so they cannot live in any one component's scoped CSS
   (a scoped rule only matches elements that component itself rendered). */

/* Page gutter + max width. Every full-width band centres its content with this. */
.sf-container {
    width: 100%;
    max-width: var(--sf-max-width);
    margin-inline: auto;
    padding-inline: var(--sf-gutter);
}

/* The one product grid used everywhere a set of ProductCards is laid out: the browse feed (opening
   collection and every category section), collections, and search. Global — NOT scoped to any one
   component — so the same concept renders identically across pages (UI-consistency standard). A
   scoped copy in each component is exactly the divergence that let the feed's category sections fall
   back to a single full-width column while collections stayed a grid. */
.sf-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sf-gap);
}

@media (min-width: 768px) {
    .sf-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1100px) {
    .sf-product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Browse-feed section + subcategory separator. Global — NOT scoped to CatalogFeed — because the
   category sections and their subgroups are rendered by the FeedSection child component; a scoped rule
   would only reach the opening section CatalogFeed renders itself. */
.sf-feed-section {
    padding-top: 22px;
}

.sf-feed-opening {
    padding-top: 18px;
}

.sf-feed-subgroup {
    margin-top: 14px;
}

.sf-feed-subhead {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Bottom margin so the label isn't cramped against the first row of cards below it. */
    margin: 14px 0 18px;
}

.sf-feed-subname {
    font-weight: 600;
    /* Between the body/count size and the 22px category heading — a clear second-level label. */
    font-size: 16px;
    letter-spacing: 0.01em;
    color: var(--sf-ink-2);
}

.sf-feed-subrule {
    flex: 1;
    height: 1px;
    background: var(--sf-border);
}

/* Prices and quantities: digits must not jitter as values change. */
.sf-tabular {
    font-variant-numeric: tabular-nums;
}

/* Horizontal chip/tab strips: scroll on mobile without showing a scrollbar. */
.sf-scroller {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sf-scroller::-webkit-scrollbar {
    display: none;
}

/* Arrows of a horizontal strip (ScrollArrows + storefrontScroller.js). With the scrollbar hidden, a
   desktop mouse has no other way to reach the items past the edge. Shown only on pointer devices
   and only while the strip can scroll that way (the module sets data-can-prev / data-can-next).
   They sit at the edges of the centred content column, over a fade into the page background. */
.sf-hscroll {
    position: relative;
}

.sf-hscroll-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: none;
    align-items: center;
    width: 56px;
    padding: 0;
    border: none;
    color: var(--sf-ink-2);
    cursor: pointer;
}

.sf-hscroll-btn--prev {
    left: calc((100% - min(100%, var(--sf-max-width))) / 2);
    justify-content: flex-start;
    background: linear-gradient(to right, var(--sf-bg) 45%, rgba(246, 243, 238, 0));
}

.sf-hscroll-btn--next {
    right: calc((100% - min(100%, var(--sf-max-width))) / 2);
    justify-content: flex-end;
    background: linear-gradient(to left, var(--sf-bg) 45%, rgba(246, 243, 238, 0));
}

.sf-hscroll-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--sf-border-strong);
    border-radius: 50%;
    background: var(--sf-surface);
    box-shadow: 0 1px 3px rgba(38, 33, 29, 0.12);
    font-size: 14px;
    transition: color 0.15s, border-color 0.15s;
}

.sf-hscroll-btn:hover i {
    border-color: var(--sf-accent-soft-border);
    color: var(--sf-accent);
}

@media (hover: hover) and (pointer: fine) {
    .sf-hscroll[data-can-prev] > .sf-hscroll-btn--prev,
    .sf-hscroll[data-can-next] > .sf-hscroll-btn--next {
        display: flex;
    }
}

/* Quick-add / quantity stepper — the accent pill used by BOTH the product-card quick-add
   (QuickAddStepper) and the product-detail buy box (ProductBuyBox renders the same markup inline).
   Global, not scoped to either component, so the control looks identical everywhere (UI-consistency
   standard): a scoped copy only reached the card, leaving the buy box's stepper unstyled. */
.sf-qa {
    display: flex;
    align-items: center;
    animation: sf-pop 0.18s ease;
}

.sf-qa--stepper {
    gap: 2px;
    padding: 3px;
    border-radius: var(--sf-r-lg);
    background: var(--sf-accent);
    box-shadow: var(--sf-shadow-accent-sm);
}

.sf-qa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.sf-qa--stepper .sf-qa-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sf-qa-btn:active {
    transform: scale(0.92);
}

/* The detail's stepper shows 0 when the item is not in the cart (card 065): "−" has nothing to
   remove, so it reads as inert — dimmed, no hover, no press. */
.sf-qa-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.sf-qa--stepper .sf-qa-btn:disabled:hover {
    background: transparent;
}

.sf-qa-btn:disabled:active {
    transform: none;
}

/* The "+" before anything is in the cart: a solid accent tile with its own lift. */
.sf-qa-btn--add {
    width: 44px;
    height: 44px;
    border-radius: var(--sf-r-lg);
    background: var(--sf-accent);
    font-size: 20px;
    box-shadow: var(--sf-shadow-accent-sm);
}

.sf-qa-btn--add:hover {
    background: var(--sf-accent-hover);
}

/* Product detail: the same accent-pill stepper, just sized up to sit beside the primary button. */
.sf-qa.sf-qa--lg.sf-qa--stepper {
    padding: 4px;
}

.sf-qa--lg .sf-qa-btn {
    width: 42px;
    height: 42px;
    font-size: 18px;
}

/* Quantity picker (card 065) — the number in the middle of every stepper (product card, product
   detail, cart line), rendered by QuantityPicker. It reads as a dropdown: the number plus a chevron on a
   faint tile. The native <select> lies transparently over it, so tapping anywhere on the tile opens the
   device's own picker, while the tile's width comes from the visible number: it grows with 3+ digits or
   a decimal (0.250) instead of clipping, and no fixed digit count is assumed. It takes whatever room the
   stepper has left (flex-grow) and never shrinks below its content, so a stepper stretched to its
   container gives the number the extra space and a narrow one never clips it. */
.sf-qa-pick {
    position: relative;
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 54px;
    height: 38px;
    padding: 0 9px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
}

.sf-qa-pick:hover {
    background: rgba(255, 255, 255, 0.24);
}

.sf-qa-pick:has(.sf-qa-pick-select:focus-visible) {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

.sf-qa-pick-chevron {
    font-size: 0.7em;
    opacity: 0.85;
}

/* 16px keeps iOS Safari from zooming the page when the select takes focus. */
.sf-qa-pick-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    font-size: 16px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.sf-qa-pick-select option {
    color: var(--sf-ink);
    background: var(--sf-surface);
}

/* Product detail: sized up with the rest of the stepper. */
.sf-qa--lg .sf-qa-pick {
    min-width: 64px;
    height: 42px;
    font-size: 18px;
}

/* Product card (card 065): once the product is in the cart the stepper spans the bottom of the photo
   instead of hugging the corner, so the number and its picker get the card's width. The "+" alone
   stays a corner tile. */
.sf-card-add:has(.sf-qa--stepper) {
    left: 8px;
}

.sf-card-add .sf-qa--stepper {
    justify-content: space-between;
}

/* A narrow card (two columns on a phone) leaves little room: the "−"/"+" give up a few pixels before the
   number does, so even a long quantity (0.250, 1250) stays whole. */
.sf-card-add .sf-qa--stepper .sf-qa-btn {
    flex: 0 1 38px;
    min-width: 28px;
}

.sf-card-add .sf-qa-pick {
    gap: 3px;
    padding: 0 6px;
}

/* Background scroll-lock while the product overlay is open (spec §8). Fixing the body at the saved
   offset freezes the background AND is how the exact scroll position is restored on close (the offset
   is read back and re-applied by storefrontOverlay.js). Global because it targets <body>, which no
   component's scoped CSS can reach. */
body.sf-overlay-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

/* Chip navigation primitives (spec §2). Global rather than component-scoped: the shared ChipNav
   component, the browse feed, and the finite-list page all render chip rows, and inline-rendered
   rows would not pick up a scoped rule. Three states, ascending prominence: neutral category,
   accent-tinted collection, solid active. */

.sf-chipnav-inner {
    gap: 8px;
    padding-block: 9px;
}

.sf-chipnav-divider {
    flex: 0 0 auto;
    width: 1px;
    height: 22px;
    margin-inline: 2px;
    background: var(--sf-divider);
}

.sf-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 8px 15px;
    border: 1px solid var(--sf-border-strong);
    border-radius: var(--sf-r-pill);
    background: var(--sf-surface);
    color: #4a443c;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sf-chip--collection {
    border-color: var(--sf-accent-soft-border);
    background: var(--sf-accent-soft);
    color: var(--sf-accent);
}

.sf-chip--active,
.sf-chip--collection.sf-chip--active {
    border-color: var(--sf-accent);
    background: var(--sf-accent);
    color: #fff;
}

/* Hover only where a pointer can hover: on a touch screen :hover sticks to the last chip tapped, which
   is the active one. And never on the active chip with the light hover background — white text on
   cream was unreadable; the active chip just deepens its accent. */
@media (hover: hover) {
    .sf-chip:not(.sf-chip--active):hover {
        border-color: var(--sf-accent-soft-border);
        background: var(--sf-surface-3);
    }

    .sf-chip--active:hover {
        border-color: var(--sf-accent-hover);
        background: var(--sf-accent-hover);
        color: #fff;
    }
}

/* The browse feed's scrollspy (storefrontFeed.js) reads the active section off the sticky nav's bottom
   edge, and the nav grows or shrinks as the subcategory row comes and goes. Scroll anchoring (Edge,
   Chrome) compensates that resize by moving the page, which undoes the change that caused it — the
   active category then flips back and forth on its own. Without anchoring, the section/trigger-line
   relation does not depend on the nav's height, so the selection is stable in every browser. */
html:has(.sf-feed),
body:has(.sf-feed) {
    overflow-anchor: none;
}

/* Visually hidden but available to assistive technology. */
.sf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading state: an accent ring centred in the space the content will take. Global because two
   components render it — the product detail overlay and the browse feed while its data loads (card
   093) — and a scoped rule would only style the component that declared it. Pair it with a
   .sf-sr-only "Cargando…" so the wait is announced, never an empty or error state. */
.sf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

.sf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--sf-border);
    border-top-color: var(--sf-accent);
    border-radius: 50%;
    animation: sf-spin 0.7s linear infinite;
}

/* Cart line (spec §5.1 and §5.2). Global rather than scoped to either component: CartLineRow and
   CartUnavailableRow both render `.sf-cline*` markup, and a scoped rule only matches elements the
   declaring component itself rendered — so a copy in CartLineRow.razor.css would leave every
   unavailable row unstyled. Same reason `.sf-qa` and `.sf-product-grid` are global. */

.sf-cline {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    grid-template-areas:
        "media body body"
        "media qty  total";
    align-items: center;
    column-gap: 12px;
    row-gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--sf-border);
}

/* :last-of-type, not :last-child — the undo bar is a sibling <div> inside the same list, and on mobile
   it is taken out of flow, which would otherwise leave the final row with a divider under it and
   nothing beneath. Rows are <article>, so the last row still matches. */
.sf-cline:last-of-type {
    border-bottom: none;
}

.sf-cline-media {
    grid-area: media;
    display: block;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--sf-surface-2);
}

.sf-cline-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-cline-body {
    grid-area: body;
    min-width: 0;
}

.sf-cline-name {
    display: block;
    color: var(--sf-ink);
    font-family: var(--sf-font-display);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    text-decoration: none;
}

a.sf-cline-name:hover {
    color: var(--sf-accent);
}

.sf-cline-unit {
    margin-top: 3px;
    font-size: 13px;
}

/* "Se vende en múltiplos de 6" (tarjeta 005): why this line's stepper jumps by more than one. */
.sf-cline-multiple {
    margin: 2px 0 0;
    color: var(--sf-muted);
    font-size: 12px;
}

/* The stepper is an intrinsically sized pill; without this it stretches to fill the 1fr track on
   mobile and the accent bar runs the width of the row. */
.sf-cline-qty {
    grid-area: qty;
    justify-self: start;
}

/* Card 065: on a phone the stepper takes the room the qty track has (up to a comfortable cap) rather
   than its minimum, so the picker in the middle is easy to read and hit; from tablet up it keeps a
   generous fixed floor so every line's stepper lines up. */
@media (max-width: 767.98px) {
    .sf-cline-qty {
        justify-self: stretch;
        max-width: 260px;
    }

    .sf-cline-qty .sf-qa--cart {
        justify-content: space-between;
    }
}

@media (min-width: 768px) {
    .sf-qa--cart {
        min-width: 184px;
    }
}

/* Item note. A single link until the shopper writes one, so a cart of twenty products is not twenty
   empty text boxes; once written it reads as part of the line, indented under the price. */

/* The whole annotation is one button: a tinted block with a rule down its left edge, which reads as a
   quoted aside rather than as another control in the row. Laid out as inline flow, not flex, so the
   pencil trails the last word of the note instead of floating off at the right edge — the point being
   that the action is visibly attached to the text it edits. */
.sf-cline-note {
    display: block;
    width: 100%;
    margin: 6px 0 0;
    padding: 6px 9px;
    border: none;
    border-left: 2px solid var(--sf-border-strong);
    border-radius: 0 var(--sf-r-sm) var(--sf-r-sm) 0;
    background: var(--sf-surface-3);
    color: var(--sf-ink-2);
    font-family: inherit;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.sf-cline-note:hover {
    background: var(--sf-surface-2);
    border-left-color: var(--sf-accent);
    color: var(--sf-ink);
}

.sf-cline-note-icon {
    margin-inline-end: 5px;
    color: var(--sf-muted);
    font-size: 11px;
}

/* pre-line, so the line breaks the shopper typed are the line breaks the picker reads. */
.sf-cline-note-text {
    white-space: pre-line;
}

.sf-cline-note-pencil {
    margin-inline-start: 6px;
    color: var(--sf-muted);
    font-size: 10.5px;
}

.sf-cline-note:hover .sf-cline-note-pencil {
    color: var(--sf-accent);
}

.sf-cline-note-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
}

.sf-cline-note-add i {
    font-size: 10px;
}

.sf-cline-noteinput {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 7px 9px;
    border: 1px solid var(--sf-border-strong);
    border-radius: var(--sf-r-sm);
    background: var(--sf-surface);
    color: var(--sf-ink);
    font-family: var(--sf-font-body);
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
}

.sf-cline-noteinput::placeholder {
    color: var(--sf-muted-2);
}

.sf-cline-noteinput:focus {
    outline: none;
    border-color: var(--sf-accent);
    box-shadow: 0 0 0 3px var(--sf-accent-soft);
}

/* Why a change did not take — the 99 cap, or an item that went out of stock. On the line itself, never
   in a dialog: the shopper's attention is on the row they just touched. */
.sf-cline-notice {
    margin: 4px 0 0;
    color: var(--sf-sale);
    font-size: 12px;
    line-height: 1.35;
}

.sf-cline-total {
    grid-area: total;
    justify-self: end;
    color: var(--sf-ink);
    font-weight: 600;
    font-size: 15px;
}

/* Desktop-only "×". Always visible, never revealed on hover: the store is mobile-first and hover
   does not exist on touch, so a hover-only control would simply be unreachable for most shoppers. */
.sf-cline-remove {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--sf-r-pill);
    background: transparent;
    color: var(--sf-muted);
    font-size: 12px;
    cursor: pointer;
}

.sf-cline-remove:hover {
    background: var(--sf-surface-2);
    color: var(--sf-ink);
}

/* Unavailable group: smaller thumbnail, demoted name, no stepper, no money. */
.sf-cline--gone {
    grid-template-columns: 48px 1fr auto;
    grid-template-areas: "media body actions";
}

.sf-cline--gone .sf-cline-media {
    width: 48px;
    height: 48px;
    opacity: 0.65;
}

.sf-cline--gone .sf-cline-name {
    color: var(--sf-ink-2);
    font-weight: 500;
}

.sf-cline-pill {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: var(--sf-r-pill);
    background: var(--sf-surface-2);
    color: var(--sf-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sf-cline-gone-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sf-cline-link {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--sf-accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.sf-cline-link:hover {
    text-decoration: underline;
}

.sf-cline-link--danger {
    color: var(--sf-sale);
}

/* Cart stepper: same accent pill as everywhere else, sized up to the 44px minimum tap target the
   cart requires (§5.1) — the card's 38px is fine for a one-off "+", not for repeated adjustment. */
.sf-qa--cart .sf-qa-btn {
    width: 44px;
    height: 44px;
}

.sf-qa--cart .sf-qa-pick {
    min-width: 64px;
    height: 44px;
    font-size: 17px;
}

/* At one unit the "−" deletes instead of decrementing, so it reads as destructive. */
.sf-qa-btn--danger:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* The cart's fixed bottom bar takes over the corner the WhatsApp button occupies, and would sit under
   it — obscuring the primary action. Raise the float while that bar is on screen. Only the cart page
   renders `.sf-cart-bar`, and it is hidden from 768px up, so this is scoped by construction. */
@media (max-width: 767.98px) {
    body:has(.sf-cart-bar) .sf-whatsapp {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }

    /* And higher still while an undo toast is up. The float carries a larger z-index than the toast,
       so at the shorter offset it covers the right end of "Deshacer" — a tap meant to restore a line
       would open WhatsApp instead. Declared after the rule above so it wins when both apply. */
    body:has(.sf-cundo) .sf-whatsapp {
        bottom: calc(148px + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 768px) {
    .sf-cline {
        grid-template-columns: 64px 1fr auto auto 30px;
        grid-template-areas: "media body qty total remove";
        column-gap: 16px;
        padding: 16px 0;
    }

    /* Each line is its own grid, so an auto-sized total column would be a different width per row and
       the steppers would step left as the amounts get longer. A floor wide enough for the largest
       realistic amount keeps both columns constant, and the whole list lines up. */
    .sf-cline-total {
        min-width: 96px;
    }

    .sf-cline-remove {
        display: flex;
        grid-area: remove;
    }

    .sf-cline--gone {
        grid-template-columns: 48px 1fr auto;
        grid-template-areas: "media body actions";
    }
}

/* ------------------------------------------------------------------ Keyframes ---
   Shared by components that live in different scopes (the quick-add swap fires in
   ProductCard and in the PDP), so they cannot live in a single component's CSS. */

/* Quick-add "+" <-> stepper swap. */
@keyframes sf-pop {
    from {
        transform: scale(0.8);
        opacity: 0.4;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrim and the subcategory band appearing. */
@keyframes sf-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* The loading ring (.sf-spinner). */
@keyframes sf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Product detail as a mobile bottom sheet. */
@keyframes sf-sheet-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Product detail as a desktop dialog. */
@keyframes sf-dialog-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Respect the visitor's reduced-motion preference across every storefront animation. */
@media (prefers-reduced-motion: reduce) {
    .storefront-layout *,
    .storefront-layout *::before,
    .storefront-layout *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ----------------------------------------------------------------- Checkout ---
   The checkout form's field card and its two-column rows (checkout spec §3.2, §3.3).

   Global rather than scoped because CheckoutContactFields and CheckoutAddressFields both render
   these classes, and Blazor's scoped CSS only matches elements the declaring component rendered —
   putting them in either component's sheet would leave the other one unstyled. */

.sf-co-fields {
    padding: 16px;
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-r-xl);
    background: var(--sf-surface);
    box-shadow: var(--sf-shadow-card);
}

/* Two fields side by side from tablet up; stacked on a phone, where a half-width postal code is
   harder to tap than it is short. */
.sf-co-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 14px;
}

.sf-co-col {
    min-width: 0;
}

@media (min-width: 768px) {
    .sf-co-fields {
        padding: 20px;
    }

    .sf-co-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ------------------------------------------------------- Navigation progress ---
   Thin bar along the top while an enhanced navigation fetches the next page
   (js/storefrontNavProgress.js). It lives on <html>, outside .storefront-layout, so the
   tokens do not reach it: the accent is repeated as the var() fallback. The width creeps
   to 85 % over a few seconds and only completes when the new page is in. */

.sf-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 0;
    height: 3px;
    background: var(--sf-accent, #5b4be0);
    box-shadow: 0 0 6px rgba(91, 75, 224, 0.45);
    opacity: 0;
    pointer-events: none;
}

.sf-nav-progress.is-active {
    width: 85%;
    opacity: 1;
    transition: width 6s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.15s ease;
}

.sf-nav-progress.is-done {
    width: 100%;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.3s ease 0.15s;
}

@media (prefers-reduced-motion: reduce) {
    .sf-nav-progress.is-active {
        transition: opacity 0.15s ease;
    }
}
