
:root {
    /* Default for the standalone app */
    --header-offset: 110px; 
}

/* 1. Hide scrollbar for Chrome, Safari, Opera, and all Webkit browsers */
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}



/* 2. Hide scrollbar for Firefox */
* {
    scrollbar-width: none !important;
}

/* 3. Hide scrollbar for IE and Edge */
* {
    -ms-overflow-style: none !important;
}

/* 4. Ensure body and html are covered */
html, body {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
body::-webkit-scrollbar {
    display: none !important;
}


/* Prevent horizontal overflow on the entire site */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* This is the key line */
   height: 100vh !important;
    touch-action: pan-y; /* Only allow vertical panning on touch devices */
}

/* Apply to the main app container as well for extra safety */
#app-view, .main-content {
    width: 100%;
    
    box-sizing: border-box; /* Ensures padding doesn't add to width */
}
/* MOBILE APP OVERRIDES */
@media screen and (max-width: 768px) {
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw;
        overflow-x: hidden !important;
        /* Prevents the 'gray highlight' on taps in iOS */
        -webkit-tap-highlight-color: transparent;
    }

    #app-view, 
    .main-container,
    .container,
    .content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        box-sizing: border-box;
    }
    .main-content {
        padding: 0 10px;
        margin-top: 0px !important;
    }

    .home-map-panel {
        width: 100%;
    }
    #app-view {
        padding-top: calc(env(safe-area-inset-top) + 30px);
        /* 80px space for the floating bottom nav */
        padding-bottom: calc(env(safe-area-inset-bottom) + 80px);
    }

    .map-explore-full-page {
        margin-bottom: -120px !important;
        margin-left: -20px;
        margin-right: -20px;
        margin-top: -10px !important;
    }

    /* GRID FIXES: Edge-to-edge cards */
    .merchant-grid, 
    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px !important;
        justify-content: space-between;
    }

    .merchant-card {
        width: calc(50% - 5px) !important;
        margin: 0 0 15px 0 !important;
    }


.mobile-bottom-nav {
    position: fixed;
    bottom: 35px;
    left: 50%; /* Center using left/transform for better reliability */
    transform: translateX(-50%);
    width: 90%; /* Increased to 90% to give the search bar room to breathe */
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); /* Makes the 0.95 alpha look premium */
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0 15px; /* Add some internal padding at the ends */
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 9999;
    border: 1px solid rgba(0,0,0,0.05);
    box-sizing: border-box;
}


/* --- 5. SIDEBAR ITEMS --- */
.nav-item {
    padding: 8px 8px;

}

