/* AdvanceShop Storefront CSS - Customer-facing pages */

/* ============ Base ============ */
:root {
    /* AdvanceShop brand tokens (Phase 2 — from BRAND_KIT.md) */
    --accent: #ffd700;
    --bg: #1a0a2e;          /* Day 53.16: lighter purple (was #0d001a — too black) */
    --purple: #4b0082;
    --bg-rgb: 26, 10, 46;
    --card-glass: rgba(40, 20, 70, 0.85);   /* Day 53.16: lighter card bg */
    --border-gold: rgba(255, 215, 0, 0.5);  /* slightly stronger gold */
    --backdrop-blur: blur(25px);

    /* Legacy sb-* tokens (kept for compatibility) */
    --sb-primary: var(--accent);
    --sb-primary-dark: #b8960a;
    --sb-text: #f5ebff;     /* Day 53.16: brighter text for contrast */
    --sb-text-muted: #b8a4d4; /* Day 53.16: brighter muted */
    --sb-border: rgba(255, 215, 0, 0.35);
    --sb-bg: #1a0a2e;       /* Day 53.16: lighter purple */
    --sb-card: rgba(40, 20, 70, 0.85);  /* lighter card */
    --sb-success: #00ff88;
    --sb-danger: #ff4444;
    --sb-warning: #ffaa00;
    --sb-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --sb-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --sb-radius: 8px;
    --sb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", "PingFang HK", "Noto Sans CJK TC", sans-serif;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--sb-font);
    background: var(--bg);
    color: var(--sb-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ Header ============ */
/* Day 54d: Plan C hybrid header — desktop horizontal nav + mobile hamburger.
   Layout:
     Row 1: [Logo] [Desktop nav] [Locale] [Cart mobile] [Cart desktop] [Hamburger mobile]
     Row 2: [Search full-width] (mobile + desktop) */
.sb-store-header {
    /* AdvanceShop brand: glassmorphism header */
    background: rgba(15, 0, 35, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.sb-store-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    position: relative;
}
.sb-store-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: var(--accent);
    text-decoration: none;
    /* Gold drop-shadow (Phase 2 brand) — applies to text only */
}
.sb-store-logo:hover { text-decoration: none; color: var(--accent); opacity: 0.85; }
.sb-store-logo-img {
    height: 48px;   /* Day 53.19: matched Kate's 45px + 3px for store visibility */
    width: 48px;
    object-fit: contain;
    /* Day 53.19: Match Kate main site's gold outline + glow (4x 1px gold + 1x 12px gold glow) */
    filter: drop-shadow(1px 1px 0 rgba(255, 215, 0, 0.9))
            drop-shadow(-1px -1px 0 rgba(255, 215, 0, 0.9))
            drop-shadow(1px -1px 0 rgba(255, 215, 0, 0.9))
            drop-shadow(-1px 1px 0 rgba(255, 215, 0, 0.9))
            drop-shadow(0 0 12px rgba(255, 215, 0, 0.5))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease, filter 0.3s ease;
}
.sb-store-logo:hover .sb-store-logo-img {
    transform: scale(1.08);
    filter: drop-shadow(1px 1px 0 rgba(255, 255, 255, 1))
            drop-shadow(-1px -1px 0 rgba(255, 255, 255, 1))
            drop-shadow(1px -1px 0 rgba(255, 255, 255, 1))
            drop-shadow(-1px 1px 0 rgba(255, 255, 255, 1))
            drop-shadow(0 0 25px rgba(255, 215, 0, 1))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.sb-store-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* Desktop horizontal nav (≥769px). Hidden on mobile. */
.sb-store-nav-desktop {
    display: none;
    gap: 24px;
    align-items: center;
}
.sb-store-nav-desktop .sb-store-nav-link {
    /* Day 53.16: brighter text + gold glow for visibility */
    color: #ffd966;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    border-radius: 6px;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.sb-store-nav-desktop .sb-store-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 215, 0, 0.15);
    border-bottom-color: var(--sb-primary);
    text-decoration: none;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Mobile hamburger drawer — hidden on desktop. */
.sb-store-nav-mobile {
    display: none;
    gap: 0;
    background: rgba(40, 20, 70, 0.95);  /* Day 53.16: dark theme */
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    box-shadow: var(--sb-shadow-md);
    flex-direction: column;
    min-width: 220px;
    padding: 8px 0;
    z-index: 200;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.sb-store-nav-mobile.sb-open { display: flex; }
.sb-store-nav-mobile .sb-store-nav-link {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    font-size: 15px;
    font-weight: 500;
    color: #ffd966;  /* Day 53.16: brighter gold text */
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.sb-store-nav-mobile .sb-store-nav-link:last-child { border-bottom: none; }
.sb-store-nav-mobile .sb-store-nav-link:hover {
    background: rgba(255, 215, 0, 0.15);
    color: #ffffff;
    text-decoration: none;
}

/* Hamburger toggle — hidden on desktop. */
.sb-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--sb-border);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    font-size: 20px;
    color: var(--sb-text);
}

/* Dedicated search row (mobile + desktop). */
.sb-store-search-row {
    border-top: 1px solid var(--sb-border);
    background: var(--sb-bg, #fafafa);
}
.sb-store-search-row-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px;
}
.sb-store-search-row-inner .sb-search-box {
    width: 100%;
    max-width: none;
    margin: 0;
}
/* Default: hide mobile-only cart icon on desktop, hide desktop-only cart icon on mobile */
.sb-cart-icon-mobile { display: none; }
.sb-cart-icon {
    position: relative;
    padding: 8px 12px;
    background: var(--sb-primary);
    color: white !important;
    border-radius: var(--sb-radius);
    font-size: 14px;
    cursor: pointer;
}
.sb-cart-icon:hover { background: var(--sb-primary-dark); text-decoration: none; }
.sb-cart-count {
    background: var(--sb-card);
    color: var(--sb-primary);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
    display: inline-block;
}

/* ============ Container ============ */
.sb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ============ Product grid ============ */
.sb-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.sb-product-card {
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sb-product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sb-shadow-md);
}
.sb-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(40, 20, 70, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    font-size: 48px;
    overflow: hidden;
}
.sb-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sb-product-info {
    padding: 12px 16px;
}
.sb-product-name {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--sb-text);
}
.sb-product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--sb-primary);
}
.sb-product-compare-price {
    text-decoration: line-through;
    color: var(--sb-text-muted);
    font-size: 14px;
    margin-right: 8px;
    font-weight: 400;
}
.sb-product-stock {
    font-size: 12px;
    color: var(--sb-text-muted);
    margin-top: 4px;
}
.sb-out-of-stock { color: var(--sb-danger); }
.sb-low-stock { color: var(--sb-warning); }

