

        .stat-card {
    background: #075E54;
    color: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}
.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
}
.stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

        .like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #888;
    transition: transform 0.2s;
    padding: 0;
}
.like-btn:hover {
    transform: scale(1.1);
}
.like-btn.liked {
    color: #e74c3c;
}
.like-btn i {
    font-size: 1rem;
}

        .trust-item a {
        transition: color 0.2s ease, transform 0.2s ease;
        display: inline-block;
    }
    .trust-item a:hover {
        transform: translateY(-2px);
    }
        /* Custom driver marker style – truck icon */
        .driver-marker {
            background: transparent;
            border: none;
            filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
        }
        .driver-marker i {
            font-size: 30px;
            color: #ff6b00;
        }

        #trackingMap { 
            height: 300px; 
            width: 100%; 
            border-radius: 10px;
            margin: 15px 0;
        }

        .delivery-progress {
            display: flex;
            justify-content: space-between;
            margin: 10px 0;
            padding: 10px;
            background: #f0f8ff;
            border-radius: 8px;
        }
        .progress-step {
            text-align: center;
            flex: 1;
            color: #999;
        }
        .progress-step.active {
            color: var(--dark);
            font-weight: bold;
        }
        .progress-step.completed {
            color: #28a745;
        }

        /* Empty product grid state */
        .product-grid:empty {
            min-height: 400px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 20px;
        }

        :root { 
            --primary: #25D366; 
            --dark: #075E54; 
            --bg: #f4f7f6; 
            --text: #1c1e21; 
            --card: #ffffff; 
            --shadow: 0 4px 12px rgba(0,0,0,0.08);
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }
        
        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        html { scroll-behavior: smooth; }
        body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f4f8;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 70px; /* make room for bottom nav */
}
        
        /* Header Enhanced */
        header { 
            background: rgba(255, 255, 255, 0.95); 
            padding: 12px 5%; 
            position: sticky; 
            top: 0; 
            z-index: 1000; 
            box-shadow: 0 2px 15px rgba(0,0,0,0.08); 
            backdrop-filter: blur(10px);
            contain: layout; 
        }
        .nav-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
        .logo { font-size: 1.5rem; font-weight: 900; color: var(--dark); text-decoration: none; letter-spacing: -0.5px; }
        
        .nav-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
        #currencySelector, #languageSelector { padding: 6px 10px; border-radius: 8px; border: 1.5px solid #eee; outline: none; font-weight: 600; cursor: pointer; background: #fff; color: var(--dark); transition: var(--transition); }

        .search-container { position: relative; width: 100%; max-width: 550px; margin: 0 auto; }
        #searchInput { width: 100%; padding: 12px 45px 12px 20px; border-radius: 25px; border: 1.5px solid #eee; outline: none; font-size: 1rem; transition: var(--transition); background: #f9f9f9; }
        #searchInput:focus { border-color: var(--dark); background: #fff; box-shadow: 0 0 0 4px rgba(7, 94, 84, 0.1); }
        .search-container i { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: #aaa; }

        .cart-icon-wrapper { position: relative; cursor: pointer; padding: 5px; transition: transform 0.2s; }
        .cart-count { position: absolute; top: -5px; right: -8px; background: #ff3b30; color: white; font-size: 0.75rem; padding: 2px 7px; border-radius: 20px; font-weight: bold; border: 2px solid #fff; }

        /* Slider */
        .slider-wrapper { width: 100%; overflow: hidden; position: relative; height: 260px; background: #ddd; margin-bottom: 10px; }
        .slider-container { display: flex; transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1); height: 100%; }
        .slide { min-width: 100%; height: 100%; position: relative; }
        .slide img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); }
        .slide-text { position: absolute; bottom: 30px; left: 5%; color: white; text-shadow: 0 3px 10px rgba(0,0,0,0.5); font-weight: 800; font-size: 1.5rem; max-width: 80%; line-height: 1.2; }
        .btn-download { display: inline-block; margin-top: 12px; background: var(--primary); color: white; padding: 10px 20px; border-radius: 30px; text-decoration: none; font-size: 0.9rem; font-weight: 700; box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); transition: var(--transition); border: 2px solid transparent; cursor: pointer; }
        .btn-download:hover { background: #fff; color: var(--primary); transform: translateY(-2px); }

        /* App Install Popup Style */
        #appInstallBanner {
            position: fixed; bottom: 20px; left: 20px; right: 20px; 
            background: white; padding: 15px; border-radius: 15px; 
            box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
            display: none; align-items: center; justify-content: space-between; 
            z-index: 99999; border: 1px solid #eee; animation: slideUp 0.5s ease;
        }
        @keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .install-content { display: flex; align-items: center; gap: 12px; }
        .install-content i { font-size: 2rem; color: var(--dark); }
        .install-text b { display: block; font-size: 1rem; }
        .install-text span { font-size: 0.8rem; color: #666; }
        .install-actions { display: flex; gap: 10px; }
        .btn-install-now { background: var(--dark); color: white; border: none; padding: 8px 15px; border-radius: 8px; font-weight: bold; cursor: pointer; }
        .btn-close-banner { background: #f0f0f0; border: none; padding: 8px; border-radius: 8px; cursor: pointer; }

        /* Categories */
        .categories-container { display: flex; gap: 12px; overflow-x: auto; padding: 20px 5%; white-space: nowrap; scrollbar-width: none; }
        .cat-btn { padding: 10px 24px; border-radius: 30px; border: 1.5px solid #eee; background: white; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: var(--transition); color: #555; }
        .cat-btn.active { background: var(--dark); color: white; border-color: var(--dark); box-shadow: 0 4px 12px rgba(7, 94, 84, 0.2); }

        /* Product Grid */
        .shop-section { padding: 10px 5%; max-width: 1400px; margin: 0 auto; min-height: 80vh; contain: content; }
        
        /* Sorting & Region filter container */
        .filter-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            margin: 20px 0;
        }
        #sortProducts, #regionFilter {
            padding: 10px 20px;
            border-radius: 8px;
            border: 1.5px solid #eee;
            background: white;
            cursor: pointer;
            font-size: 0.9rem;
        }
        
        .product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
        .product-card { background: var(--card); border-radius: 15px; padding: 12px; border: 1px solid rgba(0,0,0,0.03); transition: var(--transition); position: relative; overflow: hidden; display: flex; flex-direction: column; }
        .product-card:hover { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0,0,0,0.1); }
        .badge { position: absolute; top: 12px; left: 12px; background: #ff4757; color: white; padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 800; z-index: 5; text-transform: uppercase; }
        .badge.new { background: var(--primary); }
        .badge.flash { background: #ff4757; animation: pulse 1s infinite; }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
        .product-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; background: #f0f0f0; margin-bottom: 12px; cursor: pointer; }
        .product-card h3 { font-size: 0.95rem; margin: 0 0 8px; height: 2.5em; overflow: hidden; font-weight: 600; color: #333; line-height: 1.3; }
        .price { font-size: 1.2rem; font-weight: 800; color: var(--dark); margin-bottom: 12px; }
        .original-price { font-size: 0.9rem; color: #999; text-decoration: line-through; margin-right: 8px; }
        .flash-price { color: #ff4757; }
        .rating { color: #ffc107; margin-bottom: 8px; }
        .rating span { color: #666; font-size: 0.8rem; margin-left: 5px; }
        .stock-status { font-size: 0.8rem; margin-bottom: 8px; color: #28a745; }
        .stock-status.low-stock { color: #ffc107; }
        .stock-status.out-of-stock { color: #dc3545; }
        .stock-status.preorder-status {
    color: #ff9800;
    font-weight: bold;
}

.product-views {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-views i {
    font-size: 0.8rem;
}

#announcementBar.hidden { display: none !important; }

.product-region {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-region i {
    font-size: 0.8rem;
}
        
        select { width: 100%; padding: 8px; margin-bottom: 10px; border-radius: 8px; border: 1.5px solid #eee; font-size: 0.85rem; background: #fbfbfb; cursor: pointer; }
        .btn-add { background: var(--dark); color: white; border: none; width: 100%; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.9rem; transition: var(--transition); margin-top: auto; }
        .btn-add:hover { background: #0a8a7a; }
        .btn-add:disabled { background: #ccc; cursor: not-allowed; }
        
        .btn-soldout { background: #999; color: white; border: none; width: 100%; padding: 12px; border-radius: 8px; font-weight: 700; cursor: not-allowed; font-size: 0.9rem; margin-top: auto; }
        
        .btn-whatsapp-product { 
            background: #25D366; 
            color: white; 
            border: none; 
            width: 100%; 
            padding: 8px; 
            border-radius: 8px; 
            margin-top: 5px;
            cursor: pointer;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        
        .btn-share {
            background: #f0f0f0;
            color: #333;
            border: none;
            width: 100%;
            padding: 8px;
            border-radius: 8px;
            margin-top: 5px;
            cursor: pointer;
            font-size: 0.8rem;
        }

        /* Skeletons */
        .skeleton { background: #eee; background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%); border-radius: 12px; background-size: 200% 100%; animation: 1.5s shine linear infinite; }
        @keyframes shine { to { background-position-x: -200%; } }
        .skeleton-img { width: 100%; aspect-ratio: 1/1; margin-bottom: 10px; }
        .skeleton-text { height: 15px; width: 80%; margin-bottom: 10px; }
        .skeleton-price { height: 20px; width: 40%; }

        /* Cart Panel */
        #cart-panel { position: fixed; top: 0; right: -100%; width: 380px; height: 100%; background: white; z-index: 2000; box-shadow: -10px 0 30px rgba(0,0,0,0.15); transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
        #cart-panel.active { right: 0; }
        .cart-header { padding: 25px; background: var(--dark); color: white; display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; font-weight: 700; }
        .cart-items { flex: 1; overflow-y: auto; padding: 20px; }
        .cart-item { display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; align-items: center; }
        .cart-item img { width: 65px; height: 65px; object-fit: cover; border-radius: 10px; background: #eee; }
        .qty-btn { border: 1.5px solid #eee; background: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-weight: bold; }
        .cart-footer { padding: 25px; border-top: 1px solid #eee; background: #fafafa; }
        .cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.3rem; margin-bottom: 20px; color: var(--dark); }
        .cart-buttons { display: flex; gap: 10px; }
        .btn-checkout { background: var(--primary); color: white; border: none; flex: 2; padding: 16px; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 12px; }
        .btn-continue { background: #f0f0f0; color: #333; border: none; flex: 1; padding: 16px; border-radius: 12px; font-weight: 600; cursor: pointer; font-size: 1rem; }
        .empty-cart-message { text-align: center; padding: 40px 20px; color: #999; }
        .empty-cart-message i { font-size: 3rem; margin-bottom: 15px; color: #ddd; }

        .load-more-btn { grid-column: 1/-1; padding: 18px; margin: 30px auto; background: var(--dark); color: white; border: none; border-radius: 12px; cursor: pointer; font-weight: bold; min-width: 200px; display: block; }
        .cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1999; display: none; }
        .cart-overlay.active { display: block; }

        /* Recently Viewed */
        .recently-viewed { margin-top: 40px; padding: 20px 5%; background: white; border-radius: 15px; }
        .recently-viewed h3 { color: var(--dark); margin-bottom: 15px; }
        .recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; }
        .recent-item { text-align: center; }
        .recent-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; }

        /* AI Chat */
        #chat-widget { position: fixed; bottom: 25px; right: 25px; z-index: 9999; }
        #chat-bubble { width: 65px; height: 65px; background: var(--dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; cursor: pointer; box-shadow: 0 8px 25px rgba(0,0,0,0.25); transition: 0.3s; }
        #chat-window { width: 350px; height: 550px; background: white; position: absolute; bottom: 85px; right: 0; border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.25); display: none; flex-direction: column; overflow: hidden; border: 1px solid #eee; opacity: 0; transform: translateY(20px); transition: 0.3s; }
        #chat-window.show { display: flex; opacity: 1; transform: translateY(0); }
        #chat-header { background: var(--dark); color: white; padding: 18px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
        .chat-close-btn { cursor: pointer; padding: 5px; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
#chat-body { flex: 1; padding: 15px; padding-bottom: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: #f8f9fb; }        .bot { background: white; align-self: flex-start; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
        .user { background: #dcf8c6; align-self: flex-end; }
.suggestion-box { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid #eee; max-height: 200px; overflow-y: auto; transition: opacity 0.3s; }        #chat-input-area { display: flex; padding: 15px; border-top: 1px solid #eee; background: white; align-items: center; }
        #chat-input-area input { flex: 1; border: none; outline: none; }

        /* Modal Styles */
        .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 5000; align-items: center; justify-content: center; }
        .modal.active { display: flex; }
        .modal-content { background: white; padding: 30px; border-radius: 15px; max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto; }

        @keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

        /* Track Order Button */
        .track-order-btn { background: var(--dark); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; margin-right: 10px; }

       .admin-login-btn {
    position: fixed;
    bottom: 170px;      /* move above chat bubble */
    right: 25px;
    background: #333;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;      /* above chat bubble (10001) */
    opacity: 0.5;        /* slightly visible, becomes fully visible on hover */
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
        /* Admin panel image upload */
#imagePreview {
    margin-top: 10px;
    text-align: center;
}

#imagePreview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid var(--dark);
}

#uploadStatus {
    padding: 5px;
    border-radius: 4px;
}

#uploadStatus i.fa-spinner {
    margin-right: 5px;
}

        /* Footer */
        footer { background: #fff; padding: 60px 5%; border-top: 1px solid #eee; margin-top: 60px; }
        .footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; max-width: 1200px; margin: 0 auto; }
        .footer-content h4 { margin-top: 0; color: var(--dark); font-size: 1.2rem; }

        /* Trust Badges */
        .trust-badges { display: flex; justify-content: center; gap: 30px; padding: 20px; background: white; margin: 20px 5%; border-radius: 10px; }
        .trust-item { text-align: center; color: #666; }
        .trust-item i { font-size: 1.5rem; color: var(--dark); margin-bottom: 5px; }

        /* Flash Sale Banner */
        .sale-banner { background: linear-gradient(135deg, #ff4757, #ff6b81); color: white; padding: 15px; text-align: center; margin: 20px 5%; border-radius: 10px; font-weight: bold; display: none; }
        .sale-banner.active { display: block; }
        .sale-banner span { background: white; color: #ff4757; padding: 5px 15px; border-radius: 20px; margin-left: 10px; }

        @media (max-width: 600px) {
            .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
            #cart-panel { width: 100%; }
            #chat-window { width: calc(100vw - 40px); height: 70vh; right: -10px; }
            #appInstallBanner { bottom: 10px; left: 10px; right: 10px; flex-direction: column; gap: 10px; align-items: flex-start; }
            .cart-buttons { flex-direction: column; }
            .trust-badges { flex-direction: column; gap: 15px; }
            .nav-actions { justify-content: center; }
            .filter-container { flex-direction: column; align-items: stretch; }
            #sortProducts, #regionFilter { width: 100%; }
        }

        .upload-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (min-width: 500px) {
    .upload-row {
        flex-direction: row;
        align-items: center;
    }
}
.upload-row input[type="file"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}
.upload-row button {
    padding: 12px 20px;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    min-width: 120px;
}

/* Product Modal Styles */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.product-modal.active {
    display: flex;
}
.product-modal .modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #e74c3c;      /* red color – stands out */
    background: white;   /* optional: white circle background */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
}
.close-modal:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.05);
}
.modal-gallery {
    margin-bottom: 20px;
}
.modal-main-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 10px;
}
.modal-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.modal-thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid #ddd;
}
.modal-thumbnails img.active-thumb {
    border-color: #075E54;
}
.modal-product-info {
    margin-bottom: 20px;
}
.modal-product-info h2 {
    margin-top: 0;
    color: #075E54;
}
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-whatsapp-modal {
    background: #25D366;
    color: white;
}
.btn-add-cart-modal {
    background: #075E54;
    color: white;
}
.btn-share-modal {
    background: #f0f0f0;
    color: #333;
}

.product-card img {
    transition: opacity 0.3s ease;
    opacity: 0;
}
.product-card img.loaded {
    opacity: 1;
}

.like-btn-modal {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #888;
    transition: transform 0.2s;
    padding: 5px 10px;
    border-radius: 20px;
}
.like-btn-modal:hover {
    transform: scale(1.05);
    background: #f5f5f5;
}
.like-btn-modal.liked {
    color: #e74c3c;
}
.like-btn-modal i {
    font-size: 1.1rem;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    padding: 8px 0 12px;
    z-index: 9998;
    border-top: 1px solid #eee;
}
.bottom-nav a {
    text-decoration: none;
    color: #888;
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    transition: color 0.2s;
}
.bottom-nav a i {
    font-size: 1.3rem;
}
.bottom-nav a.active {
    color: #075E54;
    font-weight: bold;
}

/* ===== Wallet chat widget – correct target fix ===== */

/* Let the message area shrink properly */
#cw-window #cw-body {
  min-height: 0 !important;
}

/* Limit suggestion button grid to a small, scrollable strip */
#cw-window #cw-suggestions {
  max-height: 130px !important;   /* ≈ 3 rows of buttons */
  overflow-y: auto !important;
  flex-shrink: 0 !important;
}

/* Robot bubble clearly visible above the bottom nav */
#cw-bubble {
  z-index: 10001 !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}

.bottom-nav a .nav-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

/* ========== CART PANEL – RESPONSIVE IMPROVEMENTS ========== */

/* Base cart item layout: already flex, but we ensure it wraps on small screens */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;            /* allow wrapping on very narrow screens */
    position: relative;
}

/* Product image – smaller on mobile, larger on desktop */
.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Main content area */
.cart-item > div:first-of-type {
    flex: 1;
    min-width: 0;               /* prevent overflow from long names */
}

/* Quantity controls row – touch friendly */
.cart-item .qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}
.cart-item .qty-btn:hover {
    background: #e0e0e0;
}

/* Price and remove column */
.cart-item > div:last-child {
    text-align: right;
    min-width: 80px;
}

/* Remove/trash button – make it clickable and larger */
.cart-item .remove-item {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #ff4444;
    padding: 8px;
    margin-left: 8px;
    transition: transform 0.2s;
}
.cart-item .remove-item:hover {
    transform: scale(1.2);
}

/* Mobile screens (max-width: 600px) */
@media (max-width: 600px) {
    /* Cart panel full width, slightly less padding */
    #cart-panel {
        width: 100%;
        max-width: 100%;
        padding: 0;
        border-radius: 20px 20px 0 0;
    }

    .cart-header {
        padding: 16px;
        font-size: 1.1rem;
    }

    .cart-items {
        max-height: 55vh;
    }

    /* Cart item: image smaller, layout wraps */
    .cart-item {
        padding: 10px;
        gap: 10px;
        align-items: flex-start;
    }

    .cart-item img {
        width: 70px;
        height: 70px;
    }

    /* Name and options stack */
    .cart-item > div:first-of-type h4 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cart-item > div:first-of-type small {
        font-size: 0.8rem;
    }

    /* Quantity controls on their own line */
    .cart-item > div:first-of-type > div {
        margin-top: 6px;
    }

    /* Price column */
    .cart-item > div:last-child {
        min-width: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .cart-item > div:last-child > div {
        font-size: 0.95rem;
    }

    /* Cart footer buttons stacked */
    .cart-footer {
        padding: 16px;
    }

    .cart-buttons {
        flex-direction: column;   /* stack vertically */
        gap: 10px;
    }

    .cart-buttons button {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    /* Total row */
    .cart-total {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
}

/* Very small screens (max-width: 380px) */
@media (max-width: 380px) {
    .cart-item img {
        width: 60px;
        height: 60px;
    }

    .cart-item {
        padding: 8px;
    }

    .cart-item .qty-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
}

/* Mobile AI Assistant width fixes */
#chat-window {
    width: min(100%, 420px);
    max-width: calc(100vw - 20px);
    right: 0;
}

#cw-window #cw-body {
    min-height: 0 !important;
    padding: 12px;
    padding-bottom: 130px;
}

#cw-window #cw-suggestions,
.suggestion-box,
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
}

#cw-window #cw-suggestions button,
#cw-window #cw-suggestions .suggestion-btn,
.suggestion-box button,
.quick-reply-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    padding: 12px;
    font-size: 0.85rem;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    border-radius: 8px;
}

@media (max-width: 400px) {
    #cw-window #cw-suggestions button,
    .suggestion-box button,
    .quick-reply-btn {
        flex: 1 1 100%;      /* stack full width */
    }
}

#cw-window #chat-input-area,
#chat-input-area {
    padding: 8px;
}

#cw-window #chat-input-area input,
#chat-input-area input {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 12px 16px;
}

/* Bottom nav labels – prevent overflow */
.bottom-nav a {
    font-size: 0.6rem;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .bottom-nav a {
        font-size: 0.55rem;
    }
}
   