/* Icons should have a fixed width so they don't squish */
.mobile-bottom-nav .nav-item {
    flex: 0 0 45px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The Search Bar takes all the leftover middle space */
.nav-search-bar-wrapper {
    flex: 1; 
    margin: 0 10px; /* Space between icons and search bar */
    display: flex;
    align-items: center;
}

.fake-search-bar {
    width: 100%;
    background: #f5f5f5;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: #888;
    font-size: 14px;
    gap: 8px;
}
    .mobile-bottom-nav .nav-item i {
        font-size: 22px;
        color: #008080;
    }

    .mobile-bottom-nav .nav-item.active i {
        color: #008080;
    }


    
    /* The Search Wrapper takes up more space */
    .nav-search-bar-wrapper {
        flex: 2.5; /* Makes it wider than icons */
        padding: 0 10px;
    }


    .fake-search-bar span {
        font-size: 14px;
        font-weight: 500;
    }

    .fake-search-bar i {
        font-size: 14px;
    }


    
    /* Icons stay small and compact */
    .bar-layout .nav-item {
        flex: 1;
        display: flex;
        justify-content: center;
        color: #444;
        font-size: 18px;
    }





    /* Cart Badge over the Icon */
    .cart-badge {
        position: absolute;
        top: -8px;
        right: -10px;
        background: #008080; /* High visibility red */
        color: white;
        font-size: 10px;
        font-weight: bold;
        min-width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid white;
    }

    .header-logo-img {
        height: 25px;
    }

    /* HIDE ONLY LOGIN/SIGNUP IN HEADER */
    #header-user-actions .login-btn, 
    #header-user-actions .signup-btn,
    #header-user-actions button:not(.notif-btn) { 
        display: none !important; 
    }

    #header-user-actions {
        display: flex !important; 
        align-items: center;
        gap: 15px;
    }

    /* BOTTOM DASHBOARD (SEARCH/TOGGLE) */
    .dashboard-slide {
        position: fixed;
        bottom: -100%;
        left: 0;
        width: 100%;
        background: white;
        border-radius: 25px 25px 0 0;
        padding: 20px;
        transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 1000;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    }

    .dashboard-slide.active {
        bottom: 0;
    }

    .dashboard-handle {
        width: 40px;
        height: 5px;
        background: #ddd;
        border-radius: 10px;
        margin: 0 auto 20px auto;
    }

    /* BOTTOM SHEET (SIDEBAR) */
    #sidebar, .sidebar-container { 
        position: fixed;
        left: 0 !important;
        bottom: -100%;
        width: 100% !important;
        height: 80vh;
        background: white;
        border-radius: 25px 25px 0 0;
        z-index: 10001;
        transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        display: block !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
        overflow-y: auto;
        touch-action: none;
        overscroll-behavior: contain;
    }

    #sidebar.open, .sidebar-container.active {
        bottom: 0 !important;
    }

    #sidebar::before {
        content: "";
        display: block;
        width: 50px;
        height: 6px;
        background: #ccc;
        border-radius: 10px;
        margin: 15px auto;
        cursor: grab;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        display: none;
        z-index: 10000;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .namcor-customer-header-full, 
    .footer-content {
        width: 100% !important;
        padding: 10px 15px !important;
    }

    #home-dashboard-overlay {
        position: fixed;
        bottom: -100%; /* Start hidden at bottom */
        left: 0;
        width: 100%;
        background: white;
        border-radius: 25px 25px 0 0;
        padding: 20px;
        padding-bottom: 40px;
        transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 10001; /* Higher than header but lower than overlays */
        box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    }

    #home-dashboard-overlay.active {
        bottom: 0; /* Slide up to show */
    }

        /* The container for the "Shops Near You" section */
    .shop-circle-wrapper {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; /* Force 3 columns */
        gap: 15px 10px; /* Vertical and Horizontal spacing */
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Individual Shop Item Container */
    .shop-circle-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        cursor: pointer;
        width: 100%;
    }

    /* The Circular Frame */
    .circle-frame {
        width: 80px; /* Size for 3-across on mobile */
        height: 80px;
        border-radius: 50%;
        overflow: hidden;
        background: #f5f5f5;
        margin-bottom: 8px;
        border: 1px solid #eee;
    }

    .circle-frame img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Labels */
    .shop-circle-item label {
        font-size: 12px;
        font-weight: 600;
        color: #333;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Keeps long names from breaking the grid */
        display: block;
    }

    .shop-circle-item .shop-meta {
        font-size: 10px;
        color: #888;
    }
    
    .category-mission-scroller {
        margin-top: 30px !important;
    }


    /* 1. FORCE THE 3-COLUMN GRID FOR CIRCLES */
    .homepage-layout-container .shop-circle-wrapper {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; /* Exactly 3 wide */
        gap: 15px 8px !important;
        padding: 10px 15px !important;
        overflow-x: visible !important; /* Disable horizontal scrolling */
        flex-wrap: wrap !important;     /* Ensure items can wrap if grid fails */
    }

    /* 2. FORCE THE 1-COLUMN LIST FOR ALL SHOPS */
    .homepage-layout-container .all-shops-grid {
        display: flex !important;
        flex-direction: column !important; /* Stack vertically */
        gap: 20px !important;
        overflow-x: visible !important;
    }

    /* 3. ENSURE CARDS FILL THE WIDTH */
    .all-shops-grid .mini-promo-card {
        width: 100% !important;
        min-width: 100% !important;
        margin: 0 0 10px 0 !important;
    }

    .mini-promo-card {
        min-width: 260px !important;
    }

    /* 4. FIX THE SECTION CONTAINERS */
    .homepage-scroller-section {
        width: 100% !important;
        overflow: hidden; /* Prevent horizontal page wobble */
    }