/* ============ Product detail ============ */
.sb-product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    background: var(--sb-card);
    padding: 32px;
    border-radius: var(--sb-radius);
    border: 1px solid var(--sb-border);
}
@media (max-width: 768px) {
    .sb-product-detail { grid-template-columns: 1fr; }
}
.sb-product-image-large {
    aspect-ratio: 1 / 1;
    background: #ffffff;    /* Day 54b: white background so contain-fit shows boxes on white like a real product catalog */
    border-radius: var(--sb-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    font-size: 96px;
}
.sb-product-image-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* Day 54b: changed from cover to contain — preserve full product image */
}
.sb-product-info-large h1 {
    margin: 0 0 12px;
    font-size: 28px;
}
.sb-product-info-large .sb-product-price {
    font-size: 28px;
    margin-bottom: 16px;
}
.sb-product-description {
    margin: 16px 0;
    color: var(--sb-text-muted);
    line-height: 1.6;
}
.sb-variant-selector {
    margin: 16px 0;
}
.sb-variant-option {
    padding: 8px 12px;
    border: 2px solid var(--sb-border);
    border-radius: var(--sb-radius);
    cursor: pointer;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
    background: var(--sb-card);
}
.sb-variant-option:hover { border-color: var(--sb-primary); }
.sb-variant-option.sb-selected {
    border-color: var(--sb-primary);
    background: rgba(255, 215, 0, 0.18);
}
.sb-variant-option.sb-out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ Buttons ============ */
.sb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--sb-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--sb-font);
    text-decoration: none;
}
.sb-btn:active { transform: translateY(1px); }
.sb-btn-primary {
    background: var(--sb-primary);
    color: white;
}
.sb-btn-primary:hover { background: var(--sb-primary-dark); color: white; text-decoration: none; }
.sb-btn-secondary {
    background: var(--sb-card);
    border-color: var(--sb-border);
    color: var(--sb-text);
}
.sb-btn-secondary:hover { background: var(--sb-bg); }
.sb-btn-danger { background: var(--sb-danger); color: white; }
.sb-btn-warning { background: var(--sb-warning); color: white; }
.sb-btn-warning:hover { background: #D97706; color: white; text-decoration: none; }
.sb-btn-lg { padding: 14px 28px; font-size: 16px; }
.sb-btn-sm { padding: 6px 12px; font-size: 12px; }
.sb-btn-block { width: 100%; justify-content: center; }
.sb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ Cart page ============ */
.sb-cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
@media (max-width: 768px) {
    .sb-cart-layout { grid-template-columns: 1fr; }
}
.sb-cart-items {
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
}
.sb-cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--sb-border);
    align-items: center;
}
.sb-cart-item:last-child { border-bottom: none; }
.sb-cart-item-image {
    width: 80px;
    height: 80px;
    background: rgba(40, 20, 70, 0.6);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sb-cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.sb-cart-item-name { font-weight: 500; }
.sb-cart-item-meta { font-size: 12px; color: var(--sb-text-muted); }
.sb-qty-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--sb-border);
    border-radius: 4px;
    text-align: center;
}
.sb-cart-summary {
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 80px;
}
.sb-cart-summary h2 { margin: 0 0 12px; font-size: 18px; }
.sb-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}
.sb-summary-row.sb-total {
    border-top: 1px solid var(--sb-border);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 18px;
}

/* ============ Empty cart ============ */
.sb-empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--sb-text-muted);
}
.sb-empty-cart-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.4; }

/* ============ Forms ============ */
.sb-form { display: flex; flex-direction: column; gap: 12px; }
.sb-form-group { display: flex; flex-direction: column; gap: 4px; }
.sb-form-group label { font-size: 13px; font-weight: 500; }
.sb-form-group input,
.sb-form-group select,
.sb-form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    font-size: 14px;
    font-family: var(--sb-font);
}
.sb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .sb-form-row { grid-template-columns: 1fr; } }

/* ============ Toast ============ */
.sb-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
}
.sb-toast {
    background: #1F2937;
    color: white;
    padding: 12px 20px;
    border-radius: var(--sb-radius);
    font-size: 14px;
    margin-bottom: 8px;
    box-shadow: var(--sb-shadow-md);
    animation: sb-slide-in 0.3s ease;
}
.sb-toast-success { background: var(--sb-success); }
.sb-toast-error { background: var(--sb-danger); }
@keyframes sb-slide-in {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

/* Day 54d: Mobile responsive (header/nav) */
@media (max-width: 768px) {
    .sb-store-header-inner {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 8px;
    }
    .sb-store-logo {
        flex: 1;
        min-width: 0;
    }
    .sb-store-logo-img {
        height: 32px;
        width: 32px;
    }
    .sb-store-logo-text {
        font-size: 16px;
    }
    /* Hide desktop elements on mobile */
    .sb-store-nav-desktop { display: none; }
    .sb-header-locale-desktop { display: none; }
    .sb-cart-icon-desktop { display: none; }
    /* Show mobile elements on mobile */
    .sb-cart-icon-mobile { display: inline-flex; }
    .sb-cart-icon-mobile {
        padding: 6px 10px;
        font-size: 14px;
    }
    /* Mobile hamburger drawer — absolute dropdown anchored to header */
    .sb-store-nav-mobile {
        position: absolute;
        top: calc(100% + 8px);
        right: 16px;
        order: 99;  /* push below search row visually if needed */
    }
    /* Mobile search row inner */
    .sb-store-search-row-inner {
        padding: 8px 16px;
    }
}

/* Day 54d: Desktop (≥769px) — horizontal nav inline */
@media (min-width: 769px) {
    .sb-store-header-inner {
        padding: 14px 24px;
    }
    /* Show desktop elements */
    .sb-store-nav-desktop {
        display: flex;
        flex: 1;
        justify-content: center;
    }
    .sb-header-locale-desktop {
        display: block;
        flex-shrink: 0;
    }
    /* Hide mobile elements */
    .sb-cart-icon-mobile { display: none !important; }
    .sb-store-nav-mobile { display: none !important; }
    .sb-hamburger { display: none !important; }
}/* =============================================================
 * Customer / Account / Auth / Form / Table styles
 * Added 2026-07-18 for customer-facing pages (login, register, account, orders)
 * Reuses CSS vars defined at the top of store.css
 * ============================================================= */

/* Buttons */
.sb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--sb-card);
    color: var(--sb-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
    gap: 6px;
}
.sb-btn:hover {
    text-decoration: none;
    background: var(--sb-bg);
}
.sb-btn-primary {
    background: var(--sb-primary);
    color: white;
    border-color: var(--sb-primary);
}
.sb-btn-primary:hover {
    background: var(--sb-primary-dark);
    border-color: var(--sb-primary-dark);
    color: white;
}
.sb-btn-secondary {
    background: var(--sb-card);
    color: var(--sb-text);
    border-color: var(--sb-border);
}
.sb-btn-secondary:hover {
    background: var(--sb-bg);
    border-color: var(--sb-text-muted);
}
.sb-btn-block {
    display: flex;
    width: 100%;
}
.sb-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Forms */
.sb-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sb-form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.sb-form-row > .sb-form-group {
    flex: 1;
    min-width: 200px;
}
.sb-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sb-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-text);
}
.sb-form-group input,
.sb-form-group select,
.sb-form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--sb-border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--sb-card);
    color: var(--sb-text);
    font-family: inherit;
    transition: border-color 0.15s ease;
}
.sb-form-group input:focus,
.sb-form-group select:focus,
.sb-form-group textarea:focus {
    outline: none;
    border-color: var(--sb-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.15);
}
.sb-form-group input:disabled {
    background: var(--sb-bg);
    color: var(--sb-text-muted);
    cursor: not-allowed;
}
.sb-form-hint {
    font-size: 12px;
    color: var(--sb-text-muted);
}

