/* ============================================================
   STOREFRONT — TABLET  (768px – 1023px)
   2-col layout: menu | persistent cart panel.
   Centered modal product detail. Bottom nav hidden.
   Larger touch targets, more whitespace, refined typography.
   ============================================================ */

@media (min-width: 768px) and (max-width: 1023px) {

    :root {
        --sf-cart-drawer-width: 340px;
    }

    /* ── Body: cart panel replaces bottom nav ───────────────── */
    body.storefront.has-bottom-nav { padding-bottom: 0; }
    .sf-bottom-nav { display: none; }
    .sf-header-btn.sf-mobile-cart-btn { display: none; }

    /* ── Header ─────────────────────────────────────────────── */
    .sf-header {
        position: sticky;
        top: 0;
        z-index: 100;
        height: var(--sf-header-height);
        background: rgba(250,249,247,0.92);
        border-bottom: 1px solid var(--sf-border);
        display: flex;
        align-items: center;
        padding: 0 24px;
        gap: 14px;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .sf-header-logo {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        object-fit: cover;
        flex-shrink: 0;
        box-shadow: var(--sf-shadow-sm);
    }

    .sf-header-title {
        font-size: 17px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
        letter-spacing: -0.15px;
    }

    .sf-header-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    .sf-header-btn {
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: none;
        color: var(--sf-text);
        font-size: 20px;
        border-radius: 50%;
        cursor: pointer;
        position: relative;
        transition: var(--sf-transition);
        -webkit-tap-highlight-color: transparent;
    }
    .sf-header-btn:hover  { background: var(--sf-bg-secondary); }
    .sf-header-btn:active { background: var(--sf-border); transform: scale(0.94); }

    /* ── Hero (more space, refined typography) ──────────────── */
    .sf-hero-full {
        position: relative;
        width: 100%;
        min-height: 500px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        background-size: cover;
        background-position: center;
        color: #fff;
        overflow: hidden;
    }

    .sf-hero-full::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg,
            rgba(0,0,0,.04) 0%,
            rgba(0,0,0,.32) 40%,
            rgba(0,0,0,.78) 100%);
        z-index: 1;
    }

    .sf-hero-full-inner {
        position: relative;
        z-index: 2;
        padding: 36px 32px 44px;
        max-width: 680px;
    }

    .sf-hero-full-logo {
        width: 84px;
        height: 84px;
        border-radius: 20px;
        object-fit: cover;
        margin-bottom: 22px;
        box-shadow: 0 6px 28px rgba(0,0,0,.45);
        border: 2px solid rgba(255,255,255,.22);
        display: block;
    }

    .sf-hero-full h1 {
        font-size: 40px;
        font-weight: 800;
        margin: 0 0 10px;
        line-height: 1.1;
        letter-spacing: -0.6px;
        text-shadow: 0 2px 16px rgba(0,0,0,.35);
    }

    .sf-hero-subtitle {
        font-size: 16px;
        opacity: .9;
        margin: 0 0 24px;
        line-height: 1.5;
        text-shadow: 0 1px 6px rgba(0,0,0,.25);
        font-weight: 400;
    }

    .sf-hero-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 28px;
    }

    .sf-hero-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 14px;
        background: rgba(255,255,255,.16);
        border: 1px solid rgba(255,255,255,.3);
        border-radius: 22px;
        font-size: 12.5px;
        font-weight: 600;
        color: #fff;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        letter-spacing: 0.2px;
    }
    .sf-hero-chip i { font-size: 14px; }

    .sf-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

    .sf-hero-order-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 16px 32px;
        background: var(--sf-accent-gradient);
        color: #fff;
        border: none;
        border-radius: var(--sf-radius);
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        transition: var(--sf-transition);
        box-shadow: 0 6px 24px rgba(255,107,53,.40);
        font-family: inherit;
        letter-spacing: -0.1px;
        -webkit-tap-highlight-color: transparent;
    }
    .sf-hero-order-btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(255,107,53,.50); }
    .sf-hero-order-btn:active { transform: scale(0.97); opacity: .92; }

    /* ── Info strip ─────────────────────────────────────────── */
    .sf-info-strip {
        display: flex;
        gap: 12px;
        padding: 18px 24px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        background: var(--sf-surface);
        border-bottom: 1px solid var(--sf-border-light);
    }
    .sf-info-strip::-webkit-scrollbar { display: none; }

    .sf-info-card {
        flex-shrink: 0;
        display: flex;
        align-items: flex-start;
        gap: 11px;
        padding: 14px 16px;
        background: var(--sf-bg);
        border-radius: var(--sf-radius-sm);
        min-width: 160px;
        text-decoration: none;
        color: inherit;
        border: 1px solid var(--sf-border-light);
        transition: var(--sf-transition);
    }
    .sf-info-card:hover  { border-color: var(--sf-border); box-shadow: var(--sf-shadow-sm); }
    .sf-info-card:active { transform: scale(0.98); }
    .sf-info-card > i {
        font-size: 20px;
        color: var(--sf-accent);
        flex-shrink: 0;
        margin-top: 1px;
    }

    /* ── Featured carousel ──────────────────────────────────── */
    .sf-featured-section {
        padding: 28px 0 32px;
        background: var(--sf-surface);
        border-bottom: 8px solid var(--sf-bg-secondary);
    }

    .sf-featured-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 24px 18px;
    }

    .sf-featured-title {
        font-size: 20px;
        font-weight: 800;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--sf-text);
        letter-spacing: -0.3px;
    }

    .sf-featured-see-all {
        font-size: 14px;
        color: var(--sf-accent);
        background: none;
        border: none;
        cursor: pointer;
        font-weight: 600;
        padding: 0;
        font-family: inherit;
        transition: opacity .15s;
    }
    .sf-featured-see-all:hover { opacity: .75; }

    .sf-featured-row {
        display: flex;
        gap: 16px;
        padding: 4px 24px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .sf-featured-row::-webkit-scrollbar { display: none; }

    .sf-featured-card {
        flex-shrink: 0;
        width: 200px;
        background: var(--sf-surface);
        border-radius: var(--sf-radius);
        overflow: hidden;
        box-shadow: var(--sf-shadow);
        border: 1px solid var(--sf-border-light);
        cursor: pointer;
        transition: var(--sf-transition);
        -webkit-tap-highlight-color: transparent;
    }
    .sf-featured-card:hover  { transform: translateY(-3px); box-shadow: var(--sf-shadow-hover); }
    .sf-featured-card:active { transform: scale(0.97); }

    .sf-featured-img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        display: block;
        background: var(--sf-bg-secondary);
    }
    .sf-featured-img-placeholder {
        width: 100%;
        height: 150px;
        background: linear-gradient(135deg, var(--sf-bg-secondary), var(--sf-border-light));
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--sf-text-muted);
        font-size: 36px;
    }

    .sf-featured-card-body  { padding: 12px 14px 14px; }
    .sf-featured-card-name {
        font-size: 14px;
        font-weight: 600;
        margin: 0 0 6px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        color: var(--sf-text);
    }
    .sf-featured-card-name-sub {
        font-size: 12px;
        font-weight: 500;
        margin: -4px 0 6px;
        line-height: 1.25;
        color: var(--sf-text-muted);
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .sf-featured-card-price { font-size: 15px; font-weight: 700; color: var(--sf-accent); }

    /* ── Hours / landing browse ─────────────────────────────── */
    .sf-hours-section {
        padding: 28px 24px 32px;
        background: var(--sf-surface);
        border-bottom: 8px solid var(--sf-bg-secondary);
    }
    .sf-hours-title {
        font-size: 20px;
        font-weight: 800;
        margin: 0 0 18px;
        display: flex;
        align-items: center;
        gap: 10px;
        letter-spacing: -0.3px;
    }

    .sf-landing-browse {
        padding: 28px 24px 40px;
        background: var(--sf-surface);
    }

    /* ── Menu body: 2-col grid (menu + cart panel) ──────────── */
    .sf-menu-body {
        display: grid;
        grid-template-columns: 1fr var(--sf-cart-drawer-width);
        min-height: calc(100vh - var(--sf-header-height));
    }

    .sf-cat-sidebar { display: none; }

    /* Hide standalone cart screen — panel always visible */
    #screenCart.sf-screen.active { display: none; }

    .sf-menu-main { min-width: 0; overflow-y: auto; }

    /* ── Category pills (horizontal sticky bar) ─────────────── */
    .sf-categories {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding: 14px 22px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        background: var(--sf-surface);
        border-bottom: 1px solid var(--sf-border-light);
        position: sticky;
        top: var(--sf-header-height);
        z-index: 90;
    }
    .sf-categories::-webkit-scrollbar { display: none; }

    .sf-category-pill {
        flex-shrink: 0;
        padding: 10px 20px;
        border-radius: 24px;
        border: 1.5px solid var(--sf-border);
        background: var(--sf-surface);
        color: var(--sf-text-secondary);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        transition: var(--sf-transition);
        -webkit-tap-highlight-color: transparent;
        letter-spacing: 0.1px;
    }
    .sf-category-pill:hover  { border-color: var(--sf-accent); color: var(--sf-accent); }
    .sf-category-pill.active {
        background: var(--sf-accent);
        color: #fff;
        border-color: var(--sf-accent);
        box-shadow: 0 3px 10px rgba(255,107,53,.30);
    }
    .sf-category-pill:active { transform: scale(0.96); }

    /* ── Product grid: 2 cols, generous spacing ─────────────── */
    .sf-product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        padding: 22px;
        background: var(--sf-bg);
    }

    /* ── Product card ───────────────────────────────────────── */
    .sf-product-card {
        background: var(--sf-surface);
        border-radius: var(--sf-radius);
        overflow: hidden;
        box-shadow: var(--sf-shadow-sm);
        cursor: pointer;
        transition: var(--sf-transition);
        border: 1px solid var(--sf-border-light);
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }
    .sf-product-card:hover  { transform: translateY(-2px); box-shadow: var(--sf-shadow); }
    .sf-product-card:active { transform: scale(0.98); }

    .sf-product-img-wrap {
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background: var(--sf-bg-secondary);
    }
    .sf-product-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.35s ease;
    }
    .sf-product-card:hover .sf-product-img { transform: scale(1.04); }

    .sf-product-img-placeholder {
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, var(--sf-bg-secondary) 0%, var(--sf-border-light) 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--sf-text-muted);
        font-size: 32px;
    }

    .sf-product-ribbon {
        position: absolute;
        top: 12px;
        left: 12px;
        background: var(--sf-accent);
        color: #fff;
        font-size: 10px;
        font-weight: 800;
        padding: 4px 10px;
        border-radius: 6px;
        letter-spacing: .6px;
        text-transform: uppercase;
        box-shadow: 0 2px 8px rgba(255,107,53,.45);
        z-index: 2;
    }

    .sf-product-add-btn {
        position: absolute;
        bottom: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--sf-accent);
        color: #fff;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        cursor: pointer;
        box-shadow: 0 4px 14px rgba(255,107,53,.45);
        transition: var(--sf-transition);
        z-index: 3;
        -webkit-tap-highlight-color: transparent;
    }
    .sf-product-add-btn:hover  { transform: scale(1.1); background: var(--sf-accent-hover); }
    .sf-product-add-btn:active { transform: scale(0.92); }
    .sf-product-add-btn.added  { background: #059669; }

    .sf-product-info { padding: 14px 16px 16px; }

    .sf-product-cat-tag {
        display: inline-block;
        font-size: 10px;
        font-weight: 700;
        padding: 3px 9px;
        border-radius: 6px;
        margin-bottom: 6px;
        background: var(--sf-bg-secondary);
        color: var(--sf-text-muted);
        letter-spacing: .3px;
        text-transform: uppercase;
    }

    .sf-product-name {
        font-size: 15px;
        font-weight: 700;
        margin: 0 0 4px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        color: var(--sf-text);
        letter-spacing: -0.15px;
    }

    .sf-product-name-sub {
        font-size: 12px;
        font-weight: 500;
        margin: -2px 0 5px;
        line-height: 1.3;
        color: var(--sf-text-muted);
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .sf-product-desc {
        font-size: 12px;
        color: var(--sf-text-muted);
        margin: 0 0 10px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.45;
    }

    .sf-product-price {
        font-size: 17px;
        font-weight: 800;
        color: var(--sf-accent);
        letter-spacing: -0.25px;
    }

    /* ── Cart panel (always-visible right side) ─────────────── */
    .sf-cart-panel {
        display: flex;
        flex-direction: column;
        position: sticky;
        top: var(--sf-header-height);
        height: calc(100vh - var(--sf-header-height));
        overflow: hidden;
        background: var(--sf-surface);
        border-left: 1px solid var(--sf-border-light);
        flex-shrink: 0;
    }

    /* ── Product detail: centered modal ─────────────────────── */
    .sf-bottom-sheet.sf-product-modal {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        transform: translate(-50%, calc(-50% + 30px)) scale(0.96);
        width: 560px;
        max-width: calc(100vw - 64px);
        max-height: 86vh;
        max-height: 86dvh;
        border-radius: var(--sf-radius-lg);
        transition: transform .3s cubic-bezier(0.32, 0.72, 0, 1), opacity .25s ease;
        opacity: 0;
        background: var(--sf-surface);
        display: flex;
        flex-direction: column;
        z-index: 201;
        overflow: hidden;
    }
    .sf-bottom-sheet.sf-product-modal.open {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    .sf-bottom-sheet.sf-product-modal .sf-sheet-handle { display: none; }

    /* Other sheets (lang/location): centered bottom sheet */
    .sf-bottom-sheet:not(.sf-product-modal) {
        position: fixed;
        bottom: 0;
        left: 50%;
        right: auto;
        width: min(520px, calc(100vw - 48px));
        max-height: 80vh;
        max-height: 80dvh;
        background: var(--sf-surface);
        border-radius: 22px 22px 0 0;
        transform: translateX(-50%) translateY(100%);
        transition: transform .35s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 201;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .sf-bottom-sheet:not(.sf-product-modal).open {
        transform: translateX(-50%) translateY(0);
    }

    .sf-sheet-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sf-sheet-img-wrap {
        position: relative;
        width: 100%;
        background: var(--sf-bg-secondary);
        max-height: 320px;
        overflow: hidden;
    }
    .sf-sheet-img {
        width: 100%;
        max-height: 320px;
        object-fit: cover;
        display: block;
    }
    .sf-sheet-img-placeholder {
        width: 100%;
        height: 240px;
        background: linear-gradient(135deg, var(--sf-bg-secondary), var(--sf-border-light));
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--sf-text-muted);
        font-size: 52px;
    }

    .sf-sheet-content { padding: 24px 24px 4px; }

    .sf-sheet-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 10px;
    }

    .sf-sheet-title {
        font-size: 22px;
        font-weight: 800;
        margin: 0;
        line-height: 1.2;
        letter-spacing: -0.4px;
        flex: 1;
    }

    .sf-sheet-price {
        font-size: 24px;
        font-weight: 800;
        color: var(--sf-accent);
        letter-spacing: -0.5px;
        flex-shrink: 0;
    }

    .sf-sheet-desc {
        font-size: 14.5px;
        color: var(--sf-text-secondary);
        line-height: 1.55;
        margin: 0 0 22px;
    }

    .sf-sheet-footer {
        padding: 16px 24px;
        border-top: 1px solid var(--sf-border-light);
        flex-shrink: 0;
        background: var(--sf-surface);
    }
}

/* ── Tablet wide subset (≥960px): 3-col product grid ────────── */
@media (min-width: 960px) and (max-width: 1023px) {
    :root { --sf-cart-drawer-width: 360px; }

    .sf-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        padding: 24px;
    }
}