/* 1. Remove the massive 100px gap at the top */
    .checkout-container {
        padding: 15px !important;
        margin-top: 10px !important; /* Move content up on mobile */
    }

    /* 2. Kill the 2-column grid and stack them */
    .checkout-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* 3. Make sure the right column (Summary) takes full width */
    .checkout-right {
        width: 100% !important;
        order: 2; /* Keeps it below the item list */
    }

    .checkout-left {
        width: 100% !important;
        order: 1;
    }

    /* 4. Disable Sticky positioning for the summary box on mobile */
    .summary-card {
        position: relative !important;
        top: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
        padding: 20px !important;
        border-radius: 12px !important;
    }

    /* 5. Optimize the product rows for small screens */
    .checkout-product-row {
        gap: 10px !important;
    }

    .checkout-product-row img {
        width: 55px !important;
        height: 55px !important;
    }

    /* 6. Make buttons and inputs easier to tap */
    .place-order-btn {
        padding: 18px !important;
        font-size: 16px !important;
    }

    #promo-code-input {
        font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
    }

    /* 7. Upsell horizontal scroller fix */
    .checkout-upsell-fullwidth {
        margin: 20px -15px !important; /* Bleed to edges */
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* --- MERCHANT PAGE LAYOUT --- */
    .merchant-view-layout {
        max-width: 1200px;
        margin: 0 auto;
    }

    /* Header Flexbox Logic */
    .merchant-header-flex {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        align-items: flex-start;
        margin-bottom: 30px;
    }



    /* Mini Map behavior */
    .mini-map-container {
        background: #f0f0f0;
        flex-shrink: 0;
    }

/* --- PRODUCT GRIDS FIXED --- */
.merchant-sections-container [style*="grid-template-columns"] {
    display: grid !important;
    gap: 12px !important; /* Slightly tighter gap helps on small screens */
    /* Forces 2 columns on mobile, then allows auto-fill on desktop */
    grid-template-columns: repeat(3, minmax(0, 100px)) !important; 
}

/* Tablet & Desktop: Switch back to auto-fill so they don't stretch too wide */
@media (min-width: 600px) {
    .merchant-sections-container [style*="grid-template-columns"] {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 20px !important;
    }
}

    /* For 'Food Items' (Restaurant style) */
    .food-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 columns on desktop */
        gap: 15px;
    }

    .food-item-card {
        display: flex;
        justify-content: space-between;
        background: #fff;
        padding: 12px;
        border: 1px solid #eee;
        transition: 0.2s;
        cursor: pointer;
    }

    .food-content-left {
        flex: 1;
        padding-right: 10px;
    }

    .food-name { font-weight: 700; display: block; margin-bottom: 4px; }
    .food-description { font-size: 12px; color: #777; margin: 0 0 8px 0; line-height: 1.4; }
    .food-price { font-weight: 800; color: var(--accent); }

    .food-image-right {
        position: relative;
        width: 80px;
        height: 80px;
    }

    .food-image-right img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 7px;
    }

    
    /* Stack the header and hide the map to save space */
    .merchant-header-flex {
        flex-direction: column;
    }

    .mini-map-container {
        width: 100% !important;
        height: 120px !important;
        order: -1; /* Move map to top or just hide it */
    }


    
    .brand-title h1 {
        font-size: 20px;
    }

    /* Force Food Items to be 1 per row on mobile */
    .food-grid {
        grid-template-columns: 1fr;
    }
    