/* Alerts */
.sb-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.5;
}
.sb-alert-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}
.sb-alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Auth pages */
.sb-auth-body {
    background: var(--sb-bg);
    min-height: 100vh;
}
.sb-auth-wrap {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.sb-auth-card {
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.sb-auth-card-wide {
    max-width: 540px;
}
.sb-auth-card h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--sb-text);
}
.sb-auth-subtitle {
    margin: 0 0 24px 0;
    color: var(--sb-text-muted);
    font-size: 14px;
}
.sb-auth-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--sb-border);
    text-align: center;
    font-size: 14px;
    color: var(--sb-text-muted);
}
.sb-auth-links a {
    color: var(--sb-primary);
    text-decoration: none;
    margin: 0 4px;
}
.sb-auth-links a:hover {
    text-decoration: underline;
}
.sb-auth-divider {
    color: var(--sb-text-muted);
    margin: 0 8px;
}

/* Account / Orders pages */
.sb-account-wrap {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 20px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.sb-account-nav {
    flex: 0 0 200px;
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sb-account-nav a {
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.sb-account-nav a:hover {
    background: var(--sb-bg);
}
.sb-account-nav a.sb-active {
    background: var(--sb-primary);
    color: white;
}
.sb-account-content {
    flex: 1;
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    padding: 32px;
    min-width: 0;
}
.sb-account-content h1 {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: var(--sb-text);
}
.sb-account-section {
    margin-bottom: 32px;
}
.sb-account-section:last-child {
    margin-bottom: 0;
}
.sb-account-section h2 {
    font-size: 18px;
    margin: 0 0 16px 0;
    color: var(--sb-text);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sb-border);
}

/* Tables */
.sb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.sb-table thead {
    background: var(--sb-bg);
}
.sb-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--sb-text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--sb-border);
}
.sb-table td {
    padding: 12px;
    border-bottom: 1px solid var(--sb-border);
    color: var(--sb-text);
    vertical-align: middle;
}
.sb-table tbody tr:hover {
    background: var(--sb-bg);
}
.sb-table tbody tr:last-child td {
    border-bottom: none;
}
.sb-table tfoot td {
    border-top: 2px solid var(--sb-border);
    border-bottom: none;
    padding: 10px 12px;
}
.sb-total-row td {
    font-size: 16px;
    color: var(--sb-primary);
}

/* Badges */
.sb-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--sb-bg);
    color: var(--sb-text);
    border: 1px solid var(--sb-border);
}
.sb-badge-pending,
.sb-badge-processing {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FCD34D;
}
.sb-badge-paid,
.sb-badge-confirmed,
.sb-badge-shipped,
.sb-badge-delivered,
.sb-badge-pickup_ready,
.sb-badge-picked_up {
    background: #DBEAFE;
    color: #1E40AF;
    border-color: #93C5FD;
}
.sb-badge-cancelled,
.sb-badge-failed {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FCA5A5;
}
.sb-badge-refunded {
    background: #E0E7FF;
    color: #3730A3;
    border-color: #A5B4FC;
}

/* Empty state */
.sb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--sb-text-muted);
}
.sb-empty-state p {
    margin: 0 0 24px 0;
    font-size: 16px;
}

/* Order meta */
.sb-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 16px;
    background: var(--sb-bg);
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 14px;
}
.sb-order-meta strong {
    color: var(--sb-text);
    margin-right: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .sb-account-wrap {
        flex-direction: column;
    }
    .sb-account-nav {
        flex: 1 1 auto;
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
    .sb-account-nav a {
        white-space: nowrap;
    }
    .sb-account-content {
        padding: 20px;
    }
    .sb-form-row {
        flex-direction: column;
        gap: 16px;
    }
    .sb-form-row > .sb-form-group {
        min-width: 0;
    }
    .sb-table {
        font-size: 13px;
    }
    .sb-table th,
    .sb-table td {
        padding: 8px;
    }
}
/* =============================================================
 * Bundle Pages — Phase 3 Day 1
 * ============================================================= */

.sb-page-hero {
    text-align: center;
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--sb-border);
    margin-bottom: 32px;
}

.sb-page-hero h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

.sb-page-subtitle {
    color: var(--sb-text-muted);
    font-size: 16px;
    margin: 0;
}

.sb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--sb-text-muted);
}

.sb-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.sb-empty-state h2 {
    margin: 0 0 12px;
    color: var(--sb-text);
}

.sb-empty-state p {
    margin: 8px 0;
}

/* Bundle list grid */
.sb-bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.sb-bundle-card {
    background: var(--sb-bg-elevated, rgba(40,20,70,0.7));
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sb-bundle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sb-bundle-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.sb-bundle-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.sb-bundle-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--sb-bg);
    overflow: hidden;
}

.sb-bundle-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-bundle-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 80px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.sb-bundle-savings-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sb-bundle-savings-badge-large {
    font-size: 16px;
    padding: 10px 16px;
    top: 16px;
    right: 16px;
}

.sb-bundle-card-body {
    padding: 16px;
}

.sb-bundle-card-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.sb-bundle-card-description {
    margin: 0 0 12px;
    color: var(--sb-text-muted);
    font-size: 14px;
    line-height: 1.5;
    min-height: 42px;
}

.sb-bundle-card-meta {
    margin-bottom: 12px;
    color: var(--sb-text-muted);
    font-size: 13px;
}

.sb-bundle-card-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.sb-bundle-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--sb-primary, #FF6A1A);
}

.sb-bundle-compare-price {
    font-size: 14px;
    color: var(--sb-text-muted);
    text-decoration: line-through;
}

/* Bundle detail page */
.sb-breadcrumb {
    margin: 16px 0 24px;
    font-size: 14px;
    color: var(--sb-text-muted);
}

.sb-breadcrumb a {
    color: var(--sb-text-muted);
    text-decoration: none;
}

.sb-breadcrumb a:hover {
    color: var(--sb-primary);
}

.sb-breadcrumb-sep {
    margin: 0 8px;
    color: var(--sb-border);
}

.sb-breadcrumb-current {
    color: var(--sb-text);
    font-weight: 500;
}

.sb-bundle-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

.sb-bundle-detail-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--sb-bg);
    border-radius: var(--sb-radius);
    overflow: hidden;
}

.sb-bundle-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-bundle-detail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 160px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.sb-bundle-detail-title {
    margin: 0 0 16px;
    font-size: 32px;
    line-height: 1.2;
}

.sb-bundle-detail-description {
    margin: 0 0 24px;
    color: var(--sb-text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
}

.sb-bundle-detail-pricing {
    background: var(--sb-bg);
    padding: 20px;
    border-radius: var(--sb-radius);
    margin-bottom: 24px;
}

.sb-bundle-detail-price-row,
.sb-bundle-detail-compare-row,
.sb-bundle-detail-savings-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 6px 0;
}

.sb-bundle-detail-label {
    color: var(--sb-text-muted);
    font-size: 14px;
}

.sb-bundle-detail-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--sb-primary, #FF6A1A);
}

.sb-bundle-detail-compare {
    font-size: 16px;
    color: var(--sb-text-muted);
    text-decoration: line-through;
}

.sb-bundle-detail-savings {
    font-size: 16px;
    color: #16a34a;
    font-weight: 600;
}

