/*
 * The shop's public ordering page.
 *
 * One stylesheet, no framework: this page is loaded by a customer on a phone,
 * often on mobile data, and Bootstrap would be 200 KB to style a list and one
 * dialog. Every colour below meets WCAG AA against the background it sits on.
 */

:root {
    --sf-brand: #0369a1;
    --sf-brand-dark: #075985;
    --sf-ink: #0f172a;
    --sf-muted: #475569;
    --sf-line: #e2e8f0;
    --sf-bg: #f8fafc;
    --sf-card: #ffffff;
    --sf-rx: #b45309;
    --sf-rx-bg: #fffbeb;
    --sf-ok: #15803d;
    --sf-danger: #b91c1c;
    --sf-radius: 14px;
    --sf-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* {
    box-sizing: border-box;
}

.sf-body {
    margin: 0;
    background: var(--sf-bg);
    color: var(--sf-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    padding-bottom: 96px;
}

.sf-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Header */

.sf-header {
    background: var(--sf-brand);
    color: #fff;
    padding: 14px 16px 12px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.sf-header-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 760px;
    margin: 0 auto;
}

.sf-brand {
    display: flex;
    gap: 10px;
    min-width: 0;
}

.sf-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    flex: 0 0 auto;
}

.sf-shop {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.sf-addr {
    margin: 2px 0 0;
    font-size: .8rem;
    color: rgba(255, 255, 255, .86);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-header-actions {
    flex: 0 0 auto;
}

.sf-call {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.sf-call:hover,
.sf-call:focus-visible {
    background: rgba(255, 255, 255, .26);
}

.sf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    max-width: 760px;
    margin: 8px auto 0;
    font-size: .78rem;
    color: rgba(255, 255, 255, .9);
}

.sf-meta-item::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .6);
    margin-right: 8px;
    vertical-align: middle;
}

/* Main */

.sf-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 16px 24px;
}

.sf-search-block {
    display: grid;
    gap: 10px;
}

.sf-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: 999px;
    padding: 0 14px;
    height: 48px;
    box-shadow: var(--sf-shadow);
    color: var(--sf-muted);
}

.sf-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    color: var(--sf-ink);
}

.sf-search input::placeholder {
    color: #94a3b8;
}

.sf-search:focus-within {
    border-color: var(--sf-brand);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, .18);
}

.sf-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

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

.sf-chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--sf-line);
    background: var(--sf-card);
    color: var(--sf-muted);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.sf-chip[aria-pressed="true"] {
    background: var(--sf-brand);
    border-color: var(--sf-brand);
    color: #fff;
}

/* Results */

.sf-results {
    margin-top: 16px;
}

.sf-count {
    margin: 0 0 8px;
    font-size: .8rem;
    color: var(--sf-muted);
}