.merchant-branding {
    padding: 0;
    /* Use a variable here too! */
    margin-top: var(--branding-margin, -60px); 
    position: relative;
    z-index: 10;
    margin-bottom: 20px;
}



/* Sticky Category Nav */
.merchant-menu-nav {
    position: sticky;
    /* Use the variable. If it's not defined, it falls back to 110px */
    top: var(--header-offset, 110px) !important; 
    background: #fff;
    z-index: 100;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
    .menu-cat {
        padding: 8px 15px;
        font-size: 13px;
        font-weight: 600;
        color: #888;
    }

    .menu-cat.active {
        color: var(--accent);
        border-bottom: 2px solid var(--accent);
    }

    /* 1. Stack the header vertically */
    .merchant-header-flex {
        flex-direction: column !important;
        gap: 0 !important;
        margin-bottom: 20px !important;
        margin: 0 auto !important;
        align-items: center !important;
    }

    /* 2. Force the image to be full width of the screen */
    .merchant-cover-image {
        width: 100vw !important; /* Full viewport width */
        height: 220px;
        margin-left: -20px !important;
        margin-top: -40px !important; /* Pull to the very top */
    }

    .merchant-cover-image img {
        width: 100% !important;
        height: 220px !important; /* Hero banner height */
        border-radius: 0 !important; /* Remove rounds for full-bleed look */
        object-fit: cover !important;
    }

    /* 3. Merchant Info moves underneath */
    .brand-top {
        flex-direction: column !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    .brand-title {
        width: 100% !important;
    }

    .title-row {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }

    /* 4. Hide map on mobile or move to bottom of info */
    .mini-map-container {
        display: none !important; /* Most apps hide the map in the main header on mobile */
    }
    
   


/* --- NOTCH & SAFE AREA FIXES --- */

/* 1. Ensure the header accounts for the notch */
.namcor-customer-header-full {
    /* Safe padding at the top: Use a fallback for older browsers */
    padding-top: 20px; 
    padding-top: env(safe-area-inset-top) !important; 
    
    /* Ensure the header height expands to fit the notch space */
    height: auto !important;
    min-height: 60px;
    
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: #fff;
    box-sizing: border-box;
}

    .merchant-view-layout {
        /* This pushes the whole page down based on header + notch height */
        padding-top: calc(60px + env(safe-area-inset-top)) !important;
    }
    

 








    /* The Anchor Point */
    .cart-icon-wrapper {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* The Badge Position */
    .cart-badge {
        position: absolute;
        top: -15px;      /* Pulls it slightly above the icon */
        right: -10px;   /* Pulls it to the right of the icon */
        background: #008080; /* Standard red notification color */
        color: white;
        font-size: 10px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2px;
        border: 2px solid #fff; /* White border makes it pop against the icon */
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        z-index: 10;
    }



    .search-view-layout {
        margin-top: 100px !important;
        width: 110% !important;
        margin-left: -20px;;
    }



.search-sticky-header {
    position: fixed;
    top: 110px;
    background: #fff;
    z-index: 1000;
    /* Negate the parent's 20px padding */
    width: 105%;
    padding: 10px 20px; /* Internal spacing so bar doesn't touch glass */
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
}

    .search-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: 100%; /* Keeps it contained */
        margin: 0 auto;

    }

    .search-items-section {
        overflow: hidden; /* Prevent children from pushing the walls out */
    touch-action: pan-y; /* Allows up/down scrolling, but blocks left/right touch */
    }

    .search-input {
        width: 100%;
        /* Add your input styling here */
    }

    .search-icon {
        position: absolute;
        left: 15px;
        color: #888;
    }

    .search-input-modern {
        background: #f5f5f5;
        border: 1px solid #eee;
        padding: 12px 12px 12px 45px;
        font-size: 15px;
        outline: none;
        transition: all 0.2s;
    }

    .search-input-modern:focus {
        background: #fff;
        border-color: var(--accent);
        box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.1);
    }




    #home-dashboard-overlay {
        overflow: hidden; /* Prevent vertical scroll during slide */
    }

    .dashboard-stage-container {
        display: flex;
        width: 300%; /* 3 Stages */
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100%;
    }

    .dashboard-stage {
        width: 33.33%;
        padding: 20px;
        height: 100%;
        overflow-y: auto;
    }

    /* Uber-style Rows */
    .dash-row {
        display: flex;
        align-items: center;
        padding: 16px 0;
        border-bottom: 1px solid #f0f0f0;
        cursor: pointer;
    }

    .dash-icon-circle {
        width: 40px;
        height: 40px;
        background: #f3f3f3;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 15px;
        font-size: 18px;
    }

    .dash-info {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .dash-label {
        font-size: 12px;
        color: #888;
        font-weight: 500;
    }

    .dash-value {
        font-size: 16px;
        font-weight: 700;
        color: #000;
    }

    .dash-arrow {
        color: #ccc;
        font-size: 14px;
    }

    .btn-black-full {
        width: 100%;
        background: #000;
        color: #fff;
        padding: 16px;
        border-radius: 8px;
        font-weight: bold;
        border: none;
        margin-top: 20px;
    }


    #home-dashboard-overlay {
        position: fixed;
        bottom: -100%;
        left: 0;
        right: 0;
        margin: 0 auto; /* Force center horizontally */
        width: 100%; 
        max-width: 500px; /* Optional: Keeps it from looking too wide on tablets */
        height: 75vh;
        background: white;
        z-index: 100000;
        transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
        overflow: hidden; 
        display: block !important;
    }

    #dashboard-stages {
        display: flex;
        width: 300%; 
        height: 100%;
        margin: 0;
        padding: 0;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .dashboard-stage {
        width: 33.3333%; /* Exactly 1/3 of the 300% */
        flex-shrink: 0;
        height: 100%;
        padding: 20px;
        box-sizing: border-box; /* Ensures padding doesn't add to the width */
        overflow-y: auto;
    }

    /* Ensure the overlay is visible when active */
    #home-dashboard-overlay.active {
        bottom: 0 !important;
        display: block !important;
        visibility: visible !important;
    }

    .dashboard-slide {
        position: fixed;
        bottom: -100%; /* Start off-screen */
        left: 0;
        right: 0;
        height: 70vh;
        background: white;
        z-index: 10000;
        transition: bottom 0.4s cubic-bezier(0, 0, 0.2, 1);
    }     

    /* Hide scrollbar for the date selector */
    #dashboard-schedule-content div::-webkit-scrollbar {
        display: none;
    }

    #dashboard-schedule-content div {
        scrollbar-width: none;
    }

    /* Specific styling for the selected date */
    .date-selected {
        background: #000 !important;
        color: #fff !important;
    }


    .date-scroller {
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    .date-scroller::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .time-slot:active {
        background: #e0e0e0 !important;
        transform: scale(0.98);
    }


    /* 1. Shrink the Delivery/Pickup Toggle */
    .toggle-container {
        display: flex;
        background: #f3f3f3; /* Light grey background for the track */
        padding: 3px;
        border-radius: 8px; /* Slightly more rounded for modern look */
        gap: 2px;
    }

    .toggle-opt {
        padding: 6px 12px; /* Reduced padding from standard */
        font-size: 11px;    /* Smaller text */
        font-weight: 700;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
        background: transparent;
        color: #888;
    }

    .toggle-opt.active {
        background: #fff;
        color: #ffffff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .header-left {
        flex: 0 0 80px; /* Fixed width for logo/hamburger */
        display: flex;
        align-items: center;
    }

    .header-center {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .header-right {
        flex: 0 0 0px; /* Fixed width for the Bell */
        display: flex !important;
        justify-content: flex-end;
        align-items: center;
    }




/* 3. Hide Address & Search on Mobile Header specifically */
    .header-center .address-bar, 
    .header-center .search-container-main {
        display: none !important;
    }



.product-modal-container {
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    bottom: -50px !important;
    
}



    #modal-instructions {
        width: 100%; height: 80px; background: #f5f5f5;
        border: 1px solid #eee; padding: 12px; border-radius: 10px;
        font-family: inherit; margin-top: 10px;
    }

    /* Quantity */
    .quantity-selector-mobile {
        display: flex; align-items: center; justify-content: center;
        gap: 30px; margin-top: 25px; padding: 15px;
        background: #f9f9f9; border-radius: 12px;
    }
    .quantity-selector-mobile button {
        width: 45px; height: 45px; border-radius: 50%;
        border: 1px solid #ddd; background: #fff; font-size: 20px;
    }

    /* 4. UPSELL CAROUSEL (2 Rows) */

    .upsell-heading { padding: 0 20px; font-size: 15px; font-weight: 800; margin-bottom: 12px; }

.upsell-carousel-track {
        display: grid;
        /* Keep the 2-row layout but allow cards to breathe */
        grid-template-rows: repeat(2, 1fr);
        grid-auto-flow: column;
        /* Increased width from 280px to 320px for a more "premium" feel */
        grid-auto-columns: 320px; 
        gap: 15px; /* Slightly larger gap */
        padding: 0 20px 20px 20px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .upsell-carousel-track::-webkit-scrollbar { display: none; }

    .upsell-carousel-card {
        background: #fff; 
        border: 1px solid #f0f0f0; /* Softer border */
        border-radius: 12px; 
        overflow: hidden;
        /* Subtle shadow makes the card feel more "elevated" */
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        transition: transform 0.2s ease;
    }
    
    .upsell-carousel-card:active { transform: scale(0.98); }

    .upsell-card-inner { 
        display: flex; 
        align-items: center; 
        padding: 12px; /* Slightly tighter padding so image can be larger */
        gap: 15px; 
    }

    .upsell-card-img { 
        /* Increased from 50px to 80px - this fills the card height properly */
        width: 80px; 
        height: 80px; 
        border-radius: 10px; 
        object-fit: cover; 
        background: #f9f9f9; /* Placeholder color while loading */
        flex-shrink: 0; /* Prevents the image from squishing */
    }

    .upsell-card-info { 
        flex: 1; 
        display: flex; 
        flex-direction: column; 
        justify-content: center; /* Centers text vertically against the larger image */
        overflow: hidden; 
    }

    .upsell-card-name { 
        font-size: 15px; /* Larger font for readability */
        font-weight: 700; 
        color: #333;
        margin-bottom: 4px;
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; 
    }

    .upsell-card-price { 
        font-size: 14px; 
        color: var(--accent); 
        font-weight: 700; 
    }

    .vouchers-page{
        padding-top: 100px !important;

    }
    
    .gps-wrapper {
        margin-top: 70px !important;
    }
}


.product-modal-container {
    background: transparent !important;
}



.gps-pulse {
    width: 12px;
    height: 12px;
    background: #00e5ff; /* Namcor Teal */
    border: 2px solid #000;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.gps-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: inherit;
    border-radius: 50%;
    z-index: -1;
    animation: ripple 1.5s ease-out infinite;
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(3); opacity: 0; }
}