.sb-bundle-detail-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.sb-bundle-detail-qty {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sb-bundle-detail-qty label {
    font-size: 13px;
    color: var(--sb-text-muted);
}

.sb-bundle-detail-form .sb-qty-input {
    width: 80px;
}

.sb-btn-large {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.sb-bundle-detail-validity {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--sb-bg);
    border-radius: var(--sb-radius);
    color: var(--sb-text-muted);
    font-size: 13px;
}

.sb-bundle-detail-validity span {
    display: block;
    margin: 2px 0;
}

.sb-add-result {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--sb-radius);
    font-size: 14px;
}

.sb-add-result-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.sb-add-result-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Bundle items list */
.sb-bundle-items-section {
    border-top: 2px solid var(--sb-border);
    padding-top: 32px;
}

.sb-bundle-items-section h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.sb-bundle-items-list {
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    overflow: hidden;
}

.sb-bundle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--sb-border);
    background: var(--sb-card);
}

.sb-bundle-item:last-child {
    border-bottom: none;
}

.sb-bundle-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.sb-bundle-item-name {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.sb-bundle-item-name a {
    color: inherit;
    text-decoration: none;
}

.sb-bundle-item-name a:hover {
    color: var(--sb-primary);
}

.sb-bundle-item-variant {
    color: var(--sb-text-muted);
    font-size: 13px;
}

.sb-bundle-item-qty {
    color: var(--sb-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.sb-bundle-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.sb-bundle-item-unit {
    color: var(--sb-text-muted);
    font-size: 12px;
}

.sb-bundle-item-subtotal {
    font-weight: 600;
    font-size: 15px;
}

.sb-bundle-items-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px;
    background: var(--sb-bg);
    border-top: 2px solid var(--sb-border);
    font-size: 16px;
}

.sb-bundle-items-total strong {
    font-size: 18px;
    color: var(--sb-primary, #FF6A1A);
}

/* Responsive */
@media (max-width: 768px) {
    .sb-bundle-detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sb-bundle-detail-title {
        font-size: 24px;
    }

    .sb-bundle-detail-form {
        flex-direction: column;
        align-items: stretch;
    }

    .sb-bundle-detail-form .sb-qty-input {
        width: 100%;
    }

    .sb-bundle-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sb-bundle-item-price {
        align-items: flex-start;
    }
}

/* =============================================================
 * Bundle Cart Items — Phase 3 Day 2
 * ============================================================= */

.sb-cart-item-bundle {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFFFFF 100%);
}

.sb-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-cart-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 36px;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE9D9 100%);
}

.sb-cart-item-info {
    min-width: 0;
}

.sb-cart-item-name-bundle {
    color: var(--sb-primary, #FF6A1A);
    text-decoration: none;
    font-weight: 600;
}

.sb-cart-item-name-bundle:hover {
    text-decoration: underline;
}

.sb-cart-item-subtitle {
    color: var(--sb-text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.sb-cart-bundle-details {
    margin-top: 8px;
    font-size: 13px;
}

.sb-cart-bundle-details summary {
    color: var(--sb-text-muted);
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    font-weight: 500;
}

.sb-cart-bundle-details summary:hover {
    color: var(--sb-primary);
}

.sb-cart-bundle-details[open] summary {
    margin-bottom: 6px;
}

.sb-cart-bundle-items-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 8px 12px;
    background: var(--sb-card);
    border-radius: 4px;
    border: 1px dashed var(--sb-border);
}

.sb-cart-bundle-items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    color: var(--sb-text-muted);
}

.sb-cart-bundle-item-name {
    flex: 1;
}

.sb-cart-bundle-item-qty {
    font-weight: 500;
    color: var(--sb-text);
    margin-left: 12px;
}

.sb-cart-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 640px) {
    .sb-cart-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
    }
    .sb-cart-item-image {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
        grid-row: 1 / 3;
    }
    .sb-cart-item-info {
        min-width: 0;          /* allow text wrap inside grid cell */
        grid-column: 2;
        grid-row: 1;
    }
    .sb-cart-item-actions {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-end;
    }
}

/* =============================================================
 * Bundle unavailable state — Phase 3 Day 4
 * ============================================================= */