.sf-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.sf-item {
    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: var(--sf-radius);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.sf-item-main {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.sf-thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sf-thumb-empty {
    color: #94a3b8;
    border: 1px dashed var(--sf-line);
    background: #f8fafc;
}

.sf-item-text {
    min-width: 0;
}

.sf-item-name {
    margin: 0;
    font-size: .95rem;
    font-weight: 650;
    line-height: 1.3;
}

.sf-item-sub {
    margin: 2px 0 0;
    font-size: .78rem;
    color: var(--sf-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sf-rx-bg);
    color: var(--sf-rx);
    border: 1px solid #fcd34d;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.sf-item-side {
    text-align: right;
    display: grid;
    gap: 8px;
    justify-items: end;
}

.sf-price {
    font-size: .95rem;
    font-weight: 700;
}

.sf-price small {
    display: block;
    font-size: .68rem;
    font-weight: 500;
    color: var(--sf-muted);
}

.sf-add,
.sf-stepper button {
    min-width: 44px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid var(--sf-brand);
    background: #fff;
    color: var(--sf-brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sf-add:hover,
.sf-stepper button:hover {
    background: #f0f9ff;
}

.sf-stepper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sf-stepper span {
    min-width: 22px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sf-empty {
    margin: 24px 0;
    text-align: center;
    color: var(--sf-muted);
    font-size: .9rem;
}

.sf-skeleton {
    height: 74px;
    border-radius: var(--sf-radius);
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: sf-shimmer 1.2s linear infinite;
}

@keyframes sf-shimmer {
    to {
        background-position: -200% 0;
    }
}

/* How it works */

.sf-note {
    margin-top: 28px;
    padding: 16px;
    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: var(--sf-radius);
}

.sf-note-title {
    margin: 0 0 8px;
    font-size: .9rem;
    font-weight: 700;
}

.sf-note-list {
    margin: 0;
    padding-left: 20px;
    font-size: .84rem;
    color: var(--sf-muted);
    display: grid;
    gap: 6px;
}

.sf-note-foot {
    margin: 10px 0 0;
    font-size: .8rem;
    font-weight: 600;
    color: var(--sf-ink);
}

/* Closed state */

.sf-closed {
    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: var(--sf-radius);
    padding: 28px 20px;
    text-align: center;
    margin-top: 24px;
}

.sf-closed-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.sf-closed-text {
    margin: 0 0 18px;
    color: var(--sf-muted);
    font-size: .9rem;
}

/* Cart bar */

.sf-cartbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--sf-line);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .08);
}

.sf-cartbar-info {
    display: grid;
    line-height: 1.25;
}

.sf-cartbar-count {
    font-size: .76rem;
    color: var(--sf-muted);
}

.sf-cartbar-total {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Buttons */

.sf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.sf-btn-primary {
    background: var(--sf-brand);
    color: #fff;
}

.sf-btn-primary:hover,
.sf-btn-primary:focus-visible {
    background: var(--sf-brand-dark);
}

.sf-btn-ghost {
    background: #fff;
    border-color: var(--sf-line);
    color: var(--sf-ink);
}

.sf-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.sf-btn:focus-visible,
.sf-chip:focus-visible,
.sf-add:focus-visible,
.sf-stepper button:focus-visible,
.sf-sheet-close:focus-visible {
    outline: 3px solid rgba(3, 105, 161, .45);
    outline-offset: 2px;
}

/* Sheet */

.sf-sheet {
    border: 0;
    padding: 0;
    width: min(560px, 100%);
    max-width: 100%;
    margin: auto auto 0;
    border-radius: 18px 18px 0 0;
    background: var(--sf-card);
    box-shadow: 0 -10px 40px rgba(15, 23, 42, .22);
}

.sf-sheet::backdrop {
    background: rgba(15, 23, 42, .45);
}

.sf-sheet-inner {
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
    display: grid;
    gap: 12px;
    max-height: 88vh;
    overflow-y: auto;
}

.sf-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sf-sheet-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.sf-sheet-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--sf-line);
    background: #fff;
    color: var(--sf-muted);
    font-size: .95rem;
    cursor: pointer;
}

.sf-summary {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-size: .84rem;
}

.sf-summary li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--sf-muted);
}

.sf-summary li strong {
    color: var(--sf-ink);
    font-variant-numeric: tabular-nums;
}

.sf-summary-total {
    margin: 4px 0 0;
    display: flex;
    justify-content: space-between;
    font-size: .95rem;
    border-top: 1px dashed var(--sf-line);
    padding-top: 10px;
}

.sf-label {
    font-size: .8rem;
    font-weight: 650;
    color: var(--sf-ink);
    margin-top: 2px;
}

.sf-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--sf-line);
    font: inherit;
    color: var(--sf-ink);
    background: #fff;
}

.sf-input:focus-visible {
    outline: 3px solid rgba(3, 105, 161, .35);
    border-color: var(--sf-brand);
    outline-offset: 1px;
}

.sf-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.sf-radio-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sf-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--sf-line);
    border-radius: 12px;
    font-size: .85rem;
    cursor: pointer;
}

.sf-radio:has(input:checked) {
    border-color: var(--sf-brand);
    box-shadow: 0 0 0 2px rgba(3, 105, 161, .16);
}