/* If an auth-container exists anywhere on the page, hide the nav */
body:has(.auth-container) .mobile-bottom-nav {
    display: none !important;
}

/* Ensure all auth containers are full-screen and sit on top */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 110%;
    margin-left: -20px;
    margin-top: 70px;
    height: 100vh !important; /* Force full height now that nav is hidden */
    background: #fff;
    display: flex;
    flex-direction: column;
    z-index: 10000; /* Higher than nav bar */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-card {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px 25px !important;
    box-sizing: border-box;
}











    /* 5. FIXED FOOTER */

    .sheet-v2-btn {
        width: 100%; height: 55px; border-radius: 12px; color: #fff;
        display: flex; justify-content: space-between; align-items: center;
        padding: 0 20px; font-weight: 800; border: none; font-size: 16px;
        background: #000; /* Default if not closed */
    }


 
    /* The Handle (for pull-down cue) */
    .sheet-v2-handle {
        width: 40px; height: 5px; background: #ddd;
        border-radius: 10px; margin: 12px auto; flex-shrink: 0;
    }


    /* 4. PINNED FOOTER (Stays at bottom of the 80% sheet) */
    .sheet-v2-footer {
        position: absolute;
        bottom: 0; left: 0;
        width: 100%;
        background: #fff;
        padding: 15px 20px calc(20px + env(safe-area-inset-bottom));
        border-top: 1px solid #eee;
        z-index: 10;
    }