.sb-btn-disabled {
    background: var(--sb-bg, #F3F4F6) !important;
    color: var(--sb-text-muted, #6B7280) !important;
    cursor: not-allowed !important;
    border: 1px dashed var(--sb-border, #E5E7EB);
}

.sb-btn-disabled:hover {
    background: var(--sb-bg, #F3F4F6) !important;
    transform: none !important;
}

.sb-order-item-mini-bundle {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFFFFF 100%);
    padding-left: 8px;
    border-left: 3px solid var(--sb-primary, #FF6A1A);
    margin-left: -8px;
}

/* =============================================================
 * Bundle stock badges — Phase 3 Day 5
 * ============================================================= */

.sb-stock-low-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* Bundle stock badge (list page) */
.sb-bundle-stock-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: white;
}

.sb-bundle-stock-badge-out {
    background: #dc2626;
}

.sb-bundle-stock-badge-low {
    background: #f59e0b;
}

/* =============================================================
 * Featured bundles — Phase 3 Day 6
 * ============================================================= */

.sb-featured-bundles {
    margin: 0 0 32px;
    padding: 20px 0;
    border-bottom: 1px solid var(--sb-border);
}

.sb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.sb-section-header h2 {
    margin: 0;
    font-size: 20px;
}

.sb-section-link {
    color: var(--sb-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.sb-section-link:hover {
    text-decoration: underline;
}

.sb-featured-bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.sb-featured-bundle-card {
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: var(--sb-card);
    transition: transform 0.15s, box-shadow 0.15s;
}

.sb-featured-bundle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.sb-featured-bundle-image {
    position: relative;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE9D9 100%);
    overflow: hidden;
}

.sb-featured-bundle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-featured-bundle-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 48px;
}

.sb-featured-bundle-savings {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #FF6A1A;
    color: white;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.sb-featured-bundle-oos {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #dc2626;
    color: white;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.sb-featured-bundle-low {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #f59e0b;
    color: white;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.sb-featured-bundle-info {
    padding: 12px;
}

.sb-featured-bundle-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.sb-featured-bundle-meta {
    font-size: 12px;
    color: var(--sb-text-muted);
    margin-bottom: 8px;
}

.sb-featured-bundle-price-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.sb-featured-bundle-price {
    color: var(--sb-primary);
    font-weight: 700;
    font-size: 16px;
}

.sb-featured-bundle-compare {
    color: var(--sb-text-muted);
    font-size: 13px;
}

@media (max-width: 640px) {
    .sb-featured-bundles-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .sb-featured-bundle-info {
        padding: 8px;
    }
}

/* =============================================================
 * Limited-time ribbon — Phase 3 Day 7
 * ============================================================= */

.sb-limited-time-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.sb-limited-time-last_day {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    animation: sb-pulse 1.6s ease-in-out infinite;
}

.sb-limited-time-ending_soon {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.sb-limited-time-limited {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: white;
}

@keyframes sb-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* Bundle items with thumbnails (detail page polish) */
.sb-bundle-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    margin-bottom: 8px;
    transition: background 0.15s;
}

.sb-bundle-item:hover {
    background: var(--sb-bg-soft, #F9FAFB);
}

.sb-bundle-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE9D9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sb-bundle-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-bundle-item-thumb-placeholder {
    font-size: 24px;
}

.sb-bundle-item-info {
    min-width: 0;
}

.sb-bundle-item-name {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
}

.sb-bundle-item-name a {
    color: inherit;
    text-decoration: none;
}

.sb-bundle-item-name a:hover {
    color: var(--sb-primary);
    text-decoration: underline;
}

.sb-bundle-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--sb-text-muted);
    font-size: 13px;
}

.sb-bundle-item-variant {
    background: var(--sb-bg-soft, #F3F4F6);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.sb-bundle-item-qty-badge {
    background: var(--sb-primary);
    color: white;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.sb-bundle-item-price {
    text-align: right;
}

.sb-bundle-item-unit {
    color: var(--sb-text-muted);
    font-size: 12px;
}

.sb-bundle-item-subtotal {
    display: block;
    font-weight: 600;
    color: var(--sb-primary);
}

@media (max-width: 640px) {
    .sb-bundle-item {
        grid-template-columns: 48px 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    .sb-bundle-item-thumb {
        grid-row: 1 / 3;
        width: 48px;
        height: 48px;
    }
    .sb-bundle-item-price {
        grid-column: 2;
        text-align: left;
    }
}

/* Bundle limited ribbon (list page) */
.sb-bundle-limited-ribbon {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Featured bundle limited ribbon */
.sb-featured-bundle-limited {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Admin bundle savings summary — Phase 3 Day 8 */
.sb-bundle-admin-savings {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE9D9 100%);
    border: 1px solid #FFB627;
    border-radius: var(--sb-radius);
    margin-bottom: 12px;
    font-size: 14px;
}

.sb-bundle-admin-savings-label {
    background: #FF6A1A;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.sb-bundle-admin-savings strong {
    color: var(--sb-primary);
    font-size: 16px;
}

.sb-bundle-admin-savings-pct {
    color: var(--sb-primary);
    font-weight: 700;
}

/* ============================================================
   AI Chat Panel — Storefront AI Specialist embed
   Day 4 — 2026-07-20
============================================================ */

.sb-ai-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    padding: 12px 20px;
    background: var(--sb-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sb-font);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 106, 26, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sb-ai-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 106, 26, 0.4);
}

.sb-ai-launcher:active {
    transform: translateY(0);
}

.sb-ai-launcher .sb-ai-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 11px;
}

.sb-ai-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    /* Day 12 — use small viewport (excludes dynamic URL bar) + safe-area-inset for notched devices.
       Old calc(100vh - 80px) included the URL bar, so panel header could be covered by it. */
    max-height: calc(100svh - 80px - env(safe-area-inset-top, 0px));
    background: var(--sb-card);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--sb-font);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sb-ai-panel.sb-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.sb-ai-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--sb-primary) 0%, var(--sb-primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sb-ai-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.sb-ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sb-ai-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.sb-ai-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin: 2px 0 0 0;
    line-height: 1.2;
}

.sb-ai-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.sb-ai-action {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.sb-ai-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sb-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--sb-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sb-ai-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.sb-ai-msg-user {
    align-self: flex-end;
    background: var(--sb-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.sb-ai-msg-assistant {
    align-self: flex-start;
    background: var(--sb-card);
    color: var(--sb-text);
    border: 1px solid var(--sb-border);
    border-bottom-left-radius: 4px;
}

.sb-ai-msg-error {
    align-self: center;
    background: rgba(239, 68, 68, 0.1);
    color: var(--sb-danger);
    border: 1px solid var(--sb-danger);
    font-size: 13px;
    text-align: center;
}

.sb-ai-msg-escalation {
    align-self: stretch;
    /* Day 16c — softer card surface so the WhatsApp button stands out,
       reduces "wall of green" feel on mobile */
    background: #f0f7f4;
    color: #1a3a2a;
    border: 2px solid #25D366;
    border-radius: 14px;
    padding: 16px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.sb-ai-escalation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 15px;
}

.sb-ai-escalation-icon {
    font-size: 20px;
}

.sb-ai-msg-escalation p {
    margin: 6px 0;
    color: rgba(26, 58, 42, 0.95);
}

.sb-ai-escalation-number {
    background: rgba(37, 211, 102, 0.1);
    padding: 6px 10px;
    border-radius: 8px;
    font-family: monospace;
    color: #075E54;
}

.sb-ai-escalation-cta {
    display: inline-block;
    margin-top: 10px;
    background: #fff;
    color: #128C7E;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.sb-ai-escalation-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Day 10 — collect-info-first flow */
.sb-ai-escalation-collect {
    margin-top: 10px;
    margin-bottom: 6px;
    color: rgba(26, 58, 42, 0.85);
    font-size: 13px;
}

.sb-ai-escalation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.sb-ai-escalation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
    font-family: inherit;
    line-height: 1.2;
}

.sb-ai-escalation-btn-primary {
    background: #fff;
    color: #1a3a2a;
    border: 1px solid #1a3a2a;
}

.sb-ai-escalation-btn-secondary {
    background: rgba(37, 211, 102, 0.1);
    color: #075E54;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

/* Day 11b — tertiary button (less prominent, for copy-link fallback) */
.sb-ai-escalation-btn-tertiary,
.sb-ai-escalation-btn-copy {
    background: transparent;
    color: #075E54;
    border: 1px dashed #075E54;
    font-size: 13px;
    padding: 8px 12px;
}

/* Day 16d — WhatsApp primary button (the one CTA that matters) */
.sb-ai-escalation-btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 18px;
}

.sb-ai-escalation-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sb-ai-escalation-btn:active {
    transform: translateY(0);
}

.sb-ai-escalation-form {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-ai-escalation-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.sb-ai-escalation-form input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    font-size: 14px;
    font-family: inherit;
}

.sb-ai-escalation-form input:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.sb-ai-escalation-form input.sb-ai-input-error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.sb-ai-escalation-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.sb-ai-escalation-form-actions .sb-ai-escalation-btn {
    flex: 1;
}

.sb-ai-escalation-preview {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
}

.sb-ai-escalation-preview summary {
    cursor: pointer;
    user-select: none;
    color: rgba(255, 255, 255, 0.9);
}

.sb-ai-escalation-preview pre {
    margin: 6px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: rgba(255, 255, 255, 0.95);
}

.sb-ai-escalation-intent {
    display: block;
    margin-top: 8px;
    opacity: 0.75;
    font-size: 11px;
}

/* Day 16 — Mobile-responsive escalation buttons.
   On small screens, stack buttons vertically and make them full-width for
   easier thumb tapping. WhatsApp link (primary action) gets bigger touch target. */
@media (max-width: 640px) {
    .sb-ai-escalation-actions {
        flex-direction: column;
        gap: 10px;
    }
    .sb-ai-escalation-btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 15px;
        min-height: 48px;  /* iOS HIG recommended touch target */
    }
    .sb-ai-escalation-btn-whatsapp {
        /* WhatsApp primary action — already brand green above; just confirm stacking */
        font-size: 16px;
        font-weight: 700;
    }
    .sb-ai-escalation-btn-copy {
        font-size: 13px;
        padding: 10px;
        color: #075E54;
        border-color: #075E54;
    }
    .sb-ai-escalation-preview pre {
        font-size: 11px;
        max-height: 120px;
        overflow-y: auto;
    }
}

.sb-ai-msg-assistant a {
    color: var(--sb-primary);
    text-decoration: underline;
}

.sb-ai-typing {
    align-self: flex-start;
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    padding: 12px 16px;
    border-radius: 14px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.sb-ai-typing span {
    width: 8px;
    height: 8px;
    background: var(--sb-text-muted);
    border-radius: 50%;
    animation: sb-ai-typing 1.4s ease-in-out infinite;
}

.sb-ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.sb-ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes sb-ai-typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

.sb-ai-welcome {
    text-align: center;
    padding: 32px 16px;
    color: var(--sb-text-muted);
}

.sb-ai-returning-banner {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1px solid #F59E0B;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: #92400E;
    text-align: left;
}

.sb-ai-returning-text {
    flex: 1;
    line-height: 1.4;
}

.sb-ai-forget-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #F59E0B;
    color: #92400E;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.sb-ai-forget-btn:hover {
    background: #FFFFFF;
    border-color: #D97706;
}

.sb-ai-welcome-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.sb-ai-welcome-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-text);
    margin: 0 0 8px 0;
}

.sb-ai-welcome-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.sb-ai-suggestion {
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--sb-text);
    font-family: inherit;
}

.sb-ai-suggestion:hover {
    border-color: var(--sb-primary);
    color: var(--sb-primary);
}

.sb-ai-footer {
    border-top: 1px solid var(--sb-border);
    padding: 12px 16px;
    background: var(--sb-card);
    flex-shrink: 0;
}

.sb-ai-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.sb-ai-input {
    flex: 1;
    border: 1px solid var(--sb-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    font-family: var(--sb-font);
    resize: none;
    max-height: 100px;
    min-height: 36px;
    line-height: 1.4;
    outline: none;
    color: var(--sb-text);
    background: var(--sb-bg);
}

.sb-ai-input:focus {
    border-color: var(--sb-primary);
    background: var(--sb-card);
}

.sb-ai-send {
    background: var(--sb-primary);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.sb-ai-send:hover:not(:disabled) {
    background: var(--sb-primary-dark);
}

.sb-ai-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sb-ai-disclaimer {
    text-align: center;
    font-size: 11px;
    color: var(--sb-text-muted);
    margin-top: 6px;
}

.sb-ai-disclaimer a {
    color: var(--sb-primary);
    text-decoration: none;
}

/* Mobile: full-screen panel */
@media (max-width: 640px) {
    .sb-ai-panel {
        /* Day 12 — use small viewport height + safe-area-inset.
           Old calc(100vh - 80px) included the iOS Safari / Chrome Android URL bar,
           so panel TOP was hidden behind it when user scrolled or bar collapsed.
           svh = "small viewport" = excludes dynamic browser chrome.
           Fallback chain: svh → dvh → vh for old browsers. */
        width: calc(100vw - 16px);
        height: calc(100svh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        right: 8px;
        top: calc(8px + env(safe-area-inset-top, 0px));
        left: 8px;
        max-width: none;
        max-height: none;
        border-radius: 12px;
    }

    /* Fallback for browsers that don't support svh */
    @supports not (height: 100svh) {
        .sb-ai-panel {
            /* vh includes URL bar so leave 56px headroom for it */
            height: calc(100vh - 88px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
            bottom: calc(16px + env(safe-area-inset-bottom, 0px));
            top: auto;
        }
    }

    .sb-ai-launcher {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: 16px;
    }
}


/* === Phase 4 Day 18/20: Limited Bundle Edition Badge === */
.sb-limited-edition-badge {
    display: inline-block;
    padding: 6px 12px;
    margin: 8px 0;
    border-radius: 6px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
}
.sb-limited-edition-badge[data-limited-status="ended"],
.sb-limited-edition-badge[data-limited-status="sold_out"] {
    background: var(--sb-text-muted, #888);
    color: white;
}

/* === Limited Edition Progress Bar === */
.sb-limited-progress {
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}
.sb-limited-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.sb-limited-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 0.3s ease;
}
.sb-limited-progress-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-text-primary, #1a1a1a);
}
.sb-limited-countdown {
    margin-top: 6px;
    font-size: 13px;
    color: var(--sb-text-muted, #666);
}
.sb-countdown-text {
    font-family: monospace;
    font-weight: 600;
    color: #FF6A1A;
}

/* Day 44 (D7): Storefront language switcher */
.sb-store-locale-switcher {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--sb-text-muted, #666);
}
.sb-locale-option {
    color: var(--sb-text-muted, #666);
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s ease;
}
.sb-locale-option:hover {
    color: var(--sb-primary, #FF6A1A);
    background: rgba(255, 106, 26, 0.08);
}
.sb-locale-option.sb-locale-active {
    color: var(--sb-primary, #FF6A1A);
    font-weight: 600;
    text-decoration: underline;
}
.sb-locale-sep {
    color: var(--sb-border, #e0e0e0);
    margin: 0 2px;
}

/* Day 47e: Header language switcher (was footer — too hidden) */
.sb-store-header-locale {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sb-border, #e0e0e0);
    white-space: nowrap;
    font-size: 13px;
}
.sb-hdr-locale-option {
    color: var(--sb-text-muted, #666);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.15s ease;
}
.sb-hdr-locale-option:hover {
    color: var(--sb-primary, #FF6A1A);
    background: rgba(255, 106, 26, 0.08);
}
.sb-hdr-locale-option.sb-hdr-locale-active {
    color: var(--sb-primary, #FF6A1A);
    font-weight: 600;
    background: rgba(255, 106, 26, 0.12);
}
.sb-hdr-locale-sep {
    color: var(--sb-border, #e0e0e0);
    margin: 0 1px;
    user-select: none;
}

/* Day 47e (deprecated): Mobile-only compact 36px flag pills.
   Now scoped to .sb-store-header-locale (deleted class, but keep
   rule to preserve any browser-cached CSS state during transition). */
@media (max-width: 640px) {
    .sb-store-header-locale {
        padding: 4px 6px;
        font-size: 12px;
    }
    .sb-store-header-locale .sb-hdr-locale-option {
        padding: 2px 3px;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 36px;
    }
    .sb-store-header-locale .sb-hdr-locale-sep {
        margin: 0;
    }

    /* Day 54c: Dropdown submenu on mobile — full-width options, no clipping */
    .sb-nav-locale-section .sb-hdr-locale-toggle {
        width: 100%;
        min-height: 44px;
        padding: 12px 14px;
        font-size: 15px;
    }
    .sb-hdr-locale-submenu .sb-hdr-locale-option {
        /* Override Day 47e global 36px cap — show full label on mobile */
        max-width: none;
        width: 100%;
        overflow: visible;
        text-overflow: clip;
        min-height: 44px;
        padding: 12px 14px;
    }
}

/* Day 54c: Locale switcher dropdown inside hamburger nav (desktop + mobile) */
.sb-nav-locale-section {
    position: relative;  /* anchor for absolute-positioned submenu */
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--sb-border, #e0e0e0);
}
/* Dropdown toggle button (single visible control) */
.sb-hdr-locale-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 6px;
    background: rgba(40, 20, 70, 0.6);  /* Day 53.16: dark theme */
    border: 1px solid rgba(255, 215, 0, 0.3);  /* Day 53.16: gold border */
    color: var(--sb-text, #f5ebff);       /* Day 53.16: dark text */
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    min-height: 44px;  /* iOS HIG touch target */
    transition: all 0.15s ease;
}
.sb-hdr-locale-toggle:hover {
    background: rgba(255, 215, 0, 0.15);  /* Day 53.16: gold hover */
}
.sb-hdr-locale-toggle[aria-expanded="true"] {
    background: rgba(255, 215, 0, 0.18);  /* Day 53.16: gold active */
    border-color: var(--accent);
}
.sb-hdr-locale-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.sb-hdr-locale-current {
    flex: 1;
    font-weight: 500;
}
.sb-hdr-locale-caret {
    font-size: 12px;
    color: var(--sb-text-muted, #666);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.sb-hdr-locale-toggle[aria-expanded="true"] .sb-hdr-locale-caret {
    transform: rotate(180deg);
}

/* Submenu (collapsed by default) */
.sb-hdr-locale-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, margin-top 0.25s ease;
    /* Day 55 fix-3: z-index above search-suggestions (999) and header (100) */
    z-index: 1000;
    position: relative;
}
.sb-hdr-locale-submenu.sb-open {
    max-height: 200px;  /* fits 3 langs × 44px + padding */
    margin-top: 8px;
}
.sb-hdr-locale-submenu li {
    margin: 0;
    padding: 0;
}
.sb-hdr-locale-submenu .sb-hdr-locale-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    color: var(--sb-text, #f5ebff);   /* Day 53.16: dark theme text */
    text-decoration: none;
    min-height: 44px;  /* iOS HIG touch target */
    transition: background 0.15s ease;
}
.sb-hdr-locale-submenu .sb-hdr-locale-option:hover {
    background: rgba(255, 215, 0, 0.15);   /* Day 53.16: gold hover */
    text-decoration: none;
}
.sb-hdr-locale-submenu .sb-hdr-locale-option.sb-hdr-locale-active {
    background: rgba(255, 215, 0, 0.18);   /* Day 53.16: gold active */
    color: var(--accent);                   /* Day 53.16: gold text */
    font-weight: 600;
}
.sb-hdr-locale-flag {
    font-size: 18px;
    flex-shrink: 0;
}
.sb-hdr-locale-check {
    margin-left: auto;
    color: var(--sb-primary, #FF6A1A);
    font-weight: 700;
}

/* Day 54d: Desktop inline locale toggle (always visible in header row) */
.sb-header-locale {
    position: relative;
}
.sb-hdr-locale-toggle--inline {
    /* Compact variant for desktop header inline position */
    width: auto;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    background: transparent;
    border-color: var(--sb-border, #e0e0e0);
}
.sb-hdr-locale-toggle--inline:hover {
    background: var(--sb-bg-hover, #ebebeb);
}
.sb-hdr-locale-submenu-desktop {
    /* Desktop inline dropdown — pops DOWN below toggle */
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--sb-card);
    border: 1px solid var(--sb-border, #e0e0e0);
    border-radius: 6px;
    box-shadow: var(--sb-shadow-md);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
}
.sb-hdr-locale-submenu-desktop.sb-open {
    max-height: 200px;
    padding: 6px 0;
}

/* Day 48: Search box + search results page */
.sb-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--sb-bg, #fff);
    border: 1px solid var(--sb-border, #e0e0e0);
    border-radius: 8px;
    padding: 0 8px 0 12px;
    transition: all 0.15s ease;
}
.sb-search-box:focus-within {
    border-color: var(--sb-primary, #FF6A1A);
    box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.15);
}
.sb-search-icon {
    color: var(--sb-text-muted, #888);
    margin-right: 6px;
    font-size: 16px;
}
.sb-search-input {
    border: 0;
    outline: 0;
    background: transparent;
    flex: 1;
    padding: 8px 4px;
    font-size: 14px;
    color: var(--sb-text, #222);
    min-width: 0;
}
.sb-search-input::placeholder {
    color: var(--sb-text-muted, #999);
}
.sb-search-submit {
    border: 0;
    background: transparent;
    color: var(--sb-primary, #FF6A1A);
    cursor: pointer;
    padding: 6px 8px;
    font-size: 18px;
    font-weight: 600;
}
.sb-search-submit:hover { color: var(--sb-primary-dark, #cc5512); }

/* Header variant: compact */
.sb-search-box--header {
    min-width: 180px;
    max-width: 320px;
    margin: 0 8px;
}
@media (max-width: 768px) {
    .sb-search-box--header {
        min-width: 0;
        max-width: 140px;
    }
    .sb-search-box--header .sb-search-submit { padding: 4px 6px; }
}
@media (max-width: 480px) {
    .sb-search-box--header { display: none; }  /* Mobile: rely on /search page link */
}

/* Hero variant: large */
.sb-search-box--hero {
    max-width: 600px;
    margin: 0 auto;
    padding: 4px 8px 4px 16px;
    font-size: 18px;
    border-width: 2px;
}
.sb-search-box--hero .sb-search-input { font-size: 18px; padding: 12px 4px; }
.sb-search-box--hero .sb-search-submit {
    background: var(--sb-primary, #FF6A1A);
    color: white;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 16px;
    margin: 4px 0;
}
.sb-search-box--hero .sb-search-submit:hover { background: var(--sb-primary-dark, #cc5512); }

/* Suggestions dropdown */
.sb-search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--sb-bg, #fff);
    border: 1px solid var(--sb-border, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 360px;
    overflow-y: auto;
    z-index: 999;
}
.sb-search-suggestions[hidden] { display: none; }
.sb-sug-section { padding: 4px 0; }
.sb-sug-section + .sb-sug-section { border-top: 1px solid var(--sb-border, #e0e0e0); }
.sb-sug-query, .sb-sug-product {
    display: block;
    padding: 8px 12px;
    color: var(--sb-text, #222);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.1s;
}
.sb-sug-query { color: var(--sb-text-muted, #666); font-size: 13px; }
.sb-sug-query:hover, .sb-sug-product:hover { background: rgba(255, 106, 26, 0.08); color: var(--sb-primary, #FF6A1A); }

/* Search results page */
.sb-search-page { padding: 24px 0 64px; }
.sb-search-page-title { font-size: 28px; margin: 0 0 8px; }
.sb-search-meta { color: var(--sb-text-muted, #666); margin: 0 0 24px; font-size: 14px; }
.sb-search-took { color: var(--sb-text-muted, #888); font-size: 12px; }

.sb-search-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
@media (max-width: 768px) { .sb-search-layout { grid-template-columns: 1fr; } }

.sb-search-filters {
    position: sticky;
    top: 80px;
    align-self: start;
}
.sb-search-filter-form { display: flex; flex-direction: column; gap: 16px; }
.sb-filter-group { display: flex; flex-direction: column; gap: 6px; }
.sb-filter-label { font-weight: 600; font-size: 13px; color: var(--sb-text, #333); }
.sb-filter-select, .sb-filter-input {
    padding: 6px 8px;
    border: 1px solid var(--sb-border, #ddd);
    border-radius: 4px;
    font-size: 14px;
    background: var(--sb-bg, #fff);
    color: var(--sb-text, #333);
}
.sb-filter-price { display: flex; align-items: center; gap: 6px; }
.sb-filter-price input { width: 80px; }
.sb-filter-checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.sb-filter-submit {
    background: var(--sb-primary, #FF6A1A);
    color: white;
    border: 0;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.sb-filter-submit:hover { background: var(--sb-primary-dark, #cc5512); }

.sb-search-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--sb-text-muted, #666);
}
.sb-search-sort-select { padding: 4px 8px; border: 1px solid var(--sb-border, #ddd); border-radius: 4px; }

.sb-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.sb-search-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--sb-text-muted, #888);
}
.sb-search-suggest { margin-top: 8px; font-size: 14px; }
.sb-search-suggest a { color: var(--sb-primary, #FF6A1A); }

.sb-search-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}
.sb-page-link {
    padding: 6px 12px;
    border: 1px solid var(--sb-border, #ddd);
    border-radius: 4px;
    color: var(--sb-text, #333);
    text-decoration: none;
    font-size: 14px;
}
.sb-page-link:hover { background: rgba(255, 106, 26, 0.08); }
.sb-page-link.sb-page-current {
    background: var(--sb-primary, #FF6A1A);
    color: white;
    border-color: var(--sb-primary, #FF6A1A);
}

.sb-product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--sb-bg, #fff);
    border: 1px solid var(--sb-border, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.15s;
}
.sb-product-card:hover {
    border-color: var(--sb-primary, #FF6A1A);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 106, 26, 0.15);
}
.sb-product-image { aspect-ratio: 1/1; background: #f5f5f5; overflow: hidden; }
.sb-product-image img { width: 100%; height: 100%; object-fit: cover; }
.sb-product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}
.sb-product-info { padding: 12px; }
.sb-product-name { font-size: 14px; margin: 0 0 6px; line-height: 1.3; }
.sb-product-price { font-size: 16px; font-weight: 600; color: var(--sb-primary, #FF6A1A); margin: 0; }
.sb-product-price-old { text-decoration: line-through; color: #888; font-weight: 400; margin-left: 4px; font-size: 13px; }
.sb-product-out { display: inline-block; font-size: 12px; color: #888; margin-top: 4px; }

/* ─── Tracking Page (Day 49) ───────────────────────────────── */
.sb-track-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px;
}
.sb-track-form-card {
    margin-bottom: 24px;
}
.sb-track-form .sb-form-group {
    margin-bottom: 16px;
}
.sb-track-error {
    background: #FEE;
    border-left: 4px solid #D33;
}
.sb-track-result {
    padding: 24px;
}
.sb-track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.sb-track-status .sb-badge {
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
}
.sb-badge-shipped   { background: rgba(255, 215, 0, 0.18); color: #B8860B; }
.sb-badge-delivered { background: #E8F5E9; color: #2E7D32; }
.sb-badge-unshipped { background: rgba(40, 20, 70, 0.4); color: #666; }
.sb-track-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 32px 0;
    padding: 20px 0;
    position: relative;
}
.sb-track-step {
    text-align: center;
    padding: 12px 4px;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s;
}
.sb-track-step-completed {
    background: #E8F5E9;
}
.sb-track-step-current {
    background: rgba(255, 215, 0, 0.18);
    border: 2px solid #FFB627;
    transform: scale(1.05);
}
.sb-track-step-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.sb-track-step-label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}
.sb-track-step-time {
    font-size: 11px;
    color: #666;
}
.sb-track-carrier {
    background: #F5F7FA;
    padding: 20px;
    border-radius: 8px;
    margin: 24px 0;
}
.sb-track-updates {
    margin-top: 24px;
}
.sb-track-update-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sb-track-update-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.sb-track-update-list li:last-child {
    border-bottom: 0;
}
.sb-track-update-status {
    font-weight: 600;
    margin-bottom: 4px;
}
.sb-track-update-desc {
    color: #666;
    font-size: 14px;
}
.sb-track-update-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}
@media (max-width: 640px) {
    .sb-track-timeline {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── A/B Test Results Table (Day 50) ────────────────────────── */
.sb-table-results {
    font-size: 14px;
}
.sb-row-winner {
    background: #E8F5E9;
    font-weight: 600;
}
.sb-badge-success {
    background: #2E7D32;
    color: white;
}
.sb-badge-neutral {
    background: #999;
    color: white;
}
.sb-btn-success {
    background: #25D366;
    color: white;
}
.sb-btn-success:hover {
    background: #1DA851;
    color: white;
    text-decoration: none;
}

/* =============================================================
 * Product search form (Day 59-fix-10 + Day 59-fix-11)
 *
 * Day 59-fix-10: Mobile layout — stack input + sort + submit vertically
 *                so they fit narrow viewports.
 * Day 59-fix-11: Desktop layout — wrap input + submit in a group
 *                so they ALWAYS stay together visually (sort in own group).
 *                Pre-fix-10 mobile rules kept at end for regression safety.
 * ============================================================= */
.sb-products-search {
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}
.sb-products-search-query {
    display: flex;
    flex: 1 1 320px;
    min-width: 0;
    gap: 8px;
    align-items: stretch;
}
.sb-products-search-input {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    box-sizing: border-box;
}
.sb-products-search-submit {
    flex: 0 0 auto;
    white-space: nowrap;
}
.sb-products-search-sort {
    padding: 10px 12px;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    min-width: 160px;
    flex: 0 0 auto;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .sb-products-search {
        flex-direction: column;
        align-items: stretch;
    }
    .sb-products-search-query,
    .sb-products-search-input,
    .sb-products-search-sort {
        width: 100%;
        min-width: 0;
    }
    .sb-products-search-query {
        flex: 1 1 auto;
    }
}
@media (max-width: 480px) {
    .sb-products-search {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sb-products-search-query {
        flex: 1 1 0;
        min-width: 0;
    }
    .sb-products-search-sort {
        flex: 0 0 100%;
        order: 3;
    }
}

/* =============================================================
 * Browse-by-categories page (Day 59-fix-11)
 * ============================================================= */
.sb-categories-page { min-height: 60vh; }
.sb-categories-header {
    margin: 24px 0 32px;
}
.sb-categories-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);   /* Day 53.16: gold title for emphasis */
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}
.sb-categories-subtitle {
    margin: 0;
    color: var(--sb-text-muted);
    font-size: 16px;
}
.sb-categories-empty {
    text-align: center;
    padding: 64px 16px;
    color: var(--sb-text-muted);
}
.sb-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.sb-category-card {
    background: var(--sb-card);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.sb-category-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.25), 0 4px 12px rgba(0,0,0,0.4);
}
.sb-category-card-main {
    display: block;
    padding: 24px 16px;
    text-align: center;
    color: inherit;
    text-decoration: none;
}
.sb-category-card-main:hover { text-decoration: none; color: inherit; }
.sb-category-card-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.sb-category-card-name {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-text);
}
.sb-category-card-count {
    margin: 0;
    font-size: 13px;
    color: var(--sb-text-muted);
}
.sb-category-card-children {
    list-style: none;
    margin: 0;
    padding: 0 16px 16px;
    border-top: 1px solid var(--sb-border);
    padding-top: 12px;
}
.sb-category-card-children li { margin: 0; padding: 0; }
.sb-category-card-children a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    color: var(--sb-text);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}
.sb-category-card-children a:hover {
    background: var(--sb-bg-hover, #ebebeb);
    text-decoration: none;
}
.sb-category-card-sub-count {
    font-size: 12px;
    color: var(--sb-text-muted);
    background: var(--sb-bg, #fafafa);
    padding: 2px 8px;
    border-radius: 10px;
}
@media (max-width: 480px) {
    .sb-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .sb-categories-title { font-size: 22px; }
    .sb-category-card-main { padding: 16px 8px; }
    .sb-category-card-icon { font-size: 28px; }
}