.sf-rx {
    background: var(--sf-rx-bg);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.sf-rx-title {
    margin: 0;
    font-size: .85rem;
    font-weight: 700;
    color: var(--sf-rx);
}

.sf-rx-text {
    margin: 0;
    font-size: .8rem;
    color: #78350f;
}

.sf-rx-state {
    margin: 0;
    font-size: .78rem;
    color: var(--sf-ok);
    min-height: 1em;
}

.sf-error {
    margin: 0;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: var(--sf-danger);
    font-size: .82rem;
}

.sf-send {
    width: 100%;
}

.sf-fine {
    margin: 0;
    text-align: center;
    font-size: .74rem;
    color: var(--sf-muted);
}

.sf-done-number {
    margin: 4px 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .01em;
    word-break: break-all;
}

.sf-done-text {
    margin: 0;
    color: var(--sf-muted);
    font-size: .86rem;
}

/* Footer */

.sf-footer {
    max-width: 760px;
    margin: 0 auto;
    padding: 8px 16px 28px;
}

.sf-footer-legal {
    margin: 0 0 4px;
    font-size: .72rem;
    color: #64748b;
    line-height: 1.45;
}

@media (min-width: 560px) {
    .sf-sheet {
        border-radius: 18px;
        margin: auto;
    }

    .sf-sheet-inner {
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sf-skeleton {
        animation: none;
    }

    * {
        scroll-behavior: auto !important;
    }
}


/* ---------------------------------------------------------------------------
   Home page

   The shop opens on a hero, then shelves, then the catalogue. The order matters:
   a customer arriving from a search or a WhatsApp link should see what the shop is
   and where to type before scrolling, and someone browsing should meet curated
   rows before a two-hundred-row list.
   ------------------------------------------------------------------------ */

.sf-hero {
    position: relative;
    border-radius: var(--sf-radius);
    overflow: hidden;
    background: linear-gradient(150deg, var(--sf-brand), var(--sf-brand-dark));
    color: #fff;
    box-shadow: var(--sf-shadow);
}

.sf-hero-deep { background: linear-gradient(150deg, #0f172a, #1e293b); }
.sf-hero-warm { background: linear-gradient(150deg, #b45309, #92400e); }
.sf-hero-fresh { background: linear-gradient(150deg, #15803d, #166534); }
.sf-hero-plain { background: linear-gradient(150deg, #f1f5f9, #e2e8f0); color: var(--sf-ink); }

/* A photograph behind a gradient: the gradient is what keeps the headline legible
   whatever the shop uploads, so contrast does not depend on their taste. */
.sf-hero[style*="--sf-hero-image"] {
    background-image:
        linear-gradient(180deg, rgba(2, 12, 27, .55), rgba(2, 12, 27, .82)),
        var(--sf-hero-image);
    background-size: cover;
    background-position: center;
}

.sf-hero-plain[style*="--sf-hero-image"] {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .94)),
        var(--sf-hero-image);
    color: var(--sf-ink);
}

.sf-hero-inner {
    display: grid;
    gap: 10px;
    padding: 18px 16px 16px;
}

.sf-hero-kicker {
    margin: 0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .82;
}

.sf-hero-title {
    margin: 0;
    font-size: 1.32rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    max-width: 22ch;
}

.sf-hero-sub {
    margin: 0;
    font-size: .86rem;
    line-height: 1.4;
    opacity: .9;
    max-width: 34ch;
}

.sf-hero-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.sf-hero-cta {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--sf-brand-dark);
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}

.sf-hero-plain .sf-hero-cta {
    background: var(--sf-brand);
    color: #fff;
}

.sf-hero-tag {
    font-size: .76rem;
    font-weight: 600;
    opacity: .85;
}

.sf-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--sf-rx-bg);
    border: 1px solid #fde68a;
    color: #7c2d12;
}

.sf-strip-text {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.3;
}

.sf-strip-cta {
    flex: 0 0 auto;
    font-size: .8rem;
    font-weight: 700;
    color: #7c2d12;
}

/* Category tiles */

.sf-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.sf-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--sf-line);
    border-radius: 12px;
    background: linear-gradient(160deg, #e0f2fe, #f8fafc 70%);
    color: var(--sf-ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
    overflow: hidden;
}

.sf-tile-photo {
    background-size: cover;
    background-position: center;
    border-color: transparent;
}

.sf-tile-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 40%, rgba(2, 12, 27, .78));
}

.sf-tile-name,
.sf-tile-count {
    position: relative;
    z-index: 1;
}

.sf-tile-name {
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
}

.sf-tile-count {
    font-size: .72rem;
    color: var(--sf-muted);
}

.sf-tile-photo .sf-tile-name { color: #fff; }
.sf-tile-photo .sf-tile-count { color: rgba(255, 255, 255, .82); }

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

/* Rails */

.sf-rail {
    margin-top: 18px;
}

.sf-rail-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.sf-section-title {
    margin: 0;
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--sf-ink);
}

.sf-rail-sub {
    margin: 2px 0 0;
    font-size: .76rem;
    color: var(--sf-muted);
}

.sf-rail-all {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--sf-line);
    border-radius: 999px;
    background: var(--sf-card);
    color: var(--sf-brand);
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
}

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

/* Edge to edge under a padded parent, so a horizontal row reads as scrollable. */
.sf-rail-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2px 16px 6px;
    margin: 0 -16px;
    scrollbar-width: none;
}

.sf-rail-track::-webkit-scrollbar {
    display: none;
}

.sf-card {
    flex: 0 0 auto;
    width: 138px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: 12px;
}

.sf-card-thumb {
    display: grid;
    place-items: center;
    height: 92px;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--sf-brand);
    overflow: hidden;
}