/* When the overlay is active, the sheet slides up */
#product-modal-overlay.active .sheet-v2-wrapper {
    transform: translateY(0);
}



    #product-modal-overlay.fade-out { opacity: 0 !important; }

    #product-modal-content {
        background: transparent !important; /* Removes the white box */
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        
    }

    /* Hide legacy close buttons from the old system */
    #product-modal-overlay .close-modal, 
    #product-modal-overlay .modal-close,
    #product-modal-overlay button[onclick*="closeModal"] {
        display: none !important;
    }

/* Prevent the body from scrolling underneath */
body.modal-open {
    overflow: hidden !important;
    height: 100vh;
    touch-action: none; /* Critical for iOS background scroll */
}

/* This is the key for smooth closing */
.sheet-v2-wrapper.closing {
    transform: translateY(100%) !important;
    transition: transform 0.4s cubic-bezier(0.32, 1, 0.23, 1) !important;
}

    /* Hero & Buttons */
    .sheet-v2-hero { position: relative; height: 250px; width: 100%; }
    .sheet-v2-hero img { width: 100%; height: 100%; object-fit: cover; }
    
    .sheet-v2-close {
        position: absolute; top: 15px; left: 15px;
        width: 38px; height: 38px; background: #fff;
        border-radius: 50%; border: none;
        display: flex; align-items: center; justify-content: center;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15); z-index: 10;
    }

    .sheet-v2-fav {
        position: absolute; top: 15px; right: 15px;
        background: rgba(0,0,0,0.4); border: none;
        width: 38px; height: 38px; border-radius: 50%;
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px); display: flex;
        align-items: center; justify-content: center; z-index: 10;
    }

    /* Typography & Body */
    .sheet-v2-body { padding: 20px; }
    .sheet-v2-title { font-size: 24px; font-weight: 800; margin: 0; color: #000; }
    .sheet-v2-price { font-size: 18px; color: #000; font-weight: 700; margin: 5px 0; }
    .sheet-v2-desc { color: #666; font-size: 14px; margin-bottom: 20px; line-height: 1.4; }

    .sheet-upsell-container { margin-top: 25px; padding: 20px 0; border-top: 1px solid #eee; }









/* 1. THE OVERLAY (Background Dimmer) */
#product-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: none; /* JS toggles to flex */
    align-items: flex-end; /* Stick sheet to bottom */
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#product-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* 2. THE SHEET WRAPPER */
.sheet-v2-wrapper {
    width: 100%;
    height: 90vh !important;
    background: #fff;
    border-radius: 25px 25px 0 0;
    position: relative; /* Changed from fixed so it sits inside the flex overlay */
    display: flex;
    flex-direction: column;
    will-change: transform;
    transform: translateY(100%); /* Start hidden at bottom */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#product-modal-overlay.active .sheet-v2-wrapper {
    transform: translateY(0);
}

/* 3. THE SCROLL AREA */
.sheet-v2-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px; /* Space for footer */
}

/* 4. SPEED FIX: Force immediate movement during drag */
.sheet-v2-wrapper.dragging {
    transition: none !important;
}