:root {
    --primary: #ff4757;
    --primary-light: #ff6b81;
    --secondary: #2ed573;
    --bg-color: #f7f8fa;
    --text-main: #2f3542;
    --text-muted: #747d8c;
    --white: #ffffff;
    --border: #f1f2f6;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    
    /* Header Contrast Variables */
    --header-loc-bg: var(--primary, #ef4444);
    --header-loc-shadow: color-mix(in srgb, var(--primary, #ef4444) 35%, transparent);
    --header-auth-bg: #e2e8f0;
    --header-auth-color: #64748b;
    --header-cart-bg: linear-gradient(135deg, #f97316, #ea580c);
    --header-cart-shadow: rgba(249,115,22,0.3);
    --header-cart-badge-bg: #ffffff;
    --header-cart-badge-color: #f97316;
    --header-cart-badge-border: #f97316;
    --header-search-bg: #f1f5f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; -webkit-tap-highlight-color: transparent; }

body { background: var(--bg-color, #f7f8fa); color: var(--text-main); overflow: hidden; margin: 0; padding: 0; width: 100%; height: 100vh; height: 100dvh; }

/* App Container (Edge-to-Edge Fluid Layout) */
.app-container { width: 100%; max-width: 100%; margin: 0; height: 100vh; height: 100dvh; background: var(--bg-color); position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: none; border: none; }

/* Header */
.app-header { background: var(--white); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
.location-selector { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.location-icon { width: 35px; height: 35px; background: rgba(255, 71, 87, 0.1); color: var(--primary); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 16px; }
.location-info .label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.location-info h3 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.location-info h3 i { font-size: 12px; color: var(--primary); }
.icon-btn { background: transparent; border: none; font-size: 20px; color: var(--text-main); position: relative; cursor: pointer; }
.cart-badge { position: absolute; top: -5px; right: -8px; background: var(--primary); color: var(--white); font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 2px solid var(--white); }

/* Main Content */
.app-main { flex: 1; overflow-y: auto; padding-bottom: calc(88px + env(safe-area-inset-bottom)); width: 100%; }

/* Search */
.search-container { padding: 15px 20px; }
.search-box { background: var(--white); border-radius: 12px; display: flex; align-items: center; padding: 12px 15px; box-shadow: var(--shadow); }
.search-box i { color: var(--text-muted); margin-right: 10px; }
.search-box input { border: none; outline: none; width: 100%; font-size: 14px; font-weight: 500; background: transparent; }

/* Promo Banner */
.promo-banner { margin: 0 20px 20px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 16px; padding: 20px; color: var(--white); display: flex; justify-content: space-between; align-items: center; position: relative; overflow: hidden; box-shadow: 0 10px 20px rgba(255, 71, 87, 0.3); }
.promo-content h2 { font-size: 18px; font-weight: 800; margin-bottom: 5px; }
.promo-content p { font-size: 13px; font-weight: 500; opacity: 0.9; }
.promo-img { width: 80px; height: 80px; object-fit: contain; border-radius: 10px; }

/* Categories */
.categories-section { padding: 0 0 20px 20px; }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 15px; padding-right: 20px; }
.categories-slider { display: flex; gap: 15px; overflow-x: auto; padding-right: 20px; scrollbar-width: none; padding-bottom: 10px; }
.categories-slider::-webkit-scrollbar { display: none; }
.category-card { min-width: 85px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.category-img { width: 65px; height: 65px; background: var(--white); border-radius: 20px; padding: 10px; box-shadow: var(--shadow); display: flex; justify-content: center; align-items: center; transition: transform 0.2s; }
.category-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.category-card:active .category-img { transform: scale(0.95); }
.category-card span { font-size: 12px; font-weight: 600; text-align: center; }

/* Products Grid */
.products-section { padding: 0 20px 20px; }
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.product-card { background: var(--white); border-radius: 16px; padding: 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; }
.product-img { width: 100%; height: 120px; object-fit: contain; margin-bottom: 15px; border-radius: 10px; }
.product-price { font-size: 16px; font-weight: 800; color: var(--primary); margin-bottom: 5px; }
.product-title { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-stock { font-size: 11px; color: var(--text-muted); margin-bottom: 15px; }
.btn-add { background: var(--bg-color); color: var(--primary); border: none; padding: 8px; border-radius: 10px; font-weight: 700; cursor: pointer; transition: all 0.2s; display: flex; justify-content: center; align-items: center; font-size: 14px; }
.btn-add:active { background: var(--primary); color: var(--white); }

/* Responsive adjustments for PC/Tablet to look professional */
@media (min-width: 768px) {
    .search-container { max-width: 700px; margin: 15px auto; padding: 0; }
    .promo-banner { max-width: 1200px; margin: 0 auto 20px; }
    .categories-section { padding: 20px 0; max-width: 1200px; margin: 0 auto; }
    .categories-slider { flex-wrap: wrap; overflow-x: visible; padding-right: 0; gap: 25px; }
    .category-card { min-width: 100px; }
    .category-img { width: 80px; height: 80px; }
    .section-title { font-size: 22px; margin-bottom: 25px; }
    
    /* Align frontend builder blocks exactly like product grid */
    .pb-section > div { max-width: 1200px; margin: 0 auto; }
    .pb-section .section-title { max-width: 1200px; margin: 0 auto 25px; }
}

/* Bottom Nav - Floating Capsule */
.bottom-nav {
    position: fixed;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    right: 14px;
    max-width: 440px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    height: 64px;
    box-sizing: border-box;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-gallery img { pointer-events: none; -webkit-touch-callout: none; user-select: none; -webkit-user-drag: none; }
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 4px 0;
}
.nav-item i {
    font-size: 18px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease;
}
.nav-item.active {
    color: var(--primary, #ff4757);
}
.nav-item.active i {
    transform: scale(1.15) translateY(-1px);
    color: var(--primary, #ff4757);
}
.nav-item:active i {
    transform: scale(0.9);
}

/* Central Elevated Cart Circle */
.nav-center-item-wrap {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
}
.nav-center-cart-btn {
    position: absolute;
    top: -28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--nav-cart-btn-bg, var(--primary, #ff4757));
    background: linear-gradient(135deg, var(--nav-cart-btn-bg, var(--primary, #ff4757)) 0%, color-mix(in srgb, var(--nav-cart-btn-bg, var(--primary, #ff4757)) 82%, #000) 100%);
    color: #ffffff;
    border: 4px solid var(--nav-cart-btn-border, #ffffff);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--nav-cart-btn-bg, var(--primary, #ff4757)) 42%, transparent), 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease, background 0.3s ease, border-color 0.3s ease;
    z-index: 10;
}
:root.dark-mode .nav-center-cart-btn,
body.dark-mode .nav-center-cart-btn {
    background: var(--nav-cart-btn-bg, var(--primary, #ff4757));
    background: linear-gradient(135deg, var(--nav-cart-btn-bg, var(--primary, #ff4757)) 0%, color-mix(in srgb, var(--nav-cart-btn-bg, var(--primary, #ff4757)) 78%, #000) 100%);
    border-color: var(--nav-cart-btn-border, #141416);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--nav-cart-btn-bg, var(--primary, #ff4757)) 45%, transparent), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.nav-center-cart-btn:hover {
    transform: translateY(-2px) scale(1.05);
}
.nav-center-cart-btn:active {
    transform: translateY(2px) scale(0.94);
}
.nav-center-cart-btn i {
    font-size: 21px;
    color: #ffffff;
}
.nav-center-cart-btn .cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fbbf24;
    color: #78350f;
    font-size: 11px;
    font-weight: 900;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.3s ease;
}
:root.dark-mode .nav-center-cart-btn .cart-badge,
body.dark-mode .nav-center-cart-btn .cart-badge {
    border-color: #141416;
}
.nav-center-label {
    margin-top: 31px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    transition: color 0.2s ease;
}
@keyframes navCartBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.22); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}
.nav-center-cart-btn.bounce {
    animation: navCartBounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.nav-icon-wrapper { position: relative; }

/* ============================================
   GAMES & REWARDS SPA VIEW STYLES
   ============================================ */
.games-spa-view {
    width: 100%;
    min-height: 100vh;
    background: #f8fafc;
    flex-direction: column;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
body.dark-mode .games-spa-view,
body.dark-mode #gamesSpaView {
    background: #09090b !important;
    color: #f8fafc !important;
}
.games-header-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
body.dark-mode .games-header-bar {
    background: rgba(14, 14, 18, 0.95) !important;
    border-bottom-color: #27272a !important;
}
.games-header-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}
.games-back-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-main, #0f172a);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.games-back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}
body.dark-mode .games-back-btn {
    color: #f4f4f5 !important;
}
body.dark-mode .games-back-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}
body.dark-mode .games-header-title-box h3 {
    color: #f4f4f5 !important;
}
body.dark-mode .games-header-title-box p {
    color: #a1a1aa !important;
}

/* Tabs */
.games-segment-tabs {
    display: flex;
    background: #e2e8f0;
    border-radius: 30px;
    padding: 4px;
    margin: 16px 20px 12px;
    gap: 4px;
}
body.dark-mode .games-segment-tabs {
    background: #18181b !important;
    border: 1px solid #27272a !important;
}
.games-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}
body.dark-mode .games-tab-btn {
    color: #a1a1aa !important;
}
.games-tab-btn.active {
    background: #ffffff;
    color: var(--primary, #ff4757);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
body.dark-mode .games-tab-btn.active {
    background: #27272a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

/* Game Card */
.game-entry-card {
    border-radius: 22px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 16px;
}
.game-entry-card:active {
    transform: scale(0.98);
}
body.dark-mode .game-entry-card {
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

/* Wallet Card */
.games-wallet-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 18px 20px;
    color: #fff;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid transparent;
}
body.dark-mode .games-wallet-card {
    background: linear-gradient(135deg, #18181b 0%, #0f172a 100%) !important;
    border: 1px solid #27272a !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5) !important;
}
body.dark-mode .games-section-heading {
    color: #f4f4f5 !important;
}
body.dark-mode #rewardsTotalCountBadge {
    color: #a1a1aa !important;
}

/* Empty State Card in Rewards */
.rewards-empty-state-card {
    text-align: center;
    padding: 34px 20px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}
body.dark-mode .rewards-empty-state-card {
    background: #141416 !important;
    border: 1px solid #27272a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}
.rewards-empty-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.rewards-empty-title {
    margin: 0 0 6px 0;
    font-size: 16.5px;
    font-weight: 800;
    color: var(--text-main, #0f172a);
}
body.dark-mode .rewards-empty-title {
    color: #f4f4f5 !important;
}
.rewards-empty-desc {
    margin: 0 0 18px 0;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.45;
}
body.dark-mode .rewards-empty-desc {
    color: #a1a1aa !important;
}
.rewards-action-btn-primary {
    padding: 11px 26px;
    border-radius: 22px;
    border: none;
    background: var(--primary, #ff4757);
    color: #ffffff;
    font-weight: 800;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 71, 87, 0.35);
    transition: transform 0.15s ease;
}
.rewards-action-btn-primary:active {
    transform: scale(0.97);
}

/* Rewards Voucher Card */
.reward-voucher-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1.5px dashed #cbd5e1;
    padding: 16px 18px;
    margin-bottom: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}
body.dark-mode .reward-voucher-card {
    background: #141416 !important;
    border: 1.5px dashed #27272a !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
}
.reward-voucher-title {
    color: var(--text-main, #0f172a);
}
body.dark-mode .reward-voucher-title {
    color: #f4f4f5 !important;
}
.reward-voucher-desc {
    color: #64748b;
}
body.dark-mode .reward-voucher-desc {
    color: #a1a1aa !important;
}
.reward-voucher-date {
    color: #94a3b8;
}
body.dark-mode .reward-voucher-date {
    color: #71717a !important;
}
.reward-voucher-code-box {
    background: #f1f5f9;
    border: 1.5px dashed #94a3b8;
    padding: 6px 12px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
body.dark-mode .reward-voucher-code-box {
    background: #1e1e24 !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}
.reward-btn-copy {
    flex: 1;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}
body.dark-mode .reward-btn-copy {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #f4f4f5 !important;
}
body.dark-mode .reward-btn-copy:hover {
    background: #3f3f46 !important;
}
.reward-btn-apply {
    flex: 1.2;
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary, #ff4757), #e11d48);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

/* Bottom Sheet Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100000; display: flex; flex-direction: column; justify-content: flex-end; opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; visibility: visible; }
.bottom-sheet { background: var(--white); width: 100%; border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; max-height: 85vh; }
.modal-overlay.active .bottom-sheet { transform: translateY(0); }
.bottom-sheet.full-height { height: 85vh; }
.sheet-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.sheet-header h3 { font-size: 18px; font-weight: 700; }
.close-sheet { background: rgba(0,0,0,0.05); border: none; width: 30px; height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 14px; cursor: pointer; }
.sheet-body { padding: 20px; overflow-y: auto; }

/* Store List */
.store-list { list-style: none; }
.store-list li { padding: 15px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: all 0.2s; }
.store-list li.active { border-color: var(--primary); background: rgba(255, 71, 87, 0.05); }
.store-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.store-info p { font-size: 12px; color: var(--text-muted); }

/* Cart */
.cart-body { display: flex; flex-direction: column; height: 100%; padding: 0; }
.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; gap: 15px; margin-bottom: 20px; }
.cart-item-img { width: 60px; height: 60px; border-radius: 10px; object-fit: contain; background: var(--bg-color); padding: 5px; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.cart-item-info .price { font-size: 14px; font-weight: 700; color: var(--primary); }
.qty-controls { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.qty-btn { width: 25px; height: 25px; border-radius: 50%; border: none; background: var(--bg-color); font-weight: 700; display: flex; justify-content: center; align-items: center; cursor: pointer; }
.cart-summary { padding: 20px; border-top: 1px solid var(--border); background: var(--white); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; color: var(--text-muted); font-weight: 500; }
.summary-row.total { font-size: 18px; color: var(--text-main); font-weight: 800; margin-bottom: 20px; }
.btn-checkout { width: 100%; padding: 16px; background: var(--primary); color: var(--white); border: none; border-radius: 16px; font-size: 16px; font-weight: 700; cursor: pointer; }

/* Product Widget Improvements */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.pb-product-card img:not(.hover-img) {
    background-color: #f5f5f5;
}

.pb-product-card img {
    transition: opacity 0.3s ease;
}

.pb-product-card:hover .hover-img {
    opacity: 1 !important;
}

/* Category Widget Improvements */
.cat-card-stagger {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.cat-card-stagger.visible {
    opacity: 1;
    transform: translateY(0);
}

.cat-skeleton-img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.cat-skeleton-img.loaded {
    animation: none;
    background: transparent;
}

/* =========================================
   APP WIDGETS (Stories & Flash Sale)
========================================= */

/* --- Stories Bubbles --- */
.story-scroller {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 0 20px 15px;
    scrollbar-width: none;
}
.story-scroller::-webkit-scrollbar { display: none; }

.story-bubble-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-width: 72px;
    transition: transform 0.2s;
}
.story-bubble-wrap:active { transform: scale(0.95); }

.story-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    position: relative;
    box-sizing: border-box;
}
.story-ring.viewed { background: #e0e0e0; }

.story-ring img, .story-ring video {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid #fff;
    box-sizing: border-box;
}

.story-title {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-align: center;
    max-width: 72px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Story Fullscreen Viewer --- */
.story-viewer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #111;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s;
}
.story-viewer-overlay.active { opacity: 1; }

.story-progress-container {
    position: absolute;
    top: 15px; left: 10px; right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}
.story-progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
}

.story-header {
    position: absolute;
    top: 30px; left: 15px; right: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    color: #fff;
}
.story-header-info { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.story-header-info img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5); }
.story-close-btn { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

.story-media-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.story-media-container img, .story-media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-touch-zones {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 80px;
    display: flex;
    z-index: 5;
}
.story-zone-prev { flex: 0.3; }
.story-zone-next { flex: 0.7; }

/* Action Button at bottom */
.story-action-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    color: #000;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    animation: bounceBtn 2s infinite;
}
.story-action-btn:active { transform: translateX(-50%) scale(0.95); }
@keyframes bounceBtn { 0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);} 40% {transform: translateX(-50%) translateY(-10px);} 60% {transform: translateX(-50%) translateY(-5px);} }

/* --- Flash Sale Redesign (PC & Mobile) --- */
.flash-slider-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 20px 24px;
    justify-content: flex-start;
    align-items: stretch;
    box-sizing: border-box;
    width: 100%;
}

.flash-sale-wrap {
    border-radius: 20px;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color, #f1f5f9);
    display: flex;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.flash-sale-wrap:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(255, 71, 87, 0.35);
}

/* Grid Card (PC Multi-column / Vertical layout) */
.flash-sale-wrap.is-grid-card {
    flex-direction: column;
}

.flash-sale-wrap.is-grid-card .flash-sale-img {
    width: 100%;
    height: 210px;
    position: relative;
    overflow: hidden;
    background: #0f172a;
}

.flash-sale-wrap.is-grid-card .flash-sale-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.flash-sale-wrap.is-grid-card:hover .flash-sale-img img {
    transform: scale(1.06);
}

.flash-sale-wrap.is-grid-card .flash-sale-content {
    width: 100%;
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex: 1;
}

/* Hero Card (PC Single Column / Wide Horizontal Deal) */
.flash-sale-wrap.is-hero-card {
    flex-direction: row;
    width: 100%;
}

.flash-sale-wrap.is-hero-card .flash-sale-img {
    width: 44%;
    min-height: 250px;
    position: relative;
    overflow: hidden;
    background: #0f172a;
}

.flash-sale-wrap.is-hero-card .flash-sale-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.flash-sale-wrap.is-hero-card:hover .flash-sale-img img {
    transform: scale(1.05);
}

.flash-sale-wrap.is-hero-card .flash-sale-content {
    width: 56%;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* Badges on image */
.flash-sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
    z-index: 2;
}

.flash-sale-stock-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: #fde047;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
}

/* Content Elements */
.flash-sale-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.flash-sale-tag {
    font-size: 10px;
    font-weight: 800;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.flash-sale-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    margin: 0 0 10px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flash-sale-prices {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.flash-sale-price-new {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary, #ff4757);
    letter-spacing: -0.5px;
}

.flash-sale-price-old {
    font-size: 13.5px;
    color: var(--text-muted, #94a3b8);
    text-decoration: line-through;
    font-weight: 500;
}

.flash-sale-save-badge {
    font-size: 11px;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 6px;
}

/* Modern Timer Capsule */
.flash-timer-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    background: var(--input-bg, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 8px 14px;
    border-radius: 12px;
    width: fit-content;
}

.flash-timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 28px;
}

.flash-timer-item {
    font-weight: 900;
    font-size: 15px;
    color: var(--text-main, #0f172a);
    line-height: 1;
}

.flash-timer-lbl {
    font-size: 8.5px;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.flash-timer-colon {
    font-weight: 900;
    font-size: 14px;
    color: var(--primary, #ff4757);
    margin: 0 1px;
    animation: flashPulse 1s infinite;
}

@keyframes flashPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.flash-timer-ended {
    font-size: 12px;
    font-weight: 800;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Stock meter */
.flash-stock-wrap {
    margin-top: auto;
    margin-bottom: 14px;
}

.flash-stock-text {
    font-size: 11.5px;
    color: var(--text-main, #334155);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.flash-stock-bar-bg {
    width: 100%;
    height: 7px;
    background: var(--border-color, #e2e8f0);
    border-radius: 999px;
    overflow: hidden;
}

.flash-stock-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff4757, #ff793f);
    transition: width 0.5s ease;
}

/* Action CTA Button */
.flash-sale-cta-btn {
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(255, 71, 87, 0.3);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.flash-sale-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 71, 87, 0.45);
    filter: brightness(1.06);
}

/* Dark Mode Overrides for Flash Sale */
body.dark-mode .flash-sale-wrap {
    background: #181822;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.dark-mode .flash-sale-wrap:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 71, 87, 0.4);
}

body.dark-mode .flash-sale-title {
    color: #ffffff;
}

body.dark-mode .flash-timer-box {
    background: #111116;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .flash-timer-item {
    color: #ffffff;
}

body.dark-mode .flash-timer-lbl {
    color: #94a3b8;
}

body.dark-mode .flash-stock-text {
    color: #cbd5e1;
}

body.dark-mode .flash-stock-bar-bg {
    background: rgba(255, 255, 255, 0.08);
}

/* Mobile responsive fallback */
@media (max-width: 640px) {
    .flash-sale-wrap.is-hero-card {
        flex-direction: column;
    }
    .flash-sale-wrap.is-hero-card .flash-sale-img {
        width: 100%;
        height: 190px;
    }
    .flash-sale-wrap.is-hero-card .flash-sale-content {
        width: 100%;
        padding: 16px;
    }
}

/* =========================================
   MENÚ DEL DÍA - WIDGET GASTRONÓMICO MODERNO
========================================= */
.menu-banner-widget {
    margin: 0 auto;
    max-width: 1200px;
    padding: 10px 20px 24px;
    box-sizing: border-box;
    width: 100%;
}

.menu-banner-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 175px;
    box-sizing: border-box;
}

.menu-banner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
}

/* Preset Themes */
.menu-banner-card.theme-sunset {
    background: linear-gradient(135deg, #d35400 0%, #e67e22 50%, #f39c12 100%);
    color: #ffffff;
}

.menu-banner-card.theme-dark_gold {
    background: linear-gradient(135deg, #14151a 0%, #1e2029 60%, #2b2314 100%);
    border-color: rgba(245, 158, 11, 0.35);
    color: #f8fafc;
}

.menu-banner-card.theme-dark_gold .menu-banner-tag {
    color: #facc15;
}

.menu-banner-card.theme-emerald {
    background: linear-gradient(135deg, #065f46 0%, #059669 50%, #10b981 100%);
    color: #ffffff;
}

/* Background image overlay */
.menu-banner-bg-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.menu-banner-card.has-bg-img::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(15, 17, 23, 0.92) 0%, rgba(15, 17, 23, 0.82) 55%, rgba(15, 17, 23, 0.5) 100%);
    z-index: 1;
}

/* Left Content Area */
.menu-banner-left {
    position: relative;
    z-index: 2;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Live Schedule Status Pill */
.menu-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;
    margin-bottom: 2px;
}

.menu-status-pill.is-open {
    background: rgba(34, 197, 94, 0.22);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.45);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.25);
}

.menu-status-pill.is-closed {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.45);
}

.menu-pulse-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #4ade80;
    animation: menuPulse 1.8s infinite;
}

@keyframes menuPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
}

.menu-banner-tag {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.95;
}

.menu-banner-title {
    font-size: 26px;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: inherit;
}

.menu-banner-subtitle {
    font-size: 14px;
    margin: 0;
    opacity: 0.92;
    font-weight: 500;
    line-height: 1.4;
    color: inherit;
}

/* Feature Chips */
.menu-pills-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.menu-feature-chip {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 4px 11px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
}

.menu-hours-chip {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 4px 11px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
}

.menu-price-chip {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    padding: 4px 11px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Right Visual Area */
.menu-banner-right {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.menu-dish-disc {
    width: 115px;
    height: 115px;
    border-radius: 50%;
    overflow: hidden;
    border: 3.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    background: #0f172a;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-banner-card:hover .menu-dish-disc {
    transform: scale(1.08) rotate(3deg);
}

.menu-dish-disc img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-chef-badge {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.menu-chef-badge i {
    font-size: 34px;
}

/* Action Button Inside Banner */
.menu-action-pill {
    padding: 13px 24px;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 13.5px;
    font-weight: 800;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.menu-banner-card:hover .menu-action-pill {
    transform: translateX(4px);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}

.menu-action-pill.is-closed {
    background: rgba(255, 255, 255, 0.9);
    color: #475569;
}

/* Dark mode overrides */
body.dark-mode .menu-banner-card {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .menu-banner-card {
        padding: 22px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        border-radius: 20px;
    }
    .menu-banner-title {
        font-size: 21px;
    }
    .menu-banner-subtitle {
        font-size: 13px;
    }
    .menu-banner-right {
        width: 100%;
        justify-content: space-between;
    }
    .menu-dish-disc {
        width: 75px;
        height: 75px;
    }
    .menu-chef-badge {
        width: 65px;
        height: 65px;
    }
    .menu-chef-badge i {
        font-size: 24px;
    }
    .menu-action-pill {
        flex: 1;
        justify-content: center;
        padding: 12px 18px;
        font-size: 13px;
    }
}

/* --- RESPONSIVE LAYOUT (PC & TABLET) --- */
.top-header { display: none; }

.ajax-search-results { 
    display: none; 
    position: absolute; 
    top: calc(100% + 5px); 
    left: 0; right: 0; 
    background: #fff; 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    z-index: 1000; 
    max-height: 400px; 
    overflow-y: auto; 
    border: 1px solid #f1f5f9;
}
.search-container { position: relative; }
.th-search { position: relative; }

.ajax-item { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    padding: 12px 15px; 
    border-bottom: 1px solid #f1f5f9; 
    cursor: pointer; 
    text-decoration: none; 
    color: #333; 
    transition: background 0.2s;
}
.ajax-item:last-child { border-bottom: none; }
.ajax-item:hover { background: #f8fafc; }
.ajax-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
.ajax-item-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ajax-item-info h4 { margin: 0; font-size: 14px; font-weight: 600; color: #1e293b; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ajax-item-info p { margin: 0; font-size: 13px; color: #e74c3c; font-weight: 800; }

.login-modal-box { 
    background: #fff; 
    width: 90%; 
    max-width: 420px; 
    margin: auto; 
    border-radius: 24px; 
    position: relative; 
    padding: 30px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.close-login { 
    position: absolute; top: 20px; right: 20px; 
    background: #f1f5f9; border: none; width: 36px; height: 36px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    cursor: pointer; color: #64748b; transition: all 0.2s; 
}
.close-login:hover { background: #e2e8f0; color: #0f172a; }

.login-header h3 { margin: 0 0 8px; font-size: 24px; font-weight: 800; color: #0f172a; }
.login-header p { margin: 0 0 25px; font-size: 14px; color: #64748b; line-height: 1.5; }

.product-modal-box {
    background: #fff;
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 800px;
    margin: auto;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.close-product {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.close-product:hover {
    background: #fff;
    transform: scale(1.1);
}

/* ========================================================
   UNIVERSAL SPA HEADER & VIEWS (MOBILE & DESKTOP)
   ======================================================== */
.spa-view { 
    background: var(--bg-color, #f8fafc); 
    position: relative; 
    width: 100%;
}
#productSpaView, #categorySpaView, #menuSpaView {
    width: 100% !important;
    min-width: 100% !important;
}
#productIframe, #categoryIframe, #menuIframe {
    width: 100% !important;
    min-width: 100% !important;
    border: none !important;
    display: block !important;
}

.spa-header { 
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    min-height: 52px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.spa-header:hover {
    background: rgba(248, 250, 252, 0.98);
}
.spa-header:active {
    background: rgba(241, 245, 249, 0.98);
}
.spa-back-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary, #ff4757) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary, #ff4757) 18%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary, #ff4757);
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.spa-header:hover .spa-back-circle {
    background: var(--primary, #ff4757);
    color: #ffffff;
    transform: translateX(-2px);
}
.spa-header:active .spa-back-circle {
    transform: scale(0.92);
}
.spa-title-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.spa-header .spa-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.25px;
    line-height: 1.2;
}
.spa-header .spa-subtitle {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}
html.dark-mode .spa-view,
body.dark-mode .spa-view { 
    background: #000000; 
}
html.dark-mode .spa-header,
body.dark-mode .spa-header {
    background: rgba(14, 14, 18, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
html.dark-mode .spa-header:hover,
body.dark-mode .spa-header:hover { 
    background: rgba(22, 22, 28, 0.98); 
}
html.dark-mode .spa-header:active,
body.dark-mode .spa-header:active { 
    background: rgba(28, 28, 36, 0.98); 
}
html.dark-mode .spa-header .spa-title,
body.dark-mode .spa-header .spa-title { 
    color: #f8fafc; 
}
html.dark-mode .spa-header .spa-subtitle,
body.dark-mode .spa-header .spa-subtitle { 
    color: #94a3b8; 
}
html.dark-mode .spa-back-circle,
body.dark-mode .spa-back-circle {
    background: color-mix(in srgb, var(--primary, #ff4757) 20%, transparent);
    border-color: color-mix(in srgb, var(--primary, #ff4757) 32%, transparent);
    color: #ffffff;
}

/* Hide mobile bottom navbar & remove bottom padding when product/category/menu view is open */
body.product-modal-open #bottomNavCapsule,
body.product-modal-open .bottom-nav,
body:has(#productSpaView[style*="display: flex"]) #bottomNavCapsule,
body:has(#productSpaView[style*="display:flex"]) #bottomNavCapsule,
body:has(#productSpaView:not([style*="display: none"]):not([style*="display:none"])) #bottomNavCapsule,
body:has(#productSpaView[style*="display: flex"]) .bottom-nav,
body:has(#productSpaView[style*="display:flex"]) .bottom-nav,
body:has(#productSpaView:not([style*="display: none"]):not([style*="display:none"])) .bottom-nav,
body:has(#categorySpaView[style*="display: flex"]) #bottomNavCapsule,
body:has(#categorySpaView[style*="display:flex"]) #bottomNavCapsule,
body:has(#categorySpaView:not([style*="display: none"]):not([style*="display:none"])) #bottomNavCapsule,
body:has(#categorySpaView[style*="display: flex"]) .bottom-nav,
body:has(#categorySpaView[style*="display:flex"]) .bottom-nav,
body:has(#categorySpaView:not([style*="display: none"]):not([style*="display:none"])) .bottom-nav,
body:has(#menuSpaView[style*="display: flex"]) #bottomNavCapsule,
body:has(#menuSpaView[style*="display:flex"]) #bottomNavCapsule,
body:has(#menuSpaView:not([style*="display: none"]):not([style*="display:none"])) #bottomNavCapsule,
body:has(#menuSpaView[style*="display: flex"]) .bottom-nav,
body:has(#menuSpaView[style*="display:flex"]) .bottom-nav,
body:has(#menuSpaView:not([style*="display: none"]):not([style*="display:none"])) .bottom-nav {
    display: none !important;
}

body.product-modal-open .app-main,
body:has(#productSpaView[style*="display: flex"]) .app-main,
body:has(#productSpaView[style*="display:flex"]) .app-main,
body:has(#productSpaView:not([style*="display: none"]):not([style*="display:none"])) .app-main,
body:has(#categorySpaView[style*="display: flex"]) .app-main,
body:has(#categorySpaView[style*="display:flex"]) .app-main,
body:has(#categorySpaView:not([style*="display: none"]):not([style*="display:none"])) .app-main,
body:has(#menuSpaView[style*="display: flex"]) .app-main,
body:has(#menuSpaView[style*="display:flex"]) .app-main,
body:has(#menuSpaView:not([style*="display: none"]):not([style*="display:none"])) .app-main {
    padding-bottom: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
}

body.product-modal-open #productSpaView,
body:has(#productSpaView[style*="display: flex"]) #productSpaView,
body:has(#productSpaView[style*="display:flex"]) #productSpaView,
body:has(#productSpaView:not([style*="display: none"]):not([style*="display:none"])) #productSpaView {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.product-modal-open #productIframe,
body:has(#productSpaView[style*="display: flex"]) #productIframe,
body:has(#productSpaView[style*="display:flex"]) #productIframe,
body:has(#productSpaView:not([style*="display: none"]):not([style*="display:none"])) #productIframe {
    flex: 1 1 0% !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: none !important;
    display: block !important;
}

@media (min-width: 768px) {
  .bottom-nav { display: none !important; }
  .app-main .search-container { display: none !important; }
  
  /* En PC/Desktop la cabecera 'Volver a la tienda' está de más (se usa el header principal) */
  #productSpaView .spa-header {
      display: none !important;
  }
  
  /* Shared SPA views styling for tablet and PC */
  #productSpaView, #categorySpaView, #menuSpaView {
      max-width: 1350px !important;
      min-width: 0 !important;
      margin: 0 auto !important;
      width: 100% !important;
      height: 100% !important;
  }
  
  /* Customize app-main scrollbar for cleaner look */
  .app-main::-webkit-scrollbar {
      width: 6px;
  }
  .app-main::-webkit-scrollbar-track {
      background: transparent;
  }
  .app-main::-webkit-scrollbar-thumb {
      background-color: rgba(0,0,0,0.15);
      border-radius: 10px;
  }
  .app-main::-webkit-scrollbar-thumb:hover {
      background-color: rgba(0,0,0,0.3);
  }

  /* Top header base responsive styles (tablet & desktop) */
  .top-header { 
      grid-area: header;
      display: block; 
      position: sticky; 
      top: 0; 
      z-index: 900; 
      background: rgba(255, 255, 255, 0.95); 
      backdrop-filter: blur(10px);
      border-bottom: 1px solid #f1f5f9; 
      padding: 12px 20px; 
      box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  }
  
  .th-container { 
      max-width: 1200px; 
      margin: 0 auto; 
      display: flex; 
      align-items: center; 
      justify-content: space-between; 
      gap: 16px; 
      width: 100%;
  }
  
  .th-logo { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; color: #0f172a; letter-spacing: -0.5px; flex-shrink: 0; }
  .th-logo img { height: 46px; border-radius: 8px; object-fit: contain; transition: filter 0.3s ease; }
  body.dark-mode .th-logo img.auto-invert { filter: invert(1) hue-rotate(180deg); }
  
  .th-search { flex: 1; min-width: 140px; max-width: 540px; position: relative; margin: 0 10px; }
  .th-search .search-box { 
      background: #f8fafc; 
      border: 2px solid #f1f5f9;
      border-radius: 12px; 
      padding: 10px 18px; 
      display: flex; align-items: center; gap: 10px; 
      transition: all 0.2s;
  }
  .th-search .search-box:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,71,87,0.1); }
  .th-search i { color: #94a3b8; font-size: 16px; }
  .th-search input { border: none; background: transparent; width: 100%; outline: none; font-family: 'Outfit', sans-serif; font-size: 14.5px; color: #334155; }
  .th-search input::placeholder { color: #94a3b8; }
  
  .th-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  
  .th-btn { 
      background: #f8fafc; border: 1px solid #f1f5f9; 
      cursor: pointer; font-family: 'Outfit', sans-serif; 
      font-size: 14px; font-weight: 700; color: #334155; 
      display: flex; align-items: center; gap: 8px; 
      padding: 9px 14px; border-radius: 12px; 
      transition: all 0.2s; 
  }
  .th-btn:hover { background: #f1f5f9; color: #0f172a; transform: translateY(-2px); }
  .th-btn i { font-size: 17px; color: var(--primary); }
  
  .th-profile-btn {
      background: #fff; border: 1px solid #e2e8f0; 
      cursor: pointer; font-family: 'Outfit', sans-serif; 
      font-size: 13.5px; font-weight: 700; color: #334155; 
      display: flex; align-items: center; gap: 8px; 
      padding: 5px 14px 5px 5px; border-radius: 30px; 
      transition: all 0.2s ease;
      box-shadow: 0 2px 10px rgba(0,0,0,0.02);
  }
  .th-profile-btn:hover { background: #f8fafc; border-color: #cbd5e1; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
  .th-profile-btn.logged-in { border-color: rgba(99, 102, 241, 0.3); background: #f8fafc; }
  .th-profile-btn.logged-in:hover { border-color: var(--primary, #6366f1); background: #fff; }
  
  .th-profile-icon {
      width: 32px; height: 32px; border-radius: 50%;
      background: #f1f5f9; display: flex; align-items: center; justify-content: center;
      overflow: hidden; flex-shrink: 0; border: 2px solid #fff;
      box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }
  .th-profile-icon i { font-size: 14px; color: var(--primary); }
  #locationSelectorHeader .th-profile-icon {
      background: var(--header-loc-bg) !important;
      border: none !important;
  }
  #locationSelectorHeader .th-profile-icon i {
      color: #ffffff !important;
  }
  .th-profile-btn.logged-in .th-profile-icon { border-color: rgba(99, 102, 241, 0.2); }
  .th-profile-icon.is-pro { border-color: #f97316 !important; box-shadow: 0 0 0 1.5px rgba(249, 115, 22, 0.25); }
  .th-profile-btn.is-pro { border-color: rgba(249, 115, 22, 0.4); background: #fffaf5; }
}

/* ========================================================
   TABLET RESPONSIVE LAYOUT (768px to 1099px - iPad / Air / Pro)
   ======================================================== */
@media (min-width: 768px) and (max-width: 1099px) {
  .app-container {
      display: flex !important;
      flex-direction: column !important;
      height: 100vh;
      height: 100dvh;
      width: 100%;
      max-width: 100%;
      overflow: hidden;
  }

  .header-wrapper {
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      flex-shrink: 0;
  }

  .app-main { 
      flex: 1 !important;
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      padding-top: 16px; 
      padding-bottom: 40px; 
      margin: 0 auto; 
      overflow-y: auto;
  }
  
  .app-main > div {
      max-width: 100%;
      padding: 0 16px;
      margin: 0 auto;
  }
  
  /* Top cart button is ALWAYS visible on tablet with notification badge */
  #btnCartNavTop { 
      display: flex !important; 
  }

  /* Cart on tablet: Elegant slide-in drawer from the right */
  #cartModal.modal-overlay { 
      position: fixed !important; 
      top: 0 !important; 
      left: 0 !important; 
      right: 0 !important; 
      bottom: 0 !important; 
      background: rgba(15, 23, 42, 0.55) !important; 
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
      z-index: 100005 !important; 
      display: flex !important;
      justify-content: flex-end !important;
      align-items: stretch !important;
      opacity: 0 !important; 
      visibility: hidden !important; 
      pointer-events: none !important; 
      transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  #cartModal.modal-overlay.active {
      opacity: 1 !important;
      visibility: visible !important;
      pointer-events: auto !important;
  }
  #cartModal .close-sheet { 
      display: flex !important; 
      cursor: pointer;
  }
  #cartModal .bottom-sheet { 
      position: relative !important; 
      top: 0 !important; 
      right: 0 !important; 
      bottom: 0 !important; 
      left: auto !important; 
      width: 100% !important; 
      max-width: 420px !important; 
      height: 100% !important; 
      max-height: 100% !important; 
      border-radius: 24px 0 0 24px !important; 
      transform: translateX(100%) !important; 
      transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important; 
      border-left: 1px solid #e2e8f0;
      box-shadow: -12px 0 40px rgba(0,0,0,0.2) !important;
      display: flex !important;
      flex-direction: column !important;
      overflow: hidden !important;
      background: #f8fafc !important;
  }
  #cartModal.modal-overlay.active .bottom-sheet {
      transform: translateX(0) !important;
  }
  #cartModal .sheet-body.cart-body {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      height: calc(100% - 60px);
  }
  #cartModal #cartItems {
      flex: 1;
      overflow-y: auto;
  }

  /* SPA views edge-to-edge on tablet */
  #productSpaView, #categorySpaView, #menuSpaView {
      border-left: none !important;
      border-right: none !important;
      box-shadow: none !important;
  }
}

/* ========================================================
   DESKTOP RESPONSIVE LAYOUT (1100px+ - Full PC & Widescreen)
   ======================================================== */
@media (min-width: 1100px) {
  .app-container {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) 380px !important;
      transition: grid-template-columns 0.3s ease;
      grid-template-rows: auto 1fr;
      grid-template-areas: 
          "header cart"
          "main cart";
      height: 100vh;
      height: 100dvh;
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0;
      box-shadow: none !important;
      border: none !important;
  }

  .header-wrapper {
      grid-area: header;
      min-width: 0 !important;
  }

  .app-main { 
      grid-area: main;
      padding-top: 20px; 
      padding-bottom: 40px; 
      max-width: 100%; 
      width: 100% !important; 
      min-width: 0 !important;
      margin: 0 auto; 
      overflow-y: auto;
  }
  
  /* Container for inner alignment */
  .app-main > div {
      max-width: 1200px;
      margin: 0 auto;
  }
  
  #productSpaView, #categorySpaView, #menuSpaView {
      border-left: 1px solid #e2e8f0;
      border-right: 1px solid #e2e8f0;
      box-shadow: 0 0 20px rgba(0,0,0,0.03);
  }

  /* HIDE HEADER CART ICON BY DEFAULT ON PC (since cart is open as sidebar) */
  #btnCartNavTop { display: none !important; }
  
  /* WHEN CART IS COLLAPSED ON PC */
  .app-container.cart-collapsed {
      grid-template-columns: minmax(0, 1fr) 0px !important;
  }
  .app-container.cart-collapsed #cartModal.modal-overlay {
      display: none !important;
  }
  .app-container.cart-collapsed #btnCartNavTop {
      display: flex !important;
  }

  /* OVERRIDE CART TO SIDEBAR AND ALWAYS VISIBLE ON WIDESCREEN PC */
  #cartModal.modal-overlay { 
      grid-area: cart;
      position: relative !important; 
      opacity: 1 !important; 
      visibility: visible !important;
      pointer-events: auto !important; 
      background: transparent !important; 
      display: flex !important;
      flex-direction: column;
      z-index: 10;
      height: 100% !important;
      max-height: 100% !important;
      overflow: hidden;
  }
  #cartModal .close-sheet { display: flex !important; }
  #cartModal .bottom-sheet { 
      position: relative; 
      top: auto; bottom: auto; right: auto; left: auto; 
      width: 100%; 
      max-width: 100%; 
      height: 100%; 
      max-height: 100% !important; 
      border-radius: 0; 
      transform: none !important; 
      border-left: 1px solid #e2e8f0;
      box-shadow: -4px 0 15px rgba(0,0,0,0.02);
      display: flex;
      flex-direction: column;
      overflow: hidden;
  }
  #cartModal .sheet-body.cart-body {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      height: calc(100% - 60px);
  }
  #cartModal #cartItems {
      flex: 1;
      overflow-y: auto;
  }
}


/* =========================================
   PROFILE SPA STYLES
   ========================================= */
.profile-container { display: flex; flex-direction: column; gap: 24px; max-width: 1200px; margin: 0 auto; width: 100%; }
@media(min-width: 768px) { .profile-container { flex-direction: row; align-items: flex-start; } }
.profile-sidebar { background: var(--card-bg, #fff); border-radius: 16px; padding: 25px; flex: 1; max-width: 100%; width: 100%; box-shadow: 0 4px 20px rgba(0,0,0,0.03); border: 1px solid var(--border-color, #f1f5f9); }
@media(min-width: 768px) { .profile-sidebar { max-width: 280px; position: sticky; top: 20px; } }
.profile-avatar-sec { text-align: center; margin-bottom: 25px; }
.profile-avatar-sec img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.08); margin-bottom: 12px; }
.profile-avatar-sec h3 { font-weight: 800; font-size: 18px; color: var(--text-main, #0f172a); margin: 0 0 10px 0; }
.profile-nav { list-style: none; padding: 0; margin: 0; }
.profile-nav li { padding: 12px 16px; margin-bottom: 6px; border-radius: 12px; cursor: pointer; color: #64748b; font-weight: 600; font-size: 14px; transition: all 0.2s ease; display: flex; align-items: center; gap: 12px; }
.profile-nav li:hover { background: #f8fafc; color: #0f172a; }
.profile-nav li.active { background: rgba(99, 102, 241, 0.08); color: var(--primary, #6366f1); font-weight: 700; }
.profile-content { background: var(--card-bg, #fff); border-radius: 16px; padding: 20px; flex: 3; box-shadow: 0 4px 20px rgba(0,0,0,0.03); border: 1px solid var(--border-color, #f1f5f9); }
@media(min-width: 768px) { .profile-content { padding: 35px 40px; } }
.profile-tab h2 { margin-top: 0; color: var(--text-main, #0f172a); font-size: 22px; font-weight: 800; margin-bottom: 25px; border-bottom: 1px solid #f1f5f9; padding-bottom: 15px; }
.address-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; margin-bottom: 10px; position: relative; }
.address-card h4 { margin: 0 0 5px 0; color: #0f172a; display: flex; justify-content: space-between; }
.address-card p { margin: 0; color: #64748b; font-size: 14px; }
.badge-default { background: #10b981; color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 12px; margin-left: 10px; }
.btn-small { background: #e2e8f0; color: #475569; border: none; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }

/* =========================================
   CHECKOUT SPA STYLES (MODERN REDESIGN)
   ========================================= */
.checkout-container { 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
    max-width: 1140px; 
    margin: 0 auto; 
    width: 100%; 
}
@media(min-width: 900px) { 
    .checkout-container { 
        flex-direction: row; 
        align-items: flex-start; 
    } 
}
.checkout-left { 
    flex: 1.85; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}
.checkout-right { 
    flex: 1.15; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    position: sticky; 
    top: 20px; 
}
.checkout-card { 
    background: #ffffff; 
    border-radius: 18px; 
    padding: 24px; 
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04); 
    border: 1px solid #e2e8f0; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.checkout-card:hover {
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
}

/* Checkout Input Fields - Modern High Contrast (Light Mode) */
.checkout-field {
    margin-bottom: 16px;
}

.checkout-field label,
.checkout-card label {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkout-field input,
.checkout-field select,
.checkout-field textarea,
.checkout-card input[type="text"],
.checkout-card input[type="tel"],
.checkout-card input[type="email"],
.checkout-card input[type="date"],
.checkout-card input[type="time"],
.checkout-card input[type="password"],
.checkout-card select,
.checkout-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #0f172a !important;
    background: #ffffff !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.checkout-field input::placeholder,
.checkout-card input::placeholder,
.checkout-card textarea::placeholder {
    color: #94a3b8 !important;
    font-weight: 400;
}

.checkout-field input:hover,
.checkout-field select:hover,
.checkout-field textarea:hover,
.checkout-card input:hover,
.checkout-card select:hover {
    border-color: #94a3b8;
}

.checkout-field input:focus,
.checkout-field select:focus,
.checkout-field textarea:focus,
.checkout-card input:focus,
.checkout-card select:focus,
.checkout-card textarea:focus {
    border-color: var(--primary, #ff4757) !important;
    outline: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 3.5px rgba(255, 71, 87, 0.15) !important;
}

.btn-back-checkout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.btn-back-checkout:hover {
    background: #f1f5f9;
    color: var(--primary, #ff4757);
    border-color: var(--primary, #ff4757);
    transform: translateX(-2px);
}

/* Step Header */
.checkout-step-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.checkout-step-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary, #ff4757), #a855f7);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb, 255, 71, 87), 0.3);
}
.checkout-step-title {
    margin: 0 0 2px 0;
    font-size: 16.5px;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    line-height: 1.25;
}
.checkout-step-desc {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

/* Delivery Mode Toggle Buttons (Desktop) */
.chk-delivery-toggle-wrap {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    width: 100%;
}
.btn-delivery-mode {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}
.btn-delivery-mode i {
    font-size: 17px;
    transition: transform 0.2s;
}
.btn-delivery-mode:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.btn-delivery-mode.active {
    background: var(--primary, #6516f7) !important;
    border-color: var(--primary, #6516f7) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary, #6516f7) 30%, transparent) !important;
}
.btn-delivery-mode.active i {
    transform: scale(1.1);
}

/* Payment Methods & Copyable Cards */
.payment-method-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.payment-method-label:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.payment-method-label.active-pm {
    border-color: var(--primary, #ff4757);
    background: rgba(var(--primary-rgb, 255, 71, 87), 0.02);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 255, 71, 87), 0.08);
}

.pm-details-box {
    padding: 14px 16px;
    background: #f8fafc;
    font-size: 12.5px;
    color: #475569;
    margin-top: -8px;
    margin-bottom: 12px;
    border-radius: 0 0 14px 14px;
    border: 1.5px solid #e2e8f0;
    border-top: none;
    animation: fadeInSlide 0.25s ease;
}

/* Bank Account Copyable Item */
.bank-account-copy-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: all 0.2s;
}
.bank-account-copy-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
}
.bank-account-copy-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.bank-account-copy-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.bank-account-copy-num {
    font-family: monospace, -apple-system, sans-serif;
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.6px;
    word-break: break-all;
}
.bank-account-copy-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
}

.btn-copy-bank {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-copy-bank:hover {
    background: var(--primary, #ff4757);
    color: #ffffff;
    border-color: var(--primary, #ff4757);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 255, 71, 87), 0.25);
}
.btn-copy-bank.copied {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}

.btn-copy-all-bank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    border: 1px dashed #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-copy-all-bank:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Ocultar barra de navegación inferior (Navbar) cuando esté en Checkout */
body.checkout-active .bottom-nav,
body.checkout-active #bottomNavCapsule,
body:has(#checkoutSpaView[style*="display: flex"]) .bottom-nav,
body:has(#checkoutSpaView[style*="display:flex"]) .bottom-nav,
body:has(#checkoutSpaView:not([style*="display: none"]):not([style*="display:none"])) .bottom-nav,
body:has(#checkoutSuccessSpaView[style*="display: flex"]) .bottom-nav,
body:has(#checkoutSuccessSpaView[style*="display:flex"]) .bottom-nav {
    display: none !important;
}

/* Mobile Sticky Bottom Floating Capsule (Checkout - Full App Brand Pill) */
.checkout-mobile-sticky-bar {
    display: none;
}

@media (max-width: 900px) {
    #checkoutSpaView {
        padding-bottom: 115px !important;
    }
    .checkout-mobile-sticky-bar {
        position: fixed;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        left: 14px;
        right: 14px;
        max-width: 440px;
        margin: 0 auto;
        z-index: 2500;
        background: var(--primary, #6516f7);
        background: linear-gradient(135deg, var(--primary, #6516f7) 0%, color-mix(in srgb, var(--primary, #6516f7) 80%, #000) 100%);
        border: 1.5px solid rgba(255, 255, 255, 0.28);
        border-radius: 9999px;
        box-shadow: 0 12px 32px -4px color-mix(in srgb, var(--primary, #6516f7) 50%, transparent), 0 4px 14px rgba(0, 0, 0, 0.16);
        padding: 6px 8px 6px 8px;
        height: 64px;
        box-sizing: border-box;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        animation: capsuleSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, filter 0.22s ease;
    }
    .checkout-mobile-sticky-bar:hover {
        filter: brightness(1.06);
        box-shadow: 0 16px 36px -2px color-mix(in srgb, var(--primary, #6516f7) 60%, transparent), 0 6px 18px rgba(0, 0, 0, 0.22);
    }
    .checkout-mobile-sticky-bar:hover .chk-cta-icon-wrap {
        transform: translateX(3px);
    }
    .checkout-mobile-sticky-bar:active {
        transform: scale(0.97);
        filter: brightness(0.94);
    }
    .checkout-mobile-sticky-bar.is-processing {
        opacity: 0.82;
        cursor: not-allowed;
        transform: none !important;
    }

    /* Left pill chip with Total */
    .chk-mobile-bar-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex-shrink: 0;
        min-width: 0;
        background: rgba(0, 0, 0, 0.22);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 9999px;
        padding: 6px 14px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        transition: background 0.2s ease;
    }
    .chk-mobile-bar-label {
        font-size: 9.5px;
        color: rgba(255, 255, 255, 0.85);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        line-height: 1;
        margin-bottom: 2px;
    }
    .chk-mobile-bar-total {
        font-size: 17.5px;
        font-weight: 900;
        color: #ffffff;
        font-family: inherit;
        line-height: 1.1;
        letter-spacing: -0.3px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    /* Right CTA button / action */
    .btn-checkout-mobile {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        background: transparent;
        border: none;
        padding: 0 4px 0 0;
        color: #ffffff;
        cursor: pointer;
        pointer-events: none;
    }
    .chk-cta-text {
        font-size: 15.5px;
        font-weight: 800;
        color: #ffffff;
        letter-spacing: 0.2px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        white-space: nowrap;
    }
    .chk-cta-icon-wrap {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: #ffffff;
        color: var(--primary, #6516f7);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
        transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .chk-cta-icon-wrap i {
        font-size: 14px;
        color: var(--primary, #6516f7);
        transition: transform 0.2s ease;
    }

    /* Hide heavy desktop summary column on mobile to remove redundancy and scroll */
    .checkout-right {
        display: none !important;
    }
    
    /* Compact, modern app-like cards and spacing */
    .checkout-container {
        gap: 14px !important;
    }
    .checkout-card {
        padding: 18px 16px !important;
        border-radius: 18px !important;
        margin-bottom: 0 !important;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04) !important;
    }
    .checkout-step-header {
        margin-bottom: 14px !important;
        padding-bottom: 12px !important;
        gap: 12px !important;
    }
    .checkout-step-badge {
        width: 28px !important;
        height: 28px !important;
        border-radius: 9px !important;
        font-size: 13px !important;
    }
    .checkout-step-title {
        font-size: 15px !important;
    }
    .checkout-step-desc {
        font-size: 12px !important;
    }

    /* Top bar */
    .chk-top-nav-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
    }
    .btn-back-checkout {
        border-radius: 20px !important;
        padding: 7px 14px !important;
        font-size: 12.5px !important;
    }

    /* Segmented delivery toggle */
    .chk-delivery-toggle-wrap {
        display: flex;
        background: #f1f5f9;
        padding: 4px;
        border-radius: 16px;
        gap: 4px;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
    }
    .btn-delivery-mode {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 11px 8px;
        border-radius: 12px;
        font-size: 12.5px;
        font-weight: 700;
        border: none;
        background: transparent;
        color: #64748b;
        cursor: pointer;
        transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .btn-delivery-mode.active {
        background: var(--primary, #6516f7) !important;
        color: #ffffff !important;
        box-shadow: 0 3px 10px color-mix(in srgb, var(--primary, #6516f7) 35%, transparent) !important;
    }
    .btn-delivery-mode i {
        font-size: 15px;
    }

    /* Map height */
    #chkDeliveryMap {
        height: 195px !important;
        border-radius: 14px !important;
    }

    /* 2 parallel columns for Nombres & Apellidos */
    .checkout-names-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* Inputs in mobile */
    .checkout-field {
        margin-bottom: 12px !important;
    }
    .checkout-field label {
        font-size: 11px !important;
        margin-bottom: 5px !important;
    }
    .checkout-field input {
        padding: 11px 13px !important;
        font-size: 13.5px !important;
        border-radius: 11px !important;
    }
}

@keyframes capsuleSlideUp {
    from { 
        transform: translateY(120%) scale(0.95);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@media (max-width: 360px) {
    .checkout-mobile-sticky-bar {
        left: 10px !important;
        right: 10px !important;
        padding: 5px 6px 5px 6px !important;
        height: 58px !important;
        gap: 8px !important;
    }
    .chk-mobile-bar-info {
        padding: 4px 10px !important;
    }
    .chk-mobile-bar-total {
        font-size: 15px !important;
    }
    .chk-cta-text {
        font-size: 13.5px !important;
    }
    .chk-cta-icon-wrap {
        width: 32px !important;
        height: 32px !important;
    }
    .chk-cta-icon-wrap i {
        font-size: 12px !important;
    }
}

/* =========================================
   CHECKOUT BOTTOM SHEET (Mobile App Style)
   ========================================= */
.chk-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.chk-bottom-sheet-overlay.active {
    display: flex !important;
    opacity: 1;
}
.chk-bottom-sheet-content {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    max-height: 82vh;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.chk-bottom-sheet-overlay.active .chk-bottom-sheet-content {
    transform: translateY(0);
}
.chk-sheet-drag-handle {
    width: 42px;
    height: 4.5px;
    background: #cbd5e1;
    border-radius: 9999px;
    margin: 10px auto 4px auto;
    cursor: pointer;
}
.chk-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 14px 20px;
    border-bottom: 1px solid #f1f5f9;
}
.chk-sheet-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chk-sheet-title-wrap i {
    font-size: 16px;
    color: var(--primary, #6516f7);
}
.chk-sheet-title-wrap h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}
.chk-sheet-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}
.chk-sheet-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.chk-sheet-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.chk-sheet-items-list {
    margin-bottom: 16px;
}
.chk-sheet-items-list .chk-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 4px !important;
}
.chk-sheet-summary {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
}
.chk-sheet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
}
.chk-sheet-divider {
    border: none;
    border-top: 1px dashed #cbd5e1;
    margin: 10px 0;
}
.chk-sheet-row.total {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0;
}
.chk-sheet-footer {
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)) 20px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.checkout-order-items { display: flex; flex-direction: column; gap: 15px; }
.chk-item { display: flex; gap: 15px; align-items: center; }
.chk-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background: #f8fafc; }
.chk-item-info { flex: 1; }
.chk-item-info h4 { margin: 0; color: #0f172a; font-size: 14px; }
.chk-item-price { font-weight: 700; color: #0f172a; }
.checkout-summary-row { display: flex; justify-content: space-between; color: #64748b; margin-bottom: 10px; font-size: 14px; }
.checkout-summary-row.total { color: #0f172a; font-size: 18px; font-weight: 800; margin-top: 10px; }

/* =========================================
   CART ANIMATION
   ========================================= */
@keyframes cartBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #10b981; }
    100% { transform: scale(1); }
}
.cart-animated { animation: cartBounce 0.4s ease; }

.responsive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
@media(min-width: 768px) {
    .responsive-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   MODERN TOAST NOTIFICATIONS (PC & MOBILE)
   ============================================ */

/* --- DESKTOP (PC): Non-intrusive bottom-right dock --- */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column-reverse; /* Stacks upward without pushing existing toasts */
    gap: 10px;
    pointer-events: none;
    max-width: 350px;
    width: auto;
}

.toast-notification {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main, #0f172a);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    transform: translateX(110%) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

body.dark-theme .toast-notification,
body.dark-mode .toast-notification,
.dark .toast-notification {
    background: rgba(20, 20, 24, 0.95);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.toast-notification.toast-show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-notification.toast-hide {
    transform: translateX(110%) scale(0.92);
    opacity: 0;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: -10px !important;
    border: none !important;
}

/* Icons */
.toast-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.toast-success .toast-icon-wrapper {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
}

.toast-error .toast-icon-wrapper {
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}

.toast-warning .toast-icon-wrapper {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}

.toast-info .toast-icon-wrapper {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}

/* Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 2px;
    color: inherit;
}

.toast-message {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
    word-wrap: break-word;
}

body.dark-theme .toast-message,
body.dark-mode .toast-message,
.dark .toast-message {
    color: #94a3b8;
}

/* Close Button */
.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    opacity: 0.6;
    flex-shrink: 0;
    margin-top: -2px;
    margin-right: -2px;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-main, #0f172a);
}

body.dark-theme .toast-close:hover,
body.dark-mode .toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Undo Button */
.toast-undo-btn {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.toast-undo-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2.5px;
    width: 100%;
    background: rgba(0, 0, 0, 0.04);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transition: transform linear;
}

.toast-success .toast-progress-bar { background: #10b981; }
.toast-error .toast-progress-bar { background: #ef4444; }
.toast-warning .toast-progress-bar { background: #f59e0b; }
.toast-info .toast-progress-bar { background: var(--primary); }

/* --- MOBILE: Sleek Dynamic Island / Compact Pill --- */
@media (max-width: 768px) {
    #toastContainer {
        position: fixed;
        top: max(14px, env(safe-area-inset-top) + 8px);
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        bottom: auto;
        z-index: 999999;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        pointer-events: none;
        width: auto;
        max-width: calc(100vw - 28px);
    }

    .toast-notification {
        pointer-events: auto;
        border-radius: 9999px !important; /* Full capsule */
        padding: 6px 14px 6px 8px !important;
        min-height: 38px !important;
        max-height: 48px !important;
        gap: 8px !important;
        width: fit-content !important;
        max-width: min(92vw, 360px) !important;
        background: rgba(255, 255, 255, 0.96) !important;
        box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.14), 0 3px 8px -2px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        transform: translateY(-28px) scale(0.92) !important;
        opacity: 0 !important;
        align-items: center !important;
        transition: transform 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.2), opacity 0.28s ease, max-height 0.25s ease !important;
    }

    body.dark-theme .toast-notification,
    body.dark-mode .toast-notification,
    .dark .toast-notification {
        background: rgba(22, 22, 26, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        box-shadow: 0 10px 28px -2px rgba(0, 0, 0, 0.75), 0 3px 10px rgba(0, 0, 0, 0.5) !important;
    }

    .toast-notification.toast-show {
        transform: translateY(0) scale(1) !important;
        opacity: 1 !important;
    }

    .toast-notification.toast-hide {
        transform: translateY(-26px) scale(0.88) !important;
        opacity: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    .toast-icon-wrapper {
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
        font-size: 11px !important;
        flex-shrink: 0 !important;
    }

    .toast-content {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .toast-notification.no-custom-title .toast-title {
        display: none !important;
    }

    .toast-notification.has-custom-title .toast-title {
        font-size: 12px !important;
        font-weight: 700 !important;
        margin-bottom: 0 !important;
        margin-right: 2px !important;
        display: inline !important;
        white-space: nowrap !important;
    }

    .toast-message {
        font-size: 12.5px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        display: inline !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        color: inherit !important;
    }

    .toast-close {
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
        padding: 0 !important;
        margin: 0 0 0 2px !important;
        opacity: 0.5 !important;
    }

    .toast-undo-btn {
        margin: 0 0 0 6px !important;
        padding: 2px 8px !important;
        font-size: 11px !important;
    }

    .toast-progress {
        height: 2px !important;
        border-radius: 0 0 9999px 9999px !important;
    }
}

/* ============================================
   DARK MODE THEME
   ============================================ */
body.dark-mode {
    --bg-color: #000000;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --white: #111111;
    --border: #222222;
    --shadow: 0 4px 15px rgba(0,0,0,0.5);
}

body.dark-mode { background: #000000; }
body.dark-mode .app-container { background: var(--bg-color); }
body.dark-mode .app-header { background: #111111; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
body.dark-mode .search-box { background: #111111; border-color: #222222; color: #f8fafc; }
body.dark-mode .search-box input { color: #f8fafc; }
body.dark-mode .search-box input::placeholder { color: #64748b; }
body.dark-mode .bottom-nav { background: rgba(18, 18, 22, 0.94); border-color: rgba(255, 255, 255, 0.08); }
body.dark-mode .nav-item { color: #94a3b8; }
body.dark-mode .nav-item.active { color: var(--primary); }
body.dark-mode .modal-overlay .bottom-sheet { background: #111111; }
body.dark-mode .sheet-header { border-bottom-color: #222222; }
body.dark-mode .sheet-header h3 { color: #f8fafc; }
body.dark-mode .close-sheet { background: #222222; color: #94a3b8; }
body.dark-mode .category-card .cat-name { color: #f8fafc; }
body.dark-mode .section-title { color: #f8fafc; }
body.dark-mode .promo-banner { box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
body.dark-mode .location-info h3 { color: #f8fafc; }
body.dark-mode .location-info .label { color: #94a3b8; }
body.dark-mode .ajax-search-results { background: #111111; border-color: #222222; }
body.dark-mode .ajax-item { color: #f8fafc; border-bottom-color: #222222; }
body.dark-mode .ajax-item:hover { background: #222222; }
body.dark-mode .ajax-item-info h4 { color: #f8fafc; }
body.dark-mode .login-modal-box { background: #111111; }
body.dark-mode .login-header h3 { color: #f8fafc; }
body.dark-mode .login-header p { color: #94a3b8; }
body.dark-mode .close-login { background: #222222; color: #94a3b8; }
body.dark-mode .close-login:hover { background: #333333; color: #f8fafc; }
body.dark-mode .product-modal-box { background: #111111; }
body.dark-mode .close-product { background: rgba(17, 17, 17, 0.9); color: #f8fafc; }
body.dark-mode .store-list li { border-color: #222222; color: #f8fafc; }
body.dark-mode .store-info h4 { color: #f8fafc; }
body.dark-mode .store-info p { color: #94a3b8; }
body.dark-mode .cart-summary { background: #080808 !important; }
body.dark-mode #cartCouponInput { background: #111111; color: #f8fafc; }
body.dark-mode .cart-item { border-bottom-color: #222222; }
body.dark-mode .cart-item-info h4 { color: #f8fafc; }
body.dark-mode .qty-btn { background: #222222; color: #f8fafc; }

/* Dynamic content dark mode overrides */
body.dark-mode .pb-product-card { background: #111111 !important; color: #f8fafc; border: 1px solid #222222 !important; box-shadow: 0 4px 15px rgba(255,255,255,0.02) !important; }
body.dark-mode .pb-product-card h3,
body.dark-mode .pb-product-card h4 { color: #f8fafc !important; }
body.dark-mode .pb-product-card .product-price,
body.dark-mode .pb-product-card div[style*="font-size:17px"],
body.dark-mode .pb-product-card span[style*="color:#333"],
body.dark-mode .pb-product-card span[style*="color: #333"] { color: #f8fafc !important; }
body.dark-mode .pb-product-card button { background: var(--primary) !important; color: #ffffff !important; border: 1px solid var(--primary) !important; }
body.dark-mode .pb-product-card button:hover { opacity: 0.9 !important; }

/* SPA Views Dark Mode */
body.dark-mode .spa-view { background: #111111; border-color: #222222 !important; box-shadow: none !important; }
body.dark-mode .spa-header { background: #111111; border-bottom-color: #222222; }
body.dark-mode .spa-title { color: #f8fafc; }

@media (min-width: 1001px) {
    /* Hidden on desktop */
}

body.dark-mode .cat-card-stagger,
body.dark-mode .category-card {
    background: #111111 !important;
    color: #f8fafc !important;
    border-color: #222222 !important;
}

body.dark-mode .cat-card-stagger .cat-name,
body.dark-mode .cat-card-stagger div,
body.dark-mode .cat-card-stagger span:not(.cat-badge),
body.dark-mode .cat-card-stagger h3,
body.dark-mode .cat-card-stagger h4,
body.dark-mode .cat-card-stagger p,
body.dark-mode .category-card span,
body.dark-mode .category-card div,
body.dark-mode .category-card .cat-name {
    color: #f8fafc !important;
}

body.dark-mode .cat-card-stagger .cat-badge,
body.dark-mode .cat-card-stagger span[style*="font-size:10px"],
body.dark-mode .cat-card-stagger span[style*="font-size: 10px"] {
    color: #94a3b8 !important;
}

body.dark-mode .category-card .cat-icon,
body.dark-mode .category-card .category-img,
body.dark-mode .cat-card-stagger .cat-skeleton-img {
    background: #1a1a1a !important;
}
body.dark-mode [style*="background:#f8fafc"] { background: #000000 !important; }
body.dark-mode [style*="background: #f8fafc"] { background: #000000 !important; }
body.dark-mode [style*="color:#0f172a"] { color: #f8fafc !important; }
body.dark-mode [style*="color: #0f172a"] { color: #f8fafc !important; }
body.dark-mode [style*="color:#1e293b"] { color: #f8fafc !important; }
body.dark-mode [style*="color:#334155"] { color: #94a3b8 !important; }
body.dark-mode [style*="color:#64748b"] { color: #cbd5e1 !important; }
body.dark-mode [style*="color: #64748b"] { color: #cbd5e1 !important; }
body.dark-mode [style*="background:#fff"] { background: #111111 !important; }
body.dark-mode [style*="background: #fff"] { background: #111111 !important; }
body.dark-mode [style*="background:#ffffff"] { background: #111111 !important; }
body.dark-mode [style*="border-bottom:1px solid #e2e8f0"] { border-bottom-color: #222222 !important; }
body.dark-mode [style*="border-bottom: 1px solid #e2e8f0"] { border-bottom-color: #222222 !important; }
body.dark-mode [style*="border:1px solid #eee"] { border-color: #222222 !important; }
body.dark-mode [style*="border: 1px solid #eee"] { border-color: #222222 !important; }

/* Profile & Orders Dark Mode */
body.dark-mode {
    --bg-main: #000000;
    --card-bg: #111111;
    --card-alt-bg: #000000;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;
    --border-color: #222222;
    --btn-bg: #1e293b;
    
    /* Header Contrast Variables Dark Mode */
    --header-loc-bg: var(--primary);
    --header-loc-shadow: color-mix(in srgb, var(--primary) 45%, transparent);
    --header-auth-bg: #000000;
    --header-auth-color: #8b5cf6;
    --header-cart-bg: linear-gradient(135deg, #8b5cf6, #f97316);
    --header-cart-shadow: rgba(139,92,246,0.3);
    --header-cart-badge-bg: #000000;
    --header-cart-badge-color: #ffffff;
    --header-cart-badge-border: #8b5cf6;
    --header-search-bg: #000000;
}

body.dark-mode #profileSpaView, body.dark-mode #ordersListSpaView, body.dark-mode #orderDetailsSpaView, body.dark-mode #gamesSpaView { background: #09090b !important; }

/* Modern Profile & Dashboard Dark Mode */
body.dark-mode .modern-profile-header,
body.dark-mode .modern-form-card {
    background: #141416 !important;
    border: 1px solid #27272a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .modern-avatar-wrapper {
    background: #27272a !important;
    border-color: #3f3f46 !important;
}

body.dark-mode .modern-profile-name {
    color: #f4f4f5 !important;
}

body.dark-mode .modern-profile-header .mobile-only-back {
    color: #f4f4f5 !important;
}

body.dark-mode .modern-profile-nav .nav-pill {
    background: #18181b !important;
    border: 1px solid #27272a !important;
    color: #a1a1aa !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .modern-profile-nav .nav-pill:hover {
    background: #27272a !important;
    border-color: #3f3f46 !important;
    color: #ffffff !important;
}

body.dark-mode .modern-profile-nav .nav-pill.active {
    background: var(--primary, #ff4757) !important;
    color: #ffffff !important;
    border-color: var(--primary, #ff4757) !important;
    box-shadow: 0 4px 14px rgba(255, 71, 87, 0.4) !important;
}

body.dark-mode .modern-form-card h2,
body.dark-mode #tab-pedidos h2,
body.dark-mode #tab-beneficios h2,
body.dark-mode #tab-direcciones h2,
body.dark-mode #tab-pagos h2 {
    color: #f4f4f5 !important;
    border-bottom: 1px solid #27272a !important;
}

body.dark-mode .modern-input-group label {
    color: #a1a1aa !important;
}

body.dark-mode .modern-input-group input {
    background: #1c1c20 !important;
    border: 1px solid #2e2e33 !important;
    color: #f4f4f5 !important;
}

body.dark-mode .modern-input-group input:focus {
    background: #242429 !important;
    border-color: var(--primary, #ff4757) !important;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2) !important;
}

body.dark-mode .modern-btn {
    background: var(--primary, #ff4757) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(255, 71, 87, 0.35) !important;
}

body.dark-mode .modern-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

body.dark-mode .modern-btn-secondary {
    background: #27272a !important;
    color: #f4f4f5 !important;
    border: 1px solid #3f3f46 !important;
}

body.dark-mode .modern-btn-secondary:hover {
    background: #3f3f46 !important;
    color: #ffffff !important;
}

/* Rappi / Dashboard Tab Dark Mode */
body.dark-mode #tab-dashboard {
    background: #09090b !important;
}

body.dark-mode .rappi-header {
    background: #09090b !important;
}

body.dark-mode .rappi-header h1,
body.dark-mode .rappi-profile-summary .info h2,
body.dark-mode .rappi-section h3 {
    color: #f4f4f5 !important;
}

body.dark-mode .rappi-profile-summary .info p {
    color: #a1a1aa !important;
}

body.dark-mode .rappi-action-btn {
    background: #141416 !important;
    border: 1px solid #27272a !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .rappi-action-btn:hover {
    background: #1c1c20 !important;
    border-color: #3f3f46 !important;
    transform: translateY(-2px);
}

body.dark-mode .rappi-action-btn i {
    color: var(--primary, #ff4757) !important;
}

body.dark-mode .rappi-action-btn span {
    color: #f4f4f5 !important;
}

body.dark-mode .rappi-list {
    background: #141416 !important;
    border: 1px solid #27272a !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .rappi-list-item {
    border-bottom: 1px solid #27272a !important;
}

body.dark-mode .rappi-list-item:hover {
    background: #1c1c20 !important;
}

body.dark-mode .rappi-list-item .item-left i {
    color: var(--primary, #ff4757) !important;
}

body.dark-mode .rappi-list-item .item-left span,
body.dark-mode .rappi-list-item .item-right {
    color: #f4f4f5 !important;
}

body.dark-mode .rappi-list-item .item-right i {
    color: #71717a !important;
}

/* Auth Modal Dark Mode & High Contrast Button */
body.dark-mode .login-modal-box {
    background: #121214 !important;
    border: 1px solid #27272a !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85) !important;
}

body.dark-mode .login-body {
    background: #121214 !important;
}

body.dark-mode .login-modal-box input {
    background: #1c1c20 !important;
    border: 1px solid #2e2e33 !important;
    color: #ffffff !important;
}

body.dark-mode .login-modal-box input::placeholder {
    color: #71717a !important;
}

body.dark-mode .login-modal-box input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent) !important;
    background: #242429 !important;
}

body.dark-mode .login-modal-box label {
    color: #e4e4e7 !important;
}

body.dark-mode .btn-auth-submit,
body.dark-mode .login-modal-box button[type="submit"] {
    background: var(--primary) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border: none !important;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 45%, transparent) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.dark-mode .btn-auth-submit:hover,
body.dark-mode .login-modal-box button[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px color-mix(in srgb, var(--primary) 60%, transparent) !important;
}

body.dark-mode #authTabIndicator {
    background: var(--primary) !important;
}

body.dark-mode #tabLoginBtn,
body.dark-mode #tabRegisterBtn {
    color: #71717a !important;
}

body.dark-mode #tabLoginBtn.active,
body.dark-mode #tabRegisterBtn.active {
    color: var(--primary) !important;
}

/* Overriding legacy white text issues on the cards */
body.dark-mode .profile-sidebar, body.dark-mode .profile-content { background: #141416 !important; box-shadow: none !important; border: 1px solid #27272a !important; }
body.dark-mode .profile-tab h2 { color: #f8fafc !important; }
body.dark-mode .profile-nav li { color: #94a3b8 !important; }
body.dark-mode .profile-nav li:hover { background: #222222 !important; color: #f8fafc !important; }
body.dark-mode .profile-nav li.active { background: #1e293b !important; color: #3b82f6 !important; }
body.dark-mode .profile-avatar-sec img { border-color: #222222 !important; }
body.dark-mode .pb-field input, body.dark-mode .pb-field select, body.dark-mode .pb-field textarea { background: #1c1c20 !important; color: #f8fafc !important; border-color: #2e2e33 !important; }
body.dark-mode .pb-field label { color: #94a3b8 !important; }

@media (min-width: 768px) {
    body.dark-mode .top-header {
        background: rgba(17, 17, 17, 0.95);
        border-bottom-color: #222222;
    }
    body.dark-mode .th-logo { color: #ffffff; }
    body.dark-mode .th-search .search-box {
        background: #111111;
        border-color: #222222;
    }
    body.dark-mode .th-search .search-box:focus-within {
        background: #111111;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(255,71,87,0.15);
    }
    body.dark-mode .th-search input { color: #f8fafc; }
    body.dark-mode .th-search input::placeholder { color: #64748b; }
    body.dark-mode .th-btn {
        background: #111111;
        border-color: #222222;
        color: #f8fafc !important;
    }
    body.dark-mode .th-btn i,
    body.dark-mode .th-btn span {
        color: #f8fafc !important;
    }
    body.dark-mode .th-btn:hover {
        background: #222222;
        color: #ffffff !important;
    }
    
    body.dark-mode .th-profile-btn {
        background: #111111;
        border-color: #333333;
        color: #f8fafc !important;
    }
    body.dark-mode .th-profile-btn:hover {
        background: #1a1a1a;
        border-color: #444444;
    }
    body.dark-mode .th-profile-btn.logged-in {
        border-color: rgba(99, 102, 241, 0.4);
        background: #111111;
    }
    body.dark-mode .th-profile-btn.logged-in:hover {
        border-color: var(--primary, #6366f1);
        background: #1a1a1a;
    }
    body.dark-mode .th-profile-icon {
        background: #222222;
        border-color: #111111;
    }
    body.dark-mode #locationSelectorHeader .th-profile-icon {
        background: var(--header-loc-bg) !important;
        border: none !important;
    }
    body.dark-mode #locationSelectorHeader .th-profile-icon i {
        color: #ffffff !important;
    }
    
    body.dark-mode #cartModal .bottom-sheet {
        background: #111111;
    }
}

/* ============================================
   CHECKOUT & CART DARK MODE
   ============================================ */
body.dark-mode #checkoutSpaView { background: #0b0f19 !important; }
body.dark-mode .checkout-card { background: #111827 !important; border-color: #1f293d !important; box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important; }
body.dark-mode .checkout-card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.4) !important; }
body.dark-mode .checkout-card h2, body.dark-mode .checkout-card h3 { color: #f8fafc !important; border-bottom-color: #1f293d !important; }
body.dark-mode .checkout-step-header { border-bottom-color: #1f293d !important; }
body.dark-mode .checkout-step-title { color: #f8fafc !important; }
body.dark-mode .checkout-step-desc { color: #94a3b8 !important; }
body.dark-mode .btn-back-checkout { background: #1f293d !important; border-color: #374151 !important; color: #e2e8f0 !important; }
body.dark-mode .btn-back-checkout:hover { background: #374151 !important; color: #ffffff !important; }

body.dark-mode .btn-delivery-mode { background: #1a2234 !important; border-color: #1f293d !important; color: #cbd5e1 !important; }
body.dark-mode .btn-delivery-mode:hover { background: #222d42 !important; border-color: #374151 !important; }
body.dark-mode .btn-delivery-mode.active { background: rgba(var(--primary-rgb, 255, 71, 87), 0.12) !important; border-color: var(--primary, #ff4757) !important; color: var(--primary, #ff4757) !important; }

body.dark-mode .payment-method-label { background: #1a2234 !important; border-color: #1f293d !important; }
body.dark-mode .payment-method-label:hover { border-color: #374151 !important; }
body.dark-mode .payment-method-label.active-pm { border-color: var(--primary, #ff4757) !important; background: rgba(var(--primary-rgb, 255, 71, 87), 0.1) !important; }
body.dark-mode .pm-details-box { background: #141c2e !important; border-color: #1f293d !important; color: #cbd5e1 !important; }

body.dark-mode .bank-account-copy-item { background: #1e293b !important; border-color: #334155 !important; }
body.dark-mode .bank-account-copy-item:hover { border-color: #475569 !important; }
body.dark-mode .bank-account-copy-label { color: #94a3b8 !important; }
body.dark-mode .bank-account-copy-num { color: #f8fafc !important; }
body.dark-mode .bank-account-copy-text { color: #e2e8f0 !important; }
body.dark-mode .btn-copy-bank { background: #334155 !important; border-color: #475569 !important; color: #f8fafc !important; }
body.dark-mode .btn-copy-all-bank { background: #1e293b !important; border-color: #334155 !important; color: #94a3b8 !important; }

body.dark-mode .checkout-mobile-sticky-bar { 
    background: linear-gradient(135deg, var(--primary, #6516f7) 0%, color-mix(in srgb, var(--primary, #6516f7) 72%, #000) 100%) !important; 
    border: 1.5px solid rgba(255, 255, 255, 0.32) !important; 
    box-shadow: 0 14px 38px -2px rgba(0, 0, 0, 0.75), 0 0 24px -2px color-mix(in srgb, var(--primary, #6516f7) 45%, transparent) !important; 
}
body.dark-mode .chk-mobile-bar-info {
    background: rgba(0, 0, 0, 0.38) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}
body.dark-mode .chk-mobile-bar-label { color: rgba(255, 255, 255, 0.8) !important; }
body.dark-mode .chk-mobile-bar-total { color: #ffffff !important; }
body.dark-mode .chk-cta-text { color: #ffffff !important; }
body.dark-mode .chk-cta-icon-wrap { background: #ffffff !important; }
body.dark-mode .chk-cta-icon-wrap i { color: var(--primary, #6516f7) !important; }

/* CHECKOUT BOTTOM SHEET & TOGGLE (Dark Mode) */
body.dark-mode .chk-bottom-sheet-content,
html.dark-mode .chk-bottom-sheet-content {
    background: #182234 !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6) !important;
}
body.dark-mode .chk-sheet-header,
html.dark-mode .chk-sheet-header {
    border-bottom-color: #243046 !important;
}
body.dark-mode .chk-sheet-title-wrap h3,
html.dark-mode .chk-sheet-title-wrap h3 {
    color: #f8fafc !important;
}
body.dark-mode .chk-sheet-close-btn,
html.dark-mode .chk-sheet-close-btn {
    background: #243046 !important;
    color: #94a3b8 !important;
}
body.dark-mode .chk-sheet-close-btn:hover,
html.dark-mode .chk-sheet-close-btn:hover {
    background: #334155 !important;
    color: #ffffff !important;
}
body.dark-mode .chk-sheet-drag-handle,
html.dark-mode .chk-sheet-drag-handle {
    background: #3b4c68 !important;
}
body.dark-mode .chk-sheet-summary,
html.dark-mode .chk-sheet-summary {
    background: #0f172a !important;
    border-color: #243046 !important;
}
body.dark-mode .chk-sheet-row,
html.dark-mode .chk-sheet-row {
    color: #94a3b8 !important;
}
body.dark-mode .chk-sheet-row.total,
html.dark-mode .chk-sheet-row.total {
    color: #f8fafc !important;
}
body.dark-mode .chk-sheet-divider,
html.dark-mode .chk-sheet-divider {
    border-top-color: #243046 !important;
}
body.dark-mode .chk-sheet-footer,
html.dark-mode .chk-sheet-footer {
    background: #182234 !important;
    border-top-color: #243046 !important;
}
body.dark-mode .chk-item,
html.dark-mode .chk-item {
    border-bottom-color: #243046 !important;
}
body.dark-mode .chk-btn-minus,
html.dark-mode .chk-btn-minus,
body.dark-mode .chk-btn-plus,
html.dark-mode .chk-btn-plus {
    background: #243046 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
body.dark-mode .chk-delivery-toggle-wrap,
html.dark-mode .chk-delivery-toggle-wrap {
    background: #141c2e !important;
    border-color: #1f293d !important;
}
body.dark-mode .chk-delivery-toggle-wrap .btn-delivery-mode,
html.dark-mode .chk-delivery-toggle-wrap .btn-delivery-mode {
    color: #94a3b8 !important;
    background: transparent !important;
    border: none !important;
}
body.dark-mode .chk-delivery-toggle-wrap .btn-delivery-mode.active,
html.dark-mode .chk-delivery-toggle-wrap .btn-delivery-mode.active {
    background: var(--primary, #6516f7) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--primary, #6516f7) 45%, transparent) !important;
}

body.dark-mode .checkout-card label,
html.dark-mode .checkout-card label,
body.dark-mode .checkout-field label,
html.dark-mode .checkout-field label { color: #cbd5e1 !important; }

body.dark-mode .checkout-card input[type="text"],
body.dark-mode .checkout-card input[type="tel"],
body.dark-mode .checkout-card input[type="email"],
body.dark-mode .checkout-card input[type="date"],
body.dark-mode .checkout-card input[type="time"],
body.dark-mode .checkout-card input[type="password"],
body.dark-mode .checkout-card select,
body.dark-mode .checkout-card textarea,
html.dark-mode .checkout-card input[type="text"],
html.dark-mode .checkout-card input[type="tel"],
html.dark-mode .checkout-card input[type="email"],
html.dark-mode .checkout-card input[type="date"],
html.dark-mode .checkout-card input[type="time"],
html.dark-mode .checkout-card input[type="password"],
html.dark-mode .checkout-card select,
html.dark-mode .checkout-card textarea,
body.dark-mode .checkout-field input,
html.dark-mode .checkout-field input,
body.dark-mode .checkout-field select,
html.dark-mode .checkout-field select,
body.dark-mode .checkout-field textarea,
html.dark-mode .checkout-field textarea { 
    background: #1a2234 !important; 
    color: #f8fafc !important; 
    border-color: #334155 !important; 
    box-shadow: none !important;
}

body.dark-mode .checkout-card input::placeholder,
html.dark-mode .checkout-card input::placeholder,
body.dark-mode .checkout-field input::placeholder,
html.dark-mode .checkout-field input::placeholder { 
    color: #64748b !important; 
}

body.dark-mode .checkout-card input:focus,
html.dark-mode .checkout-card input:focus,
body.dark-mode .checkout-field input:focus,
html.dark-mode .checkout-field input:focus {
    border-color: var(--primary, #ff4757) !important;
    background: #1e293b !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.25) !important;
}
body.dark-mode .chk-item-info h4 { color: #f8fafc !important; }
body.dark-mode .chk-item-price { color: #f8fafc !important; }
body.dark-mode .checkout-summary-row { color: #94a3b8 !important; }
body.dark-mode .checkout-summary-row.total { color: #f8fafc !important; }
body.dark-mode .checkout-summary-row.total span { color: #f8fafc !important; }
body.dark-mode .btn-checkout { background: var(--primary) !important; color: #ffffff !important; }
.btn-checkout:disabled,
.btn-checkout.disabled,
body.dark-mode .btn-checkout:disabled,
body.dark-mode .btn-checkout.disabled {
    background: #94a3b8 !important;
    color: #f1f5f9 !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}
body.dark-mode .payment-method-label .pm-box,
body.dark-mode .payment-method-label [style*="border:1px solid"] { background: #1a1a1a !important; border-color: #333333 !important; color: #e2e8f0 !important; }
body.dark-mode .payment-method-label input:checked + .pm-box { border-color: var(--primary) !important; background: rgba(var(--primary-rgb, 255,71,87), 0.1) !important; color: var(--primary) !important; }
body.dark-mode #checkoutPickupArea [style*="background:#f0fdf4"] { background: #0a1a0a !important; border-color: #1a3a1a !important; }
body.dark-mode #checkoutPickupArea select { background: #1a1a1a !important; color: #f8fafc !important; border-color: #333333 !important; }
body.dark-mode #btnTogglePickup { background: #1a1a1a !important; color: #e2e8f0 !important; border-color: #333333 !important; }

/* Checkout order items: qty controls & remove buttons */
body.dark-mode .checkout-order-items .chk-item button[style*="background:var(--primary)"] { background: var(--primary) !important; }
body.dark-mode .checkout-order-items .chk-item [style*="color:#ef4444"] { color: #ef4444 !important; }

/* Cart bottom-sheet modal dark mode */
body.dark-mode .cart-summary [style*="color:#0f172a"] { color: #f8fafc !important; }
body.dark-mode .cart-summary [style*="color:#475569"] { color: #94a3b8 !important; }
body.dark-mode .cart-summary .summary-row .total span,
body.dark-mode .cart-summary [style*="font-size:18px"] { color: #f8fafc !important; }
body.dark-mode .cart-summary [style*="border-top:1px dashed"] { border-top-color: #222222 !important; }
body.dark-mode .cart-summary [style*="border:1px solid #e2e8f0"] { border-color: #333333 !important; }
body.dark-mode .cart-summary [style*="background:#fff"] { background: #1a1a1a !important; }

/* ============================================
   CHECKOUT SUCCESS REDESIGN STYLES
   ============================================ */
.chk-success-wrapper {
    width: 100%;
    flex: 1;
    min-height: 100%;
    background: var(--bg-color, #f8fafc);
    padding: 30px 16px 80px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
}

.chk-success-card {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    background: var(--card-bg, #ffffff);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color, #edf2f7);
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

/* Hero Section */
.chk-success-hero {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chk-success-icon-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.chk-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.18);
    animation: chkPulse 2.4s infinite ease-out;
    z-index: 1;
}

.chk-pulse-ring-2 {
    position: absolute;
    width: 125%;
    height: 125%;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.08);
    animation: chkPulse 2.4s 0.7s infinite ease-out;
    z-index: 0;
}

.chk-icon-circle {
    position: relative;
    z-index: 2;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    animation: chkPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chk-success-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.chk-success-subtitle {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    line-height: 1.45;
    max-width: 440px;
    margin: 0 auto 16px;
}

/* Order ID Chip */
.chk-order-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #6366f1);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.chk-order-badge-pill:hover {
    background: rgba(99, 102, 241, 0.14);
    transform: translateY(-1px);
}

.chk-order-badge-pill:active {
    transform: scale(0.98);
}

.chk-order-badge-pill .label {
    text-transform: uppercase;
    font-size: 10px;
    opacity: 0.8;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.chk-order-badge-pill .order-num {
    font-weight: 800;
    font-size: 14px;
}

.chk-copy-btn {
    background: none;
    border: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding-left: 8px;
    border-left: 1px solid rgba(99, 102, 241, 0.3);
    outline: none;
}

/* Stepper / Progress Bar */
.chk-success-stepper {
    background: var(--card-alt-bg, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 18px;
    padding: 20px 14px 14px;
    margin-bottom: 20px;
}

.chk-stepper-track {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.chk-stepper-line-bg {
    position: absolute;
    top: 17px;
    left: 12%;
    width: 76%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    z-index: 1;
}

.chk-stepper-line-active {
    position: absolute;
    top: 17px;
    left: 12%;
    width: 28%;
    height: 3px;
    background: linear-gradient(90deg, #10b981, var(--primary, #6366f1));
    border-radius: 2px;
    z-index: 1;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.chk-stepper-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.chk-node-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: #f1f5f9;
    color: #94a3b8;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.chk-stepper-node.completed .chk-node-dot {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.chk-stepper-node.active .chk-node-dot {
    background: var(--primary, #6366f1);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    animation: chkNodePulse 2s infinite;
}

.chk-node-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.chk-node-label.active {
    color: var(--text-main, #0f172a);
    font-weight: 700;
}

.chk-estimate-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    background: rgba(16, 185, 129, 0.08);
    padding: 8px 14px;
    border-radius: 10px;
    margin-top: 16px;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Info Cards Grid */
.chk-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

@media (max-width: 480px) {
    .chk-cards-grid {
        grid-template-columns: 1fr;
    }
}

.chk-info-card {
    background: var(--card-alt-bg, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 14px 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.chk-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #64748b);
    margin-bottom: 2px;
}

.chk-card-head i {
    color: var(--primary, #6366f1);
    font-size: 13px;
}

.chk-card-main {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    word-break: break-word;
}

.chk-card-sub {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
    word-break: break-word;
}

.chk-amount-highlight {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
}

.chk-amount-highlight .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.chk-amount-highlight .value {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary, #6366f1);
}

/* Accordion: Ordered Items */
.chk-accordion {
    background: var(--card-alt-bg, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    margin-bottom: 18px;
    overflow: hidden;
    text-align: left;
}

.chk-accordion-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #0f172a);
    transition: background 0.2s;
}

.chk-accordion-header:hover {
    background: #f1f5f9;
}

.chk-acc-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chk-acc-title i {
    color: var(--primary, #6366f1);
    font-size: 14px;
}

.chk-accordion-arrow {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chk-accordion-arrow.rotated {
    transform: rotate(180deg);
}

.chk-accordion-body {
    padding: 0 16px 14px;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}

.chk-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.chk-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.chk-item-row .item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.chk-item-row .item-qty {
    background: #e2e8f0;
    color: #334155;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
}

.chk-item-row .item-name {
    font-weight: 600;
    color: var(--text-main, #1e293b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chk-item-row .item-price {
    font-weight: 700;
    color: var(--text-main, #0f172a);
    white-space: nowrap;
    margin-left: 8px;
}

.chk-items-summary-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.chk-summary-line {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted, #64748b);
}

.chk-summary-line.total {
    font-weight: 800;
    color: var(--text-main, #0f172a);
    font-size: 13px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

/* Loyalty Stamp Reward Card */
.chk-loyalty-card {
    background: linear-gradient(135deg, #fef9c3, #fef08a);
    border: 1px solid #fde047;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.12);
}

.chk-loyalty-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #eab308;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.3);
}

.chk-loyalty-title {
    font-size: 13px;
    font-weight: 700;
    color: #854d0e;
    margin-bottom: 2px;
}

.chk-loyalty-desc {
    font-size: 11px;
    color: #92400e;
    line-height: 1.3;
}

/* Action Buttons */
.chk-action-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.btn-chk-primary {
    width: 100%;
    background: var(--primary, #ff4757);
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 71, 87, 0.28);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-chk-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.38);
    opacity: 0.96;
}

.btn-chk-primary:active {
    transform: translateY(0);
}

.chk-action-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-chk-wa {
    background: #25d366;
    color: #ffffff;
    border: none;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.btn-chk-wa:hover {
    background: #22bf5b;
    transform: translateY(-1px);
}

.btn-chk-receipt {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-chk-receipt:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.btn-chk-back {
    background: transparent;
    color: #64748b;
    border: none;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.btn-chk-back:hover {
    color: #0f172a;
    text-decoration: underline;
}

/* Keyframes */
@keyframes chkPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.2; }
    100% { transform: scale(1.3); opacity: 0; }
}

@keyframes chkPop {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes chkNodePulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Dark Mode Overrides */
body.dark-mode #checkoutSuccessSpaView.chk-success-wrapper {
    background: #000000 !important;
}

body.dark-mode .chk-success-card {
    background: #111827 !important;
    border-color: #1f293d !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
}

body.dark-mode .chk-success-title {
    color: #f8fafc !important;
}

body.dark-mode .chk-success-subtitle {
    color: #94a3b8 !important;
}

body.dark-mode .chk-order-badge-pill {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: #a5b4fc !important;
}

body.dark-mode .chk-success-stepper {
    background: #161f30 !important;
    border-color: #1f293d !important;
}

body.dark-mode .chk-stepper-line-bg {
    background: #243049 !important;
}

body.dark-mode .chk-node-dot {
    background: #1e293b !important;
    color: #64748b !important;
    border-color: #111827 !important;
}

body.dark-mode .chk-node-label {
    color: #64748b !important;
}

body.dark-mode .chk-node-label.active {
    color: #f8fafc !important;
}

body.dark-mode .chk-estimate-banner {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: #34d399 !important;
}

body.dark-mode .chk-info-card {
    background: #161f30 !important;
    border-color: #1f293d !important;
}

body.dark-mode .chk-card-head {
    color: #94a3b8 !important;
}

body.dark-mode .chk-card-main {
    color: #f8fafc !important;
}

body.dark-mode .chk-card-sub {
    color: #94a3b8 !important;
}

body.dark-mode .chk-accordion {
    background: #161f30 !important;
    border-color: #1f293d !important;
}

body.dark-mode .chk-accordion-header {
    color: #f8fafc !important;
}

body.dark-mode .chk-accordion-header:hover {
    background: #1a2438 !important;
}

body.dark-mode .chk-accordion-body {
    border-top-color: #1f293d !important;
}

body.dark-mode .chk-item-row {
    border-bottom-color: rgba(255,255,255,0.05) !important;
}

body.dark-mode .chk-item-row .item-qty {
    background: #243049 !important;
    color: #94a3b8 !important;
}

body.dark-mode .chk-item-row .item-name {
    color: #e2e8f0 !important;
}

body.dark-mode .chk-item-row .item-price {
    color: #f8fafc !important;
}

body.dark-mode .chk-summary-line {
    color: #94a3b8 !important;
}

body.dark-mode .chk-summary-line.total {
    color: #f8fafc !important;
    border-top-color: #1f293d !important;
}

body.dark-mode .chk-loyalty-card {
    background: linear-gradient(135deg, #2e2309, #3f2f0a) !important;
    border-color: #854d0e !important;
}

body.dark-mode .chk-loyalty-title {
    color: #fde047 !important;
}

body.dark-mode .chk-loyalty-desc {
    color: #fef08a !important;
}

body.dark-mode .btn-chk-receipt {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .btn-chk-receipt:hover {
    background: #243049 !important;
}

body.dark-mode .btn-chk-back {
    color: #94a3b8 !important;
}

body.dark-mode .btn-chk-back:hover {
    color: #f8fafc !important;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    flex-shrink: 0;
    overflow: hidden;
}
.theme-toggle:hover {
    background: var(--card-alt-bg, #f8fafc);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.theme-toggle .toggle-icon {
    position: absolute;
    font-size: 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.theme-toggle .toggle-icon.sun {
    color: #f59e0b;
    transform: translateY(0) rotate(0);
    opacity: 1;
}
.theme-toggle .toggle-icon.moon {
    color: #94a3b8;
    transform: translateY(30px) rotate(-90deg);
    opacity: 0;
}

/* Dark mode active state */
body.dark-mode .theme-toggle {
    background: #111111;
    border-color: #333333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
body.dark-mode .theme-toggle:hover {
    background: #1a1a1a;
}
body.dark-mode .theme-toggle .toggle-icon.sun {
    transform: translateY(-30px) rotate(90deg);
    opacity: 0;
}
body.dark-mode .theme-toggle .toggle-icon.moon {
    transform: translateY(0) rotate(0);
    opacity: 1;
    color: #fbbf24 !important;
}
body.dark-mode .theme-toggle .toggle-icon.moon i {
    color: #fbbf24 !important;
}

/* Mobile: theme toggle next to search bar */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-container .search-box {
    flex: 1;
}

@media (min-width: 768px) {
    .search-container .theme-toggle {
        display: none !important;
    }
}

/* ============================================
   FLOATING CART BUTTON (MOBILE)
   ============================================ */
.floating-cart-btn {
    display: none !important;
}
.floating-cart-btn i {
    font-size: 16px;
}
.floating-cart-btn .floating-cart-count {
    background: #fff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .floating-cart-btn {
        display: none !important;
    }
}

@keyframes floatingCartPulse {
    0% { box-shadow: 0 8px 25px rgba(0,0,0,0.25), 0 0 0 0 rgba(var(--primary-rgb, 255, 71, 87), 0.4); }
    70% { box-shadow: 0 8px 25px rgba(0,0,0,0.25), 0 0 0 12px rgba(var(--primary-rgb, 255, 71, 87), 0); }
    100% { box-shadow: 0 8px 25px rgba(0,0,0,0.25), 0 0 0 0 rgba(var(--primary-rgb, 255, 71, 87), 0); }
}
.floating-cart-btn.pulse {
    animation: floatingCartPulse 0.6s ease-out;
}

/* Modern Alert Modal */
.modern-alert-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999999 !important; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modern-alert-overlay.active { opacity: 1; pointer-events: auto; }
.modern-alert-modal {
    background: var(--white, #ffffff); border-radius: 24px; padding: 30px;
    width: 90%; max-width: 360px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    transform: scale(0.8) translateY(20px); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000000 !important;
}
.modern-alert-overlay.active .modern-alert-modal { transform: scale(1) translateY(0); }

.modern-alert-icon {
    width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 32px; margin: 0 auto 20px;
}
.modern-alert-icon.success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.modern-alert-icon.error { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.modern-alert-icon.stamp-add { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.modern-alert-icon.stamp-complete { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.modern-alert-modal h3 { font-size: 20px; font-weight: 800; color: var(--text-main, #0f172a); margin-bottom: 10px; }
.modern-alert-modal p { font-size: 14px; color: var(--text-muted, #64748b); line-height: 1.5; margin-bottom: 25px; }

.modern-alert-btn {
    background: var(--primary, #ff4757); color: #fff; border: none; padding: 14px 24px; border-radius: 14px;
    font-size: 15px; font-weight: 700; width: 100%; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.modern-alert-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3); }

body.dark-mode .modern-alert-overlay { background: rgba(0, 0, 0, 0.75) !important; }
body.dark-mode .modern-alert-modal {
    background: #18181b !important;
    border: 1px solid #27272a !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85) !important;
}
body.dark-mode .modern-alert-modal h3 { color: #f4f4f5 !important; }
body.dark-mode .modern-alert-modal p { color: #a1a1aa !important; }
/* ========================================= */
/* ====== INTERACTIVIDAD AVANZADA (V2) ===== */
/* ========================================= */

/* 1. KEYFRAMES */
@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
@keyframes pulse-alert {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes btn-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: #10b981; }
    100% { transform: scale(1); background-color: #10b981; }
}

/* 2. SKELETON CSS MEJORADO */
.skeleton-block {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite linear;
}
html.dark-mode .skeleton-block {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
}

/* 3. EFECTO RIPPLE */
.ripple {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}
.ripple-circle {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}
.ripple-dark .ripple-circle { background-color: rgba(0, 0, 0, 0.1); }
@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* 4. ACORDEONES FLUIDOS */
.extra-group-body {
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.4s ease;
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    display: flex;
}
.extra-group-card.open .extra-group-body {
    max-height: 2000px;
    padding-top: 15px;
    padding-bottom: 15px;
    opacity: 1;
}

/* 5. ENVÍO GRATIS BAR */
.free-shipping-card {
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
html.dark-mode .free-shipping-card {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-color: #3730a3;
}
.free-shipping-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.free-shipping-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.free-shipping-info { flex: 1; }
.free-shipping-title {
    font-size: 14px;
    font-weight: 800;
    color: #312e81;
    margin-bottom: 2px;
}
html.dark-mode .free-shipping-title { color: #e0e7ff; }
.free-shipping-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #4f46e5;
}
html.dark-mode .free-shipping-subtitle { color: #a5b4fc; }
.free-shipping-progress-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
html.dark-mode .free-shipping-progress-bg { background: rgba(0, 0, 0, 0.3); }
.free-shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.free-shipping-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


/* 7. BOTÓN COMPRA - SPINNER & ÉXITO */
.btn-adding { pointer-events: none; opacity: 0.8; justify-content: center; align-items: center; }
.btn-adding .btn-text { display: none; }
.btn-adding::after {
    content: ''; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%;
    animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.btn-added { animation: btn-success 0.4s ease forwards !important; background: #10b981 !important; color:#fff !important; pointer-events:none; border-color: #10b981 !important;}
.btn-added::after { content: '\f00c'; font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free'; font-weight: 900; font-size: 18px; display: inline-block; }
.btn-added .btn-text { display: none; }

/* 8. PILDORAS (VARIABLES) Y SCARCITY */
.btn-swatch {
    border-radius: 30px !important;
    padding: 10px 20px !important;
}
.shake-error { animation: shake-error 0.5s cubic-bezier(.36,.07,.19,.97) both; border-radius: 8px; background: rgba(239, 68, 68, 0.05); }
.scarcity-alert { color: #ef4444; font-size: 12px; font-weight: 700; margin-top: 8px; animation: pulse-alert 2s infinite; }
.disabled-stock { opacity: 0.4 !important; pointer-events: none !important; position: relative; }
.disabled-stock::before {
    content: ''; position: absolute; top: 50%; left: 10%; right: 10%; height: 2px; background: #ef4444; transform: translateY(-50%) rotate(-15deg);
}

/* CROSSFADE PARA MAIN IMG */
.img-crossfade {
    transition: opacity 0.3s ease-in-out;
}

/* ============================================
   TRANSFER / YAPE / QR PAYMENT MODAL
   ============================================ */
#transferPaymentModal {
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.65);
    z-index: 3000;
}

#transferPaymentModal.active {
    display: flex;
}

.transfer-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid #e2e8f0;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.transfer-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    flex-shrink: 0;
}

.transfer-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb, 255, 71, 87), 0.12);
    color: var(--primary, #ff4757);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
    padding: 2px;
    box-sizing: border-box;
}

.transfer-header-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 9px;
}

.transfer-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 13.5px;
    background: #ffffff;
}

.transfer-amount-card {
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 255, 71, 87), 0.08) 0%, rgba(var(--primary-rgb, 255, 71, 87), 0.02) 100%);
    border: 1px solid rgba(var(--primary-rgb, 255, 71, 87), 0.2);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transfer-amount-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.transfer-amount-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary, #ff4757);
}

.btn-copy-amount {
    background: #ffffff;
    border: 1px solid rgba(var(--primary-rgb, 255, 71, 87), 0.3);
    color: var(--primary, #ff4757);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.btn-copy-amount:hover {
    background: var(--primary, #ff4757);
    color: #ffffff;
}

.transfer-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.transfer-qr-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.transfer-qr-img {
    max-width: 190px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 8px;
    transition: transform 0.2s ease;
}

.transfer-qr-img:hover {
    transform: scale(1.03);
}

.transfer-accounts-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
}

.transfer-accounts-content {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    white-space: pre-line;
}

.transfer-voucher-section {
    display: flex;
    flex-direction: column;
}

.transfer-upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 115px;
    box-sizing: border-box;
}

.transfer-upload-dropzone:hover {
    border-color: var(--primary, #ff4757);
    background: rgba(var(--primary-rgb, 255, 71, 87), 0.04);
}

.transfer-upload-dropzone.dragover {
    border-color: var(--primary, #ff4757);
    background: rgba(var(--primary-rgb, 255, 71, 87), 0.08);
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb, 255, 71, 87), 0.15);
}

.transfer-upload-dropzone.is-loading {
    border-color: var(--primary, #ff4757);
    background: rgba(var(--primary-rgb, 255, 71, 87), 0.03);
    cursor: wait;
}

.transfer-upload-dropzone.is-loaded {
    border: 2px solid #10b981;
    background: #f0fdf4;
    cursor: default;
}

/* Prompt Inicial */
.voucher-upload-icon-pulse {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb, 255, 71, 87), 0.1);
    color: var(--primary, #ff4757);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 8px auto;
    transition: transform 0.2s ease;
}

.transfer-upload-dropzone:hover .voucher-upload-icon-pulse {
    transform: scale(1.1);
}

.voucher-prompt-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main, #1e293b);
    display: block;
}

.voucher-prompt-sub {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    display: block;
    margin-top: 2px;
}

/* Estado de Carga y Progreso */
#transferUploadLoading {
    width: 100%;
    max-width: 320px;
    animation: fadeIn 0.2s ease;
}

.voucher-spinner-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    margin: 0 auto 8px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voucher-spinner-ring {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(var(--primary-rgb, 255, 71, 87), 0.2);
    border-top-color: var(--primary, #ff4757);
    border-radius: 50%;
    animation: voucherSpin 0.75s linear infinite;
    position: absolute;
}

.voucher-spinner-center-icon {
    font-size: 14px;
    color: var(--primary, #ff4757);
    animation: voucherPulse 1.2s ease-in-out infinite;
}

.voucher-loading-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main, #1e293b);
    display: block;
    margin-bottom: 8px;
}

.voucher-progress-track {
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.voucher-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff4757, #ff6b81, #ffa502);
    background-size: 200% 100%;
    animation: voucherProgressGlow 1.5s ease infinite;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.voucher-progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    color: var(--text-muted, #64748b);
    margin-top: 5px;
}

#transferUploadProgressPct {
    font-weight: 700;
    color: var(--primary, #ff4757);
}

/* Estado de Éxito / Preview */
#transferVoucherPreviewContainer {
    width: 100%;
    animation: fadeIn 0.25s ease;
}

.voucher-preview-img-wrapper {
    position: relative;
    flex-shrink: 0;
}

#transferVoucherPreview {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: block;
}

.voucher-preview-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    animation: popInCheck 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Keyframes */
@keyframes voucherSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes voucherPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.15); opacity: 1; }
}

@keyframes voucherProgressGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes popInCheck {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.25); }
    100% { transform: scale(1); opacity: 1; }
}

.transfer-verification-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #92400e;
    font-size: 12.5px;
    line-height: 1.45;
}

.notice-icon {
    font-size: 18px;
    color: #d97706;
    margin-top: 2px;
    flex-shrink: 0;
}

.transfer-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #ffffff;
    flex-shrink: 0;
}

.btn-cancel-transfer {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-transfer:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-confirm-transfer {
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 767px) {
    #transferPaymentModal {
        align-items: flex-end;
    }
    
    .transfer-modal-card {
        border-radius: 24px 24px 0 0;
        max-height: 92vh;
    }
    
    .transfer-modal-footer {
        flex-direction: column-reverse;
    }
    
    .btn-cancel-transfer,
    .btn-confirm-transfer {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode for transfer modal */
body.dark-mode #transferPaymentModal .transfer-modal-card {
    background: #121212 !important;
    border-color: #262626 !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.7) !important;
}

body.dark-mode #transferPaymentModal .transfer-modal-header {
    background: #121212 !important;
    border-bottom-color: #262626 !important;
}

body.dark-mode #transferPaymentModal .transfer-modal-body {
    background: #121212 !important;
}

body.dark-mode #transferPaymentModal .transfer-qr-box,
body.dark-mode #transferPaymentModal .transfer-accounts-box {
    background: #1a1a1a !important;
    border-color: #2d2d2d !important;
}

body.dark-mode #transferPaymentModal .transfer-accounts-content {
    color: #cbd5e1 !important;
}

body.dark-mode #transferPaymentModal .transfer-upload-dropzone {
    background: #1a1a1a !important;
    border-color: #333333 !important;
}

body.dark-mode #transferPaymentModal .transfer-upload-dropzone.is-loaded {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
}

body.dark-mode #transferPaymentModal .voucher-prompt-title,
body.dark-mode #transferPaymentModal .voucher-loading-title {
    color: #f1f5f9 !important;
}

body.dark-mode #transferPaymentModal .voucher-progress-track {
    background: #262626 !important;
}

body.dark-mode #transferPaymentModal #transferVoucherPreview {
    border-color: #2d2d2d !important;
}

body.dark-mode #transferPaymentModal .transfer-verification-notice {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fde68a !important;
}

body.dark-mode #transferPaymentModal .btn-copy-amount {
    background: #1a1a1a !important;
    border-color: rgba(var(--primary-rgb, 255, 71, 87), 0.4) !important;
}

body.dark-mode #transferPaymentModal .btn-cancel-transfer {
    background: #1e1e1e !important;
    border-color: #333333 !important;
    color: #cbd5e1 !important;
}

body.dark-mode #transferPaymentModal .transfer-modal-footer {
    background: #121212 !important;
    border-top-color: #262626 !important;
}

/* ==========================================================
   KUTI INLINE CHECKOUT (CHECKOUT.JS)
   ========================================================== */
#checkoutContentForm.kuti-inline-mode > .checkout-card:not(#kutiInlineWrapper),
#checkoutContentForm.kuti-inline-mode #checkoutDeliveryToggleCard,
#checkoutContentForm.kuti-inline-mode #checkoutGuestBanner,
body.kuti-inline-active .checkout-mobile-sticky-bar,
body:has(#checkoutContentForm.kuti-inline-mode) .checkout-mobile-sticky-bar,
body:has(#kutiInlineWrapper[style*="display: block"]) .checkout-mobile-sticky-bar {
    display: none !important;
}

#checkoutContentForm.kuti-inline-mode #kutiInlineWrapper {
    display: block !important;
    animation: kutiFadeInSlideUp 0.3s ease forwards;
}

.kuti-inline-card {
    border: 1.5px solid #10b981 !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    padding: 22px !important;
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.1) !important;
    margin-bottom: 25px !important;
}

.btn-cancel-kuti-inline {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-cancel-kuti-inline:hover {
    background: #e2e8f0;
    color: #0f172a;
}

#kuti-inline-checkout {
    min-height: 640px;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    position: relative;
}

#kuti-inline-checkout iframe {
    width: 100% !important;
    min-height: 640px !important;
    border: none !important;
    display: block !important;
}

@keyframes kutiFadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kuti-inline-card.kuti-completed {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25), 0 20px 45px rgba(16, 185, 129, 0.18) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.kuti-inline-card.kuti-fade-out {
    opacity: 0 !important;
    transform: scale(0.98) translateY(-8px) !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.kuti-success-badge-pulse {
    animation: kutiSuccessPulse 1.8s infinite;
}

@keyframes kutiSuccessPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}


/* ==========================================================
   KUTI AUTOMATED QR PAYMENT MODAL (DISEÑO TIPO APP Y SCROLL ÚNICO)
   ========================================================== */
#kutiPaymentModal {
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.75);
    z-index: 3100;
    padding: 16px;
    box-sizing: border-box;
    transition: opacity 0.25s ease;
}

#kutiPaymentModal.active {
    display: flex;
}

.kuti-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid #e2e8f0;
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.kuti-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    flex-shrink: 0;
}

.kuti-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.badge-kuti-live {
    font-size: 10.5px;
    font-weight: 700;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* Modal Body con barra deslizadora única, sutil y táctil */
.kuti-modal-body {
    flex: 1;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative;
    background: #ffffff;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.kuti-modal-body::-webkit-scrollbar {
    width: 5px;
}
.kuti-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.kuti-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.kuti-loader-wrap {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 30px 20px;
    text-align: center;
    box-sizing: border-box;
}

.kuti-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid #f1f5f9;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: kutiSpin 0.8s linear infinite;
}

@keyframes kutiSpin {
    to { transform: rotate(360deg); }
}

/* Contenedor Principal Estilo App */
.kuti-app-container {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

/* Banner Modo Prueba */
.kuti-banner-sandbox {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

/* Hero Monto */
.kuti-amount-card {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.kuti-amount-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #64748b;
    text-transform: uppercase;
}

.kuti-amount-main {
    font-size: 32px;
    font-weight: 850;
    color: #0f172a;
    line-height: 1.15;
    margin: 4px 0 2px;
    letter-spacing: -0.5px;
}

.kuti-amount-store-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kuti-amount-ref-tag {
    font-size: 11px;
    font-family: monospace;
    color: #94a3b8;
    margin-top: 1px;
}

/* Estado del Pago y Temporizador */
.kuti-status-alert {
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kuti-status-text-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
}

.kuti-clock-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.kuti-status-heading {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f766e;
    line-height: 1.2;
}

.kuti-status-caption {
    font-size: 11px;
    color: #115e59;
    line-height: 1.2;
}

.kuti-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #99f6e4;
    color: #0f766e;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    font-family: monospace;
    box-shadow: 0 1px 4px rgba(13, 148, 136, 0.08);
    flex-shrink: 0;
}

/* Segmented Control de Pestañas Tipo App */
.kuti-app-tab-bar {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 14px;
    gap: 4px;
}

.kuti-app-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 6px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.kuti-app-tab.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kuti-tab-content {
    display: none;
    animation: kutiTabFade 0.2s ease-out;
}

.kuti-tab-content.active {
    display: block;
}

@keyframes kutiTabFade {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pestaña QR */
.kuti-qr-wrapper-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 4px 0 6px;
}

.kuti-qr-white-frame {
    background: #ffffff;
    padding: 12px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 216px;
    height: 216px;
    box-sizing: border-box;
    overflow: hidden;
}

.kuti-qr-display {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 190px;
    height: 190px;
    position: relative;
    overflow: hidden;
}

/* Ocultar canvas duplicado cuando img está presente para evitar doble QR */
.kuti-qr-display canvas {
    display: none !important;
}

.kuti-qr-display canvas:only-child {
    display: block !important;
    max-width: 190px !important;
    max-height: 190px !important;
    width: 190px !important;
    height: 190px !important;
    border-radius: 6px;
}

.kuti-qr-display img {
    display: block !important;
    max-width: 190px !important;
    max-height: 190px !important;
    width: 190px !important;
    height: 190px !important;
    border-radius: 6px;
    object-fit: contain;
    margin: 0 auto;
}

.kuti-btn-download {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s;
}

.kuti-btn-download:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.kuti-wallets-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: center;
}

.kuti-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
}

.kuti-chip.yape {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.kuti-chip.plin {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.kuti-chip-circle.yape {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9333ea;
}

.kuti-chip-circle.plin {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0284c7;
}

.kuti-wallets-note {
    font-size: 10.5px;
    color: #64748b;
}

/* Pestañas de Código (Banca / Yape) */
.kuti-code-wrapper-card {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
}

.kuti-code-head-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.6px;
}

.kuti-code-number-display {
    font-size: 26px;
    font-weight: 850;
    letter-spacing: 2px;
    color: #0f172a;
    font-family: monospace;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    user-select: all;
}

.kuti-btn-copy-code {
    background: #0f172a;
    color: #ffffff;
    border: none;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}

.kuti-btn-copy-code:hover {
    background: #1e293b;
}

.kuti-btn-copy-code.copied {
    background: #10b981 !important;
}

.kuti-code-details-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
    text-align: left;
}

.kuti-code-detail-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.kuti-detail-title {
    font-size: 10.5px;
    color: #64748b;
}

.kuti-detail-value {
    font-size: 12.5px;
    font-weight: 700;
    color: #1e293b;
}

/* Instrucciones Paso a Paso */
.kuti-instructions-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 10px;
}

.kuti-step-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.kuti-step-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 10.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.kuti-step-content {
    font-size: 11.5px;
    line-height: 1.4;
    color: #334155;
}

/* Banner Radar en Tiempo Real */
.kuti-radar-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.kuti-radar-pulsing-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGreenRadar 1.8s infinite;
    flex-shrink: 0;
}

@keyframes pulseGreenRadar {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.kuti-radar-text {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    color: #166534;
    line-height: 1.25;
}

.kuti-radar-text strong {
    font-size: 11.5px;
    font-weight: 700;
    color: #14532d;
}

/* Footer */
.kuti-modal-footer {
    padding: 10px 18px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.btn-cancel-kuti {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-cancel-kuti:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Responsive Mobile (<768px): Scroll único y tacto fluido */
@media (max-width: 767px) {
    #kutiPaymentModal {
        align-items: flex-end;
        padding: 0;
    }
    
    .kuti-modal-card {
        border-radius: 24px 24px 0 0;
        max-height: 92vh;
        height: auto;
        max-width: 100%;
        border-bottom: none;
    }

    .kuti-modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain;
    }

    .kuti-app-container {
        padding: 14px 16px 24px;
        gap: 12px;
    }
}

/* Modo Oscuro para el Modal de Kuti */
body.dark-mode #kutiPaymentModal .kuti-modal-card {
    background: #121212 !important;
    border-color: #262626 !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.7) !important;
}

body.dark-mode #kutiPaymentModal .kuti-modal-header {
    background: #121212 !important;
    border-bottom-color: #262626 !important;
}

body.dark-mode #kutiPaymentModal .kuti-modal-body {
    background: #121212 !important;
    scrollbar-color: #334155 transparent;
}

body.dark-mode #kutiPaymentModal .kuti-modal-body::-webkit-scrollbar-thumb {
    background: #334155;
}

body.dark-mode #kutiPaymentModal .kuti-loader-wrap {
    background: #121212 !important;
}

body.dark-mode #kutiPaymentModal .kuti-amount-card {
    background: #181818 !important;
    border-color: #2a2a2a !important;
}

body.dark-mode #kutiPaymentModal .kuti-amount-main {
    color: #f8fafc !important;
}

body.dark-mode #kutiPaymentModal .kuti-amount-store-name {
    color: #cbd5e1 !important;
}

body.dark-mode #kutiPaymentModal .kuti-status-alert {
    background: rgba(13, 148, 136, 0.15) !important;
    border-color: rgba(13, 148, 136, 0.3) !important;
}

body.dark-mode #kutiPaymentModal .kuti-status-heading {
    color: #2dd4bf !important;
}

body.dark-mode #kutiPaymentModal .kuti-status-caption {
    color: #99f6e4 !important;
}

body.dark-mode #kutiPaymentModal .kuti-timer-badge {
    background: #1e293b !important;
    border-color: #0f766e !important;
    color: #2dd4bf !important;
}

body.dark-mode #kutiPaymentModal .kuti-app-tab-bar {
    background: #1f1f1f !important;
}

body.dark-mode #kutiPaymentModal .kuti-app-tab {
    color: #94a3b8 !important;
}

body.dark-mode #kutiPaymentModal .kuti-app-tab.active {
    background: #2a2a2a !important;
    color: #f8fafc !important;
}

body.dark-mode #kutiPaymentModal .kuti-btn-download {
    background: #242424 !important;
    border-color: #383838 !important;
    color: #f8fafc !important;
}

body.dark-mode #kutiPaymentModal .kuti-btn-download:hover {
    background: #2e2e2e !important;
}

body.dark-mode #kutiPaymentModal .kuti-instructions-card {
    background: #181818 !important;
    border-color: #2a2a2a !important;
}

body.dark-mode #kutiPaymentModal .kuti-step-badge {
    background: #2a2a2a !important;
    color: #cbd5e1 !important;
}

body.dark-mode #kutiPaymentModal .kuti-step-content {
    color: #cbd5e1 !important;
}

body.dark-mode #kutiPaymentModal .kuti-code-wrapper-card {
    background: #181818 !important;
    border-color: #2a2a2a !important;
}

body.dark-mode #kutiPaymentModal .kuti-code-number-display {
    background: #242424 !important;
    border-color: #3e3e3e !important;
    color: #f8fafc !important;
}

body.dark-mode #kutiPaymentModal .kuti-code-detail-item .kuti-detail-value {
    color: #f8fafc !important;
}

body.dark-mode #kutiPaymentModal .kuti-modal-footer {
    background: #181818 !important;
    border-top-color: #262626 !important;
}

body.dark-mode #kutiPaymentModal .btn-cancel-kuti {
    background: #242424 !important;
    border-color: #383838 !important;
    color: #cbd5e1 !important;
}

/* ==========================================================
   MODERN APP UI: CLIENT BENEFITS SECTION (#tab-beneficios)
   ========================================================== */
.client-benefits-header {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    border-radius: 18px;
    padding: 20px 22px;
    color: #ffffff;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.25);
    position: relative;
    overflow: hidden;
}

.client-benefits-header::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.client-benefits-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-benefits-badge-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.client-benefits-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.client-benefits-header-text p {
    margin: 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* Digital Wallet Loyalty Pass */
.loyalty-passbook-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    max-width: 460px;
    margin: 0 auto 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .loyalty-passbook-card {
    background: #18181b;
    border-color: #27272a;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.loyalty-passbook-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--card-accent, #ff4757);
    border-radius: 20px 20px 0 0;
}

.loyalty-pass-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}

body.dark-mode .loyalty-pass-title {
    color: #f8fafc;
}

.loyalty-pass-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 22px 0;
    line-height: 1.45;
}

body.dark-mode .loyalty-pass-desc {
    color: #94a3b8;
}

.loyalty-stamp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.loyalty-stamp-slot {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2.5px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

body.dark-mode .loyalty-stamp-slot {
    border-color: #3f3f46;
    background: #27272a;
}

.loyalty-stamp-slot.active {
    border-style: solid;
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.loyalty-pass-status-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    text-align: left;
}

body.dark-mode .loyalty-pass-status-box {
    background: #1e1e24;
    border-color: #2e2e38;
}

.loyalty-pass-track-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin: 8px 0;
}

body.dark-mode .loyalty-pass-track-bar {
    background: #27272a;
}

/* Winner Reward Banner in Customer App */
.client-won-product-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #22c55e;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.15);
    position: relative;
    overflow: hidden;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

body.dark-mode .client-won-product-card {
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.4) 0%, rgba(22, 101, 52, 0.2) 100%);
    border-color: #15803d;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.client-won-badge {
    background: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.client-won-prod-title {
    font-size: 17px;
    font-weight: 800;
    color: #14532d;
    margin: 0 0 4px 0;
}

body.dark-mode .client-won-prod-title {
    color: #86efac;
}

.client-won-prod-desc {
    font-size: 12.5px;
    color: #166534;
    margin: 0 0 8px 0;
}

body.dark-mode .client-won-prod-desc {
    color: #bbf7d0;
}

.client-btn-cart-claim {
    flex: 1;
    min-width: 180px;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.35);
    transition: all 0.2s ease;
}

.client-btn-cart-claim:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
}

.client-btn-cart-claim:active {
    transform: scale(0.97);
}

.client-btn-store-claim {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #86efac;
    background: #ffffff;
    color: #166534;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

body.dark-mode .client-btn-store-claim {
    background: #18181b;
    border-color: #166534;
    color: #86efac;
}

.client-btn-store-claim:hover {
    background: #f0fdf4;
    transform: translateY(-1px);
}

body.dark-mode .client-btn-store-claim:hover {
    background: #1e1e24;
}

@media (max-width: 640px) {
    .client-benefits-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    .client-won-product-card,
    .loyalty-passbook-card {
        padding: 16px;
        border-radius: 16px;
    }
    .loyalty-stamp-slot {
        width: 48px;
        height: 48px;
    }
}

/* ==========================================================================
   RAPPI / UBER EATS STYLE STORE SELECTOR MODAL
   ========================================================================== */
#storeModal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#storeModal.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rappi-store-modal-dialog {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 1060px;
    height: 86vh;
    max-height: 740px;
    border-radius: 28px;
    box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(12px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#storeModal.modal-overlay.active .rappi-store-modal-dialog {
    transform: scale(1) translateY(0);
}

.rappi-modal-drag-handle {
    display: none;
}

/* Modal Header */
.rappi-store-modal-header {
    padding: 20px 24px 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    position: relative;
    z-index: 5;
}

.rappi-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 71, 87, 0.08);
    color: var(--primary, #ff4757);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 6px;
}

.rappi-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.4px;
}

.rappi-modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.rappi-modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rappi-modal-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

/* Mobile Tabs Switcher (Hidden on PC) */
.rappi-mobile-view-tabs {
    display: none;
}

/* Modal Body (Split Columns) */
.rappi-store-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #ffffff;
}

/* Left Column */
.rappi-modal-col-left {
    flex: 0 0 46%;
    max-width: 46%;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 20px 24px;
    border-right: 1px solid #f1f5f9;
    overflow: hidden;
    background: #ffffff;
}

/* Delivery Mode Switcher (Rappi / Uber toggle) */
.rappi-mode-toggle-wrap {
    margin-bottom: 12px;
}

.rappi-mode-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 100px;
    gap: 4px;
}

.rappi-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.rappi-mode-btn i {
    font-size: 14px;
}

.rappi-mode-btn.active {
    background: #ffffff;
    color: var(--primary, #ff4757);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Search Bar & GPS Quick Button */
.rappi-search-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.rappi-search-input-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 12px;
    height: 42px;
    transition: all 0.2s ease;
}

.rappi-search-input-box:focus-within {
    border-color: var(--primary, #ff4757);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.12);
}

.rappi-search-icon {
    color: #94a3b8;
    font-size: 14px;
    margin-right: 8px;
}

.rappi-search-input-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    width: 100%;
}

.rappi-search-clear-btn {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.2s;
}

.rappi-search-clear-btn:hover {
    color: #ef4444;
}

.rappi-gps-quick-btn {
    height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rappi-gps-quick-btn i {
    color: var(--primary, #ff4757);
    font-size: 13px;
}

.rappi-gps-quick-btn:hover {
    border-color: var(--primary, #ff4757);
    background: rgba(255, 71, 87, 0.05);
    color: var(--primary, #ff4757);
}

/* Active Selection Banner */
.rappi-current-selection-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 12px;
}

.rappi-selection-text {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #166534;
}

.rappi-selection-label {
    font-weight: 500;
    color: #15803d;
}

.rappi-selection-badge {
    background: #16a34a;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Store Cards List */
.rappi-store-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.rappi-store-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.rappi-store-list-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.rappi-store-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 2px 0 10px 0;
}

/* Rappi Store Card */
.rappi-store-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    text-align: left;
}

.rappi-store-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.rappi-store-card.active {
    border-color: var(--primary, #ff4757);
    background: rgba(255, 71, 87, 0.03);
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.12);
}

/* Avatar Disc */
.store-avatar-disc {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.store-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-avatar-initial {
    color: #ffffff;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.store-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #ffffff;
}

/* Card Body */
.store-card-body {
    flex: 1;
    min-width: 0;
}

.store-card-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.store-card-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-nearest {
    background: #dcfce7;
    color: #15803d;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-main {
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.store-card-address {
    font-size: 12.5px;
    color: #64748b;
    margin: 3px 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.store-card-address i {
    color: #94a3b8;
    font-size: 11px;
}

/* Meta Chips */
.store-card-meta-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.store-card-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
}

.chip-distance {
    background: #eff6ff;
    color: #2563eb;
}

.chip-eta {
    background: #fef3c7;
    color: #b45309;
}

.chip-fee {
    background: #f1f5f9;
    color: #334155;
}

.chip-fee.free {
    background: #dcfce7;
    color: #15803d;
    font-weight: 700;
}

.chip-coverage {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Card Action Circle & Directions */
.store-card-action {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-store-directions-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-store-directions-sm:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.store-select-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.rappi-store-card:hover .store-select-circle {
    border-color: var(--primary, #ff4757);
    color: var(--primary, #ff4757);
}

.rappi-store-card.active .store-select-circle {
    background: var(--primary, #ff4757);
    border-color: var(--primary, #ff4757);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.35);
}

/* Empty State */
.rappi-store-empty-state {
    padding: 36px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rappi-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.rappi-store-empty-state h4 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.rappi-store-empty-state p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
    max-width: 280px;
    line-height: 1.4;
}

.rappi-btn-clear-search {
    background: var(--primary, #ff4757);
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.rappi-btn-clear-search:hover {
    transform: translateY(-1px);
}

/* Right Column (Mapbox Map) */
.rappi-modal-col-right {
    flex: 0 0 54%;
    max-width: 54%;
    position: relative;
    height: 100%;
    background: #e2e8f0;
}

.rappi-map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.rappi-map-canvas {
    width: 100%;
    height: 100%;
}

/* Floating Map Controls */
.rappi-map-floating-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.rappi-map-gps-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--primary, #ff4757);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.rappi-map-gps-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Floating Route Badge (Uber / Google Maps style) */
.rappi-map-route-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    animation: rappiBadgeFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rappiBadgeFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rappi-map-route-badge:hover {
    transform: scale(1.04);
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.rappi-route-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #ff4757);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ffffff;
    flex-shrink: 0;
}

.rappi-route-badge-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.rappi-route-badge-eta {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.rappi-route-badge-dist {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
}

.rappi-route-badge-action {
    font-size: 12px;
    color: #38bdf8;
    margin-left: 2px;
    opacity: 0.9;
}

/* Floating Bottom Card on Map */
.rappi-map-floating-preview {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 10;
    animation: rappiPreviewSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rappiPreviewSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rappi-preview-inner {
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rappi-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rappi-preview-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.rappi-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rappi-preview-info {
    flex: 1;
    min-width: 0;
}

.rappi-preview-name {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rappi-preview-address {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.rappi-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.store-card-chip.chip-route {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
    font-weight: 700;
}

.rappi-preview-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 2px;
}

.rappi-btn-directions {
    height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.rappi-btn-directions:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0284c7;
    transform: translateY(-1px);
}

.rappi-preview-select-btn {
    flex: 1;
    min-width: 0;
    height: 42px;
    background: var(--primary, #ff4757);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 71, 87, 0.35);
    transition: all 0.2s ease;
}

.rappi-preview-select-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 71, 87, 0.45);
}

/* Custom Mapbox Markers */
.rappi-map-store-marker-wrap {
    cursor: pointer;
    padding: 10px;
    margin: -10px;
}

.rappi-map-store-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.rappi-map-store-marker:hover {
    transform: scale(1.12);
}

.rappi-marker-pin {
    width: 38px;
    height: 38px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: #2563eb;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rappi-marker-pin i {
    transform: rotate(45deg);
    color: #ffffff;
    font-size: 14px;
}

.rappi-map-store-marker.is-active .rappi-marker-pin {
    background: var(--primary, #ff4757);
    box-shadow: 0 4px 18px rgba(255, 71, 87, 0.5);
    width: 44px;
    height: 44px;
}

.rappi-map-store-marker.is-active .rappi-marker-pin i {
    font-size: 16px;
}

.rappi-marker-label {
    margin-top: 4px;
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

/* ==========================================================================
   MOBILE & RESPONSIVE BEHAVIOR (< 900px)
   ========================================================================== */
@media (max-width: 899px) {
    #storeModal.modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .rappi-store-modal-dialog {
        max-width: 100%;
        height: 92vh;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1);
    }

    #storeModal.modal-overlay.active .rappi-store-modal-dialog {
        transform: translateY(0);
    }

    .rappi-modal-drag-handle {
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 10px;
        background: #cbd5e1;
        margin: 10px auto 4px auto;
        flex-shrink: 0;
    }

    .rappi-store-modal-header {
        padding: 12px 16px 12px 16px;
    }

    .rappi-modal-title {
        font-size: 18px;
    }

    .rappi-modal-subtitle {
        font-size: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Mobile Segmented Switcher */
    .rappi-mobile-view-tabs {
        display: flex;
        background: #f8fafc;
        border-bottom: 1px solid #f1f5f9;
        padding: 6px 16px;
        gap: 8px;
        flex-shrink: 0;
    }

    .rappi-mobile-tab-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        background: #ffffff;
        color: #64748b;
        font-size: 12.5px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .rappi-mobile-tab-btn.active {
        background: var(--primary, #ff4757);
        border-color: var(--primary, #ff4757);
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(255, 71, 87, 0.25);
    }

    .rappi-store-modal-body {
        position: relative;
        flex: 1;
        overflow: hidden;
    }

    .rappi-modal-col-left {
        flex: 1;
        max-width: 100%;
        border-right: none;
        padding: 12px 16px 16px 16px;
    }

    .rappi-modal-col-right {
        display: none; /* Toggled on when tab 'map' is active */
    }

    .rappi-store-card {
        padding: 12px;
        gap: 12px;
    }

    .store-avatar-disc {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
}

/* ==========================================================================
   DARK MODE OVERRIDES (body.dark-mode / html.dark-mode)
   ========================================================================== */
body.dark-mode #storeModal.modal-overlay,
html.dark-mode #storeModal.modal-overlay {
    background: rgba(0, 0, 0, 0.75);
}

body.dark-mode .rappi-store-modal-dialog,
html.dark-mode .rappi-store-modal-dialog {
    background: #11141a;
    box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.dark-mode .rappi-modal-drag-handle,
html.dark-mode .rappi-modal-drag-handle {
    background: #333a48;
}

body.dark-mode .rappi-store-modal-header,
html.dark-mode .rappi-store-modal-header {
    background: #11141a;
    border-bottom-color: #1e2430;
}

body.dark-mode .rappi-modal-title,
html.dark-mode .rappi-modal-title {
    color: #f8fafc;
}

body.dark-mode .rappi-modal-subtitle,
html.dark-mode .rappi-modal-subtitle {
    color: #94a3b8;
}

body.dark-mode .rappi-modal-close-btn,
html.dark-mode .rappi-modal-close-btn {
    background: #181d26;
    border-color: #262e3d;
    color: #cbd5e1;
}

body.dark-mode .rappi-modal-close-btn:hover,
html.dark-mode .rappi-modal-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

body.dark-mode .rappi-mobile-view-tabs,
html.dark-mode .rappi-mobile-view-tabs {
    background: #151922;
    border-bottom-color: #1e2430;
}

body.dark-mode .rappi-mobile-tab-btn,
html.dark-mode .rappi-mobile-tab-btn {
    background: #181d26;
    border-color: #262e3d;
    color: #94a3b8;
}

body.dark-mode .rappi-mobile-tab-btn.active,
html.dark-mode .rappi-mobile-tab-btn.active {
    background: var(--primary, #ff4757);
    border-color: var(--primary, #ff4757);
    color: #ffffff;
}

body.dark-mode .rappi-store-modal-body,
html.dark-mode .rappi-store-modal-body,
body.dark-mode .rappi-modal-col-left,
html.dark-mode .rappi-modal-col-left {
    background: #11141a;
    border-right-color: #1e2430;
}

body.dark-mode .rappi-mode-toggle,
html.dark-mode .rappi-mode-toggle {
    background: #181d26;
}

body.dark-mode .rappi-mode-btn,
html.dark-mode .rappi-mode-btn {
    color: #94a3b8;
}

body.dark-mode .rappi-mode-btn.active,
html.dark-mode .rappi-mode-btn.active {
    background: #252c3b;
    color: var(--primary, #ff4757);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark-mode .rappi-search-input-box,
html.dark-mode .rappi-search-input-box {
    background: #181d26;
    border-color: #262e3d;
}

body.dark-mode .rappi-search-input-box input,
html.dark-mode .rappi-search-input-box input {
    color: #f8fafc;
}

body.dark-mode .rappi-gps-quick-btn,
html.dark-mode .rappi-gps-quick-btn {
    background: #181d26;
    border-color: #262e3d;
    color: #e2e8f0;
}

body.dark-mode .rappi-gps-quick-btn:hover,
html.dark-mode .rappi-gps-quick-btn:hover {
    background: rgba(255, 71, 87, 0.12);
    border-color: var(--primary, #ff4757);
    color: var(--primary, #ff4757);
}

body.dark-mode .rappi-current-selection-banner,
html.dark-mode .rappi-current-selection-banner {
    background: #052e16;
    border-color: #166534;
}

body.dark-mode .rappi-selection-text,
html.dark-mode .rappi-selection-text {
    color: #86efac;
}

body.dark-mode .rappi-selection-label,
html.dark-mode .rappi-selection-label {
    color: #4ade80;
}

body.dark-mode .rappi-store-card,
html.dark-mode .rappi-store-card {
    background: #181d26;
    border-color: #262e3d;
}

body.dark-mode .rappi-store-card:hover,
html.dark-mode .rappi-store-card:hover {
    border-color: #3b4455;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode .rappi-store-card.active,
html.dark-mode .rappi-store-card.active {
    border-color: var(--primary, #ff4757);
    background: rgba(255, 71, 87, 0.08);
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.18);
}

body.dark-mode .store-card-title,
html.dark-mode .store-card-title {
    color: #f8fafc;
}

body.dark-mode .store-card-address,
html.dark-mode .store-card-address {
    color: #94a3b8;
}

body.dark-mode .store-status-dot,
html.dark-mode .store-status-dot {
    border-color: #181d26;
}

body.dark-mode .chip-fee,
html.dark-mode .chip-fee {
    background: #252c3b;
    color: #cbd5e1;
}

body.dark-mode .chip-coverage,
html.dark-mode .chip-coverage {
    background: #252c3b;
    border-color: #333d4e;
    color: #cbd5e1;
}

body.dark-mode .store-select-circle,
html.dark-mode .store-select-circle {
    border-color: #3b4455;
    color: #3b4455;
}

body.dark-mode .rappi-preview-inner,
html.dark-mode .rappi-preview-inner {
    background: #181d26;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.dark-mode .rappi-preview-name,
html.dark-mode .rappi-preview-name {
    color: #f8fafc;
}

body.dark-mode .rappi-preview-address,
html.dark-mode .rappi-preview-address {
    color: #94a3b8;
}

body.dark-mode .rappi-map-gps-btn,
html.dark-mode .rappi-map-gps-btn {
    background: #181d26;
    border-color: #262e3d;
    color: var(--primary, #ff4757);
}

body.dark-mode .rappi-store-empty-state h4,
html.dark-mode .rappi-store-empty-state h4 {
    color: #f8fafc;
}

body.dark-mode .rappi-store-empty-state p,
html.dark-mode .rappi-store-empty-state p {
    color: #94a3b8;
}

body.dark-mode .rappi-empty-icon,
html.dark-mode .rappi-empty-icon {
    background: #181d26;
    color: #64748b;
}

body.dark-mode .btn-store-directions-sm,
html.dark-mode .btn-store-directions-sm {
    background: #252c3b;
    border-color: #3b4455;
    color: #cbd5e1;
}

body.dark-mode .rappi-btn-directions,
html.dark-mode .rappi-btn-directions {
    background: #252c3b;
    border-color: #3b4455;
    color: #f8fafc;
}

body.dark-mode .rappi-btn-directions:hover,
html.dark-mode .rappi-btn-directions:hover {
    background: #333d4e;
    border-color: #0284c7;
    color: #38bdf8;
}

body.dark-mode .store-card-chip.chip-route,
html.dark-mode .store-card-chip.chip-route {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.3);
}

/* Map Dark Filter in Dark Mode */
body.dark-mode #storeModalMap .mapboxgl-canvas,
html.dark-mode #storeModalMap .mapboxgl-canvas,
body.dark-mode #storeModalMap .leaflet-tile-pane,
html.dark-mode #storeModalMap .leaflet-tile-pane {
    filter: invert(90%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* ==========================================================================
   iOS / WebKit Compatibility Enhancements (Safari on iPhone / iPad / Mac)
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* Prevent iOS Safari from auto-zooming on focus when font-size < 16px */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Enable native momentum scrolling on iOS WebKit */
.modal-body,
.cart-modal-body,
.checkout-modal-body,
.drawer-content,
.product-modal-container,
.product-app-wrapper,
.store-list-container,
.order-history-list {
    -webkit-overflow-scrolling: touch;
}

/* Eliminate 300ms tap delay & accidental double-tap zoom on buttons and interactive cards */
button,
a,
.btn,
.product-card,
.category-card,
.dish-card,
.option-item,
.btn-qty-step,
.app-touch-btn {
    touch-action: manipulation;
}

/* Leaflet integration & High-DPI Vector Pins */
.leaflet-container {
    font-family: inherit !important;
}
.unified-svg-pin {
    background: transparent !important;
    border: none !important;
}