.sf-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sf-card-name {
    margin: 2px 0 0;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--sf-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.sf-card-sub {
    margin: 0;
    font-size: .7rem;
    color: var(--sf-muted);
}

.sf-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
}

.sf-card-price {
    font-size: .82rem;
    font-weight: 700;
    color: var(--sf-ink);
}

.sf-card-add {
    min-height: 34px;
    min-width: 48px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--sf-brand);
    background: var(--sf-card);
    color: var(--sf-brand);
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
}

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

/* Catalogue */

.sf-catalogue {
    margin-top: 20px;
    scroll-margin-top: 10px;
}

.sf-catalogue-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.sf-catalogue-head .sf-count {
    margin: 0;
}

@media (min-width: 520px) {
    .sf-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sf-hero-title { font-size: 1.5rem; }
    .sf-card { width: 156px; }
    .sf-card-thumb { height: 108px; }
}

@media (min-width: 760px) {
    .sf-main { padding-top: 18px; }
    .sf-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sf-hero-inner { padding: 26px 24px 22px; }
    .sf-hero-title { font-size: 1.72rem; max-width: 26ch; }
    .sf-rail-track { margin: 0; padding: 2px 0 6px; }
}

@media (min-width: 1024px) {
    .sf-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------------------
   Device-specific corrections

   Measured, not guessed:
   - at 390 css px the header action chip and the hours line were clipped by the
     right edge, because the brand block and the call link were both told not to
     shrink;
   - the 17 category tiles were square in two columns, roughly 1,300 px of empty
     colour before the first product;
   - the catalogue was one column at every width, so a laptop showed 244 rows in a
     strip 760 px wide.
   ------------------------------------------------------------------------ */

/* Header: wrap instead of squeeze, and never clip a control. */
.sf-header-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sf-brand {
    flex: 1 1 190px;
}

.sf-header-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.sf-call {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-meta {
    gap: 4px 12px;
}

.sf-meta-item {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Tiles: three across on a phone, a face on every one. */

.sf-tile {
    aspect-ratio: 1 / 1;
    padding: 8px;
    gap: 3px;
}

.sf-tile-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(3, 105, 161, .12);
    color: var(--sf-brand-dark);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    z-index: 1;
}

.sf-tile-photo .sf-tile-badge {
    background: rgba(255, 255, 255, .9);
    color: var(--sf-brand-dark);
}

.sf-tile-name {
    font-size: .74rem;
    line-height: 1.2;
}

.sf-tile-count {
    font-size: .66rem;
}

.sf-tiles-more {
    grid-column: 1 / -1;
    min-height: 40px;
    border: 1px dashed var(--sf-line);
    border-radius: 10px;
    background: transparent;
    color: var(--sf-brand);
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}

/* Show more, for the catalogue. */
.sf-more-wrap {
    display: flex;
    justify-content: center;
    margin: 14px 0 4px;
}

.sf-more {
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid var(--sf-brand);
    background: var(--sf-card);
    color: var(--sf-brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

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

@media (min-width: 360px) {
    .sf-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 560px) {
    .sf-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------------------
   Tablet: two columns of products, wider rails.
   ------------------------------------------------------------------------ */

@media (min-width: 720px) {
    .sf-main { max-width: 980px; }
    .sf-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .sf-list .sf-item { align-items: start; }
    .sf-rail-track { margin: 0; padding: 2px 0 8px; }
}

/* ---------------------------------------------------------------------------
   Desktop: a different page, not a stretched phone.

   The catalogue becomes a three column grid of cards with the photograph on top,
   which is what a shop on a laptop should look like. The category chips stop
   scrolling sideways and simply wrap, because a mouse has no reason to drag a row.
   ------------------------------------------------------------------------ */

@media (min-width: 1000px) {
    .sf-main {
        max-width: 1220px;
        padding: 24px 28px 40px;
    }

    .sf-hero-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        padding: 30px 30px 26px;
        column-gap: 28px;
    }

    .sf-hero-kicker,
    .sf-hero-title,
    .sf-hero-sub,
    .sf-hero .sf-search {
        grid-column: 1;
    }

    .sf-hero-title { font-size: 2rem; max-width: 30ch; }
    .sf-hero-sub { font-size: .94rem; max-width: 46ch; }

    .sf-hero-foot {
        grid-column: 2;
        grid-row: 1 / span 4;
        align-self: center;
        justify-content: flex-end;
    }

    .sf-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }

    .sf-chips {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .sf-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    /* A row becomes a card: picture, name, price along the bottom. */
    .sf-list .sf-item {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
        overflow: hidden;
        align-items: stretch;
    }

    .sf-list .sf-item-main {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .sf-list .sf-thumb {
        width: 100%;
        height: 176px;
        border-radius: 0;
        background: #fff;
        border-bottom: 1px solid var(--sf-line);
    }

    .sf-list .sf-thumb img { object-fit: contain; }

    .sf-list .sf-thumb-empty {
        height: 136px;
        border: 0;
        border-bottom: 1px dashed var(--sf-line);
    }

    .sf-list .sf-item-text {
        padding: 10px 14px 0;
    }

    .sf-list .sf-item-name { font-size: .95rem; }

    .sf-list .sf-item-sub {
        -webkit-line-clamp: 1;
    }

    .sf-list .sf-item-side {
        grid-auto-flow: column;
        justify-content: space-between;
        align-items: center;
        justify-items: start;
        padding: 10px 14px 14px;
        text-align: left;
        width: 100%;
    }

    .sf-list .sf-price small {
        display: inline;
        margin-left: 5px;
    }

    .sf-card { width: 176px; }
    .sf-card-thumb { height: 120px; }
    .sf-rail-track { gap: 14px; }
}

/* ---------------------------------------------------------------------------
   Faults found in a real Chrome render, not in a preview pane
   ------------------------------------------------------------------------ */

/*
 * The cart bar carries [hidden] from the script, but `display: flex` on the class
 * overrode the attribute, so an empty basket still showed "0 items ... Review order"
 * pinned over the page on every device. The attribute has to win.
 */
.sf-cartbar[hidden] {
    display: none !important;
}

/* A search field that fills a 1220 px hero reads like a form, not a shop. */
.sf-hero .sf-search {
    max-width: 560px;
}

@media (min-width: 1000px) {
    /* The header content was pinned to 760 px inside a 1220 px page. */
    .sf-header-inner,
    .sf-meta {
        max-width: 1220px;
    }

    .sf-hero-inner {
        padding: 24px 26px 22px;
        align-items: start;
    }

    .sf-hero-title {
        font-size: 1.76rem;
        max-width: 26ch;
    }

    .sf-hero-sub {
        max-width: 52ch;
    }

    .sf-hero-foot {
        grid-row: auto;
        align-self: end;
        padding-top: 4px;
    }
}

/* ---------------------------------------------------------------------------
   Category tiles: a face, not a cropped pack shot

   A medicine strip is a portrait photograph of small print. Stretched across a
   square tile with a gradient over it, it reads as noise, and five of them in a row
   look broken. The tile is now a flat surface with the shelf's initials and name,
   which stays readable at 96 px and at 190 px.
   ------------------------------------------------------------------------ */

.sf-tile {
    background: linear-gradient(160deg, #eef6fd, #ffffff 62%);
    justify-content: space-between;
    padding: 10px;
}

.sf-tile-photo {
    background-image: none !important;
    background: linear-gradient(160deg, #eef6fd, #ffffff 62%);
    border-color: var(--sf-line);
}

.sf-tile-photo::after {
    content: none;
}

.sf-tile-badge {
    position: static;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(3, 105, 161, .1);
    color: var(--sf-brand-dark);
    font-size: .82rem;
}

.sf-tile-name {
    font-size: .8rem;
    color: var(--sf-ink);
}

.sf-tile-photo .sf-tile-name { color: var(--sf-ink); }
.sf-tile-photo .sf-tile-count { color: var(--sf-muted); }

/* The name and the count belong together at the foot of the tile; without this the
   flex spacing opened a hand's width between them on a 190 px square. */
.sf-tile-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* A shelf picture sits in its own square above the name. Contained, never covered,
   so a portrait artwork and a landscape one both show whole at any tile width. */
.sf-tile-media {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

.sf-tile-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------------------------------------------------------------------------
   Tiles that have a picture: the picture gets the tile, the name gets a footer

   MEASURED at 390 px: a 113 px tile with the name above the picture left 45 px of
   photograph, which is a thumbnail of a thumbnail. The name is now a translucent
   footer across the bottom and the picture owns everything above it, with the footer
   height reserved so a tall bottle is never cut off by its own label.
   ------------------------------------------------------------------------ */

.sf-tile.sf-tile-has-image {
    justify-content: flex-start;
    padding: 0;
    background: #fff;
}

.sf-tile.sf-tile-has-image .sf-tile-media {
    position: absolute;
    inset: 0;
    padding: 4px 4px 34px;
    border-radius: 0;
}

.sf-tile.sf-tile-has-image .sf-tile-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 0;
    padding: 3px 7px 5px;
    background: rgba(255, 255, 255, .95);
    border-top: 1px solid var(--sf-line);
}

.sf-tile-has-image .sf-tile-name {
    font-size: .74rem;
    line-height: 1.15;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sf-tile-has-image .sf-tile-count {
    font-size: .62rem;
    line-height: 1.15;
}

/* ---------------------------------------------------------------------------
   Paying by UPI

   The customer is about to move money, so this block is quiet and literal: the
   amount, the code, the handle in plain text for anyone who would rather type it,
   and one button that opens WhatsApp with the order already written out.
   ------------------------------------------------------------------------ */

.sf-pay {
    margin: 14px 0 4px;
    padding: 14px;
    border: 1px solid var(--sf-line);
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
}

.sf-pay-title {
    margin: 0 0 10px;
    font-size: .95rem;
    color: var(--sf-ink);
}

.sf-qr {
    width: 180px;
    height: 180px;
    margin: 0 auto 10px;
    padding: 6px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--sf-line);
}

.sf-qr svg,
.sf-qr img {
    display: block;
    width: 100%;
    height: 100%;
}

.sf-pay-handle {
    margin: 0 0 10px;
    font-size: .82rem;
    color: var(--sf-muted);
    overflow-wrap: anywhere;
}

.sf-pay-handle strong {
    color: var(--sf-ink);
    font-weight: 700;
}

.sf-pay-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
}

.sf-pay-steps {
    margin: 12px 0 0;
    padding-left: 18px;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--sf-muted);
    text-align: left;
}

.sf-btn-whatsapp {
    background: #128c7e;
    border-color: #0f7a6d;
    color: #fff;
}

.sf-btn-whatsapp:hover {
    background: #0f7a6d;
    color: #fff;
}

/* The pages a customer is entitled to find before paying. */
.sf-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
    font-size: .78rem;
}

.sf-footer-links a {
    color: var(--sf-brand);
    text-decoration: none;
}

.sf-footer-links a:hover {
    text-decoration: underline;
}
