:root { --primary-color: #ff6f00; --secondary-color: #e74c3c; --bg-color: #f4f7f6; --pink-badge: #d63384; --green-real: #2e7d32; --whatsapp-color: #25d366; --fb-blue: #1877f2; }
        body { font-family: 'Cairo', sans-serif; background-color: var(--bg-color); margin: 0; padding: 0; }
        .container { max-width: 1400px; margin: auto; padding: 5px; padding-bottom: 160px; }
        
        .item-header { display: flex; align-items: center; gap: 24px; max-width: 1100px; margin: 0 auto 8px; padding: 10px 10px 6px; box-sizing: border-box; }
        .item-header-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
        .item-header-logo { display: flex; align-items: center; flex-shrink: 0; }
        .item-header-logo img { display: block; width: 115px; height: auto; }
        .search-wrapper { background: #fff; padding: 0; border-radius: 10px; margin: 0; display: flex; align-items: center; position: relative; border: 0; flex: 1; min-width: 0; }
        .search-wrapper i.fa-search { color: #888; position: absolute; right: 25px; font-size: 1.1em; }
        .search-input { width: 100%; height: 44px; box-sizing: border-box; padding: 8px 40px; border: 1px solid #e0e0e0; border-radius: 10px; font-family: 'Cairo', sans-serif; font-size: 16px; outline: none; transition: 0.3s ease; background-color: #fff; }
        .search-input:focus { border-color: var(--primary-color); background-color: #fff; box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.1); }
        .clear-search-btn { position: absolute; left: 25px; color: #aaa; cursor: pointer; display: none; font-size: 1.1em; transition: 0.2s; }
        .clear-search-btn:hover { color: var(--secondary-color); }
        .item-header .search-wrapper i.fa-search { right: 14px; font-size: 15px; }
        .item-header .clear-search-btn { left: 14px; }
        @media (max-width: 640px) {
            .item-header { gap: 10px; padding: 6px 7px 4px; margin-bottom: 4px; }
            .item-header-logo img { width: 88px; }
            .item-header .search-input { padding-right: 34px; padding-left: 32px; }
        }
        .no-results-found { display: none; text-align: center; padding: 50px 20px; font-weight: bold; color: #777; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); margin-bottom: 30px; }

        .category-tabs-container { 
            position: sticky; 
            top: 0; 
            background: rgba(244, 247, 246, 0.96); 
            backdrop-filter: blur(4px);
            padding: 12px 0; 
            z-index: 9999 !important; 
            margin-bottom: 25px; 
            border-bottom: 1px solid #e2e8f0;
        }
        .category-tabs { 
            display: flex; 
            gap: 10px; 
            overflow-x: auto; 
            padding: 2px 15px; 
            scrollbar-width: none; 
            justify-content: center; 
        }
        .category-tabs::-webkit-scrollbar { display: none; }
        
        .main-cat-wrapper { display: inline-block; }
        .tab-btn { background: #fff; border: 1px solid #cbd5e1; padding: 9px 24px; border-radius: 25px; font-family: 'Cairo'; font-weight: bold; font-size: 0.9em; cursor: pointer; transition: 0.2s; white-space: nowrap; color: #475569; box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; align-items: center; gap: 8px; }
        .tab-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
        .tab-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
        
        .sub-cats-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 999999 !important;
            justify-content: center;
            align-items: center;
        }
        .sub-cats-modal-content {
            background: #fff;
            padding: 24px;
            border-radius: 16px;
            width: 92%;
            max-width: 580px; 
            box-shadow: 0 20px 30px rgba(0,0,0,0.2);
            text-align: center;
            animation: modalScaleUp 0.2s ease-out;
            position: relative;
        }
        @keyframes modalScaleUp {
            from { transform: scale(0.92); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }
        
        .sub-cats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr); 
            gap: 12px;
            margin-top: 20px;
            padding: 2px;
        }

        .sub-modal-item-btn {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            padding: 14px 16px;
            border-radius: 10px;
            font-family: 'Cairo';
            font-weight: bold;
            font-size: 0.92em;
            color: #334155;
            cursor: pointer;
            transition: 0.2s;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        }
        .sub-modal-item-btn:hover {
            background: #fff3e0;
            border-color: var(--primary-color);
            color: var(--primary-color);
        }
        .sub-modal-item-btn.active {
            background: var(--primary-color);
            border-color: var(--primary-color);
            color: #fff;
        }

        @media (max-width: 480px) { 
            .sub-cats-grid {
                grid-template-columns: repeat(2, 1fr); 
                gap: 8px;
            }
            .sub-modal-item-btn {
                font-size: 0.85em;
                padding: 12px 8px;
            }
        }

        @media (max-width: 992px) { 
            .category-tabs { justify-content: flex-start; } 
        }

        .model-section { margin-bottom: 40px; position: relative; z-index: 1; }
        .model-title-header { background: #fff; padding: 12px 20px; border-radius: 8px; margin-bottom: 15px; font-size: 1.2em; font-weight: bold; color: #333; border-right: 5px solid var(--primary-color); box-shadow: 0 2px 5px rgba(0,0,0,0.03); }

        .product-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
        @media (max-width: 992px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

        .product-card { font-size: 15px; background: #fff; border-radius: 12px; padding: 15px; text-align: center; position: relative; border: 2px solid transparent; transition: border-color 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: flex; flex-direction: column; justify-content: space-between; transform: none !important; }
        .product-card.selected { border-color: #27ae60; background: #f4fcf6; }
        .product-card.selected.qty-alert { border-color: var(--secondary-color); animation: pulseAlert 0.4s ease; }
        .product-card.out-of-stock { opacity: 0.8; filter: grayscale(0.7); }
        @keyframes pulseAlert { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
        
        .check-badge { position: absolute; top: 10px; right: 10px; background: var(--primary-color); color: #fff; width: 25px; height: 25px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 0.8em; z-index: 5; }
        .product-card.selected .check-badge { display: flex; background: #27ae60; }
        
        .image-container { position: relative; width: 100%; height: 220px; overflow: hidden; cursor: pointer; }
        .image-container img { width: 100%; height: 100%; object-fit: contain; display: block; }

        .badges-wrapper-block { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; margin-top: 8px; width: 100%; }

        .shipping-badge { display: inline-flex; align-items: center; gap: 5px; background: #fff5e6; color: var(--primary-color); padding: 4px 14px; border-radius: 20px; font-size: 0.78em; font-weight: bold; border: 1px solid #ffe0b2; width: fit-content; margin: 0 auto; }
        .out-of-stock-badge { position: absolute; top: 10px; left: 10px; background: var(--secondary-color); color: #fff; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.75em; z-index: 10; }
        
        .video-badge { position: absolute; top: 10px; right: 10px; background: var(--fb-blue); color: #fff; padding: 6px 12px; border-radius: 20px; font-weight: bold; font-size: 0.75em; z-index: 2; display: flex; align-items: center; gap: 5px; animation: bounceVideo 2s infinite ease-in-out; box-shadow: 0 3px 8px rgba(24,119,242,0.4); cursor: pointer; transition: transform 0.2s; }
        .video-badge:hover { transform: scale(1.05); background: #145dbf; }
        @media (max-width: 992px) { .video-badge { animation: none; } }

        .stock-info { margin: 10px 0; font-size: 0.85em; font-weight: bold; }
        .progress-bar { background: #eee; border-radius: 10px; height: 6px; width: 100%; margin-top: 5px; overflow: hidden; }
        .progress-fill { background: var(--primary-color); height: 100%; }
        .progress-fill.low { background: var(--secondary-color); height: 100%; }
        @keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

        .real-images-btn { display: inline-flex; align-items: center; gap: 6px; background: #e8f5e9; color: var(--green-real); border: 1px dashed #a5d6a7; padding: 5px 14px; border-radius: 20px; font-family: 'Cairo'; font-weight: bold; font-size: 0.82em; cursor: pointer; transition: 0.2s ease; outline: none; width: fit-content; margin: 0 auto; }
        .real-images-btn:hover { background: var(--green-real); color: #fff; border-style: solid; }

        .price-section { margin: 10px 0; font-size: 0.9em; }
        .price-row { display: flex; justify-content: center; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 5px; }
        .price-old-val { text-decoration: line-through; color: #888; font-weight: bold; }
        .price-new-val { color: var(--secondary-color); font-weight: bold; font-size: 1.2em; }
        
        .action-container { margin-top: auto; display: flex; flex-direction: column; gap: 10px; width: 100%; }
        .qty-wrapper { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 2px; }
        .qty-btn { background: #eee; border: none; width: 32px; height: 32px; border-radius: 5px; cursor: pointer; font-weight: bold; }
        .qty-input { width: 40px; text-align: center; border: 1px solid #ddd; border-radius: 5px; padding: 4px; font-weight: bold; }
        .qty-max-msg { font-size: 10px; color: var(--secondary-color); font-weight: bold; display: none; margin-top: -3px; }
        
        .buttons-row { display: flex; flex-direction: column; gap: 8px; width: 100%; }
        .add-to-cart-btn { background: var(--primary-color); color: #fff; border: none; padding: 11px 10px; border-radius: 8px; font-family: 'Cairo'; font-weight: bold; font-size: 0.92em; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s; width: 100%; box-shadow: 0 2px 6px rgba(255, 111, 0, 0.15); box-sizing: border-box; }
        .add-to-cart-btn:hover { background: #e66400; }
        .product-card.selected .add-to-cart-btn { background: #27ae60; box-shadow: 0 2px 6px rgba(39, 174, 96, 0.15); }

        .ask-whatsapp-btn { background: transparent; color: #555; border: 1px solid #ccc; padding: 8px 10px; border-radius: 8px; font-family: 'Cairo'; font-weight: bold; font-size: 0.85em; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s; width: 100%; text-decoration: none; box-sizing: border-box; }
        .ask-whatsapp-btn:hover { background: #f5f5f5; color: #333; border-color: #999; }
        .ask-whatsapp-btn i { color: var(--whatsapp-color); font-size: 1.1em; }

        .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 30000000; justify-content: center; align-items: center; }
        .modal-content { background: #fff; padding: 25px; border-radius: 15px; width: 92%; max-width: 500px; max-height: 85vh; overflow-y: auto; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
        .close-modal { position: absolute; top: 10px; right: 15px; font-size: 1.8em; cursor: pointer; color: #888; z-index: 10; }
        
        .video-container-wrapper { position: relative; width: 100%; background: #000; border-radius: 10px; margin-bottom: 15px; display: none; overflow: hidden; min-height: 250px; }
        .video-container-wrapper .fb-video { width: 100% !important; display: block; height: auto !important; }

        .slider-wrapper { position: relative; width: 100%; height: 280px; margin-bottom: 15px; border-radius: 10px; background: #f9f9f9; overflow: hidden; display: flex; align-items: center; justify-content: center; }
        .slider-wrapper img { position: absolute; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.4s ease; display: none; }
        .slider-wrapper img.active { opacity: 1; display: block; }
        
        .slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.4); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1em; z-index: 15; transition: 0.2s; }
        .slider-arrow:hover { background: rgba(0, 0, 0, 0.7); }
        .slider-arrow.prev { right: 10px; }
        .slider-arrow.next { left: 10px; }
        
        .slider-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 15; }
        .slider-dot { width: 8px; height: 8px; background: rgba(0,0,0,0.2); border-radius: 50%; cursor: pointer; transition: 0.2s; }
        .slider-dot.active { background: var(--primary-color); width: 18px; border-radius: 4px; }

        .checkout-modal-content { text-align: right; padding: 30px 20px; }
        .checkout-modal-content h2 { text-align: center; margin-bottom: 20px; font-size: 1.4em; color: #333; }
        .form-group-popup { margin-bottom: 15px; }
        .form-group-popup input { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 10px; box-sizing: border-box; font-family: 'Cairo'; font-size: 1em; outline: none; transition: 0.3s; }
        .form-group-popup input:focus { border-color: var(--primary-color); box-shadow: 0 0 5px rgba(255, 111, 0, 0.2); }
        .modal-desc { text-align: right; font-size: 0.95em; color: #555; line-height: 1.6; border-top: 1px solid #eee; padding-top: 15px; margin-top: 15px; }

        #duplicate-msg { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; padding: 30px; border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); z-index: 400000; text-align: center; width: 90%; max-width: 400px; }
        .overlay { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); z-index:199999; }
        
        .sticky-footer { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; padding: 12px 15px; text-align: center; box-shadow: 0 -5px 15px rgba(0,0,0,0.1); z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; }
        .order-btn { background: var(--primary-color); color: #fff; border: none; padding: 12px 20px; border-radius: 30px; font-weight: bold; font-size: 1.1em; cursor: pointer; width: 95%; max-width: 480px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: 0.2s ease; }

        .shipping-promo-wrapper { width: 100%; max-width: 450px; text-align: center; }
        .shipping-promo-text { font-size: 0.85em; font-weight: bold; color: #e67e22; margin-bottom: 4px; display: block; }
        .shipping-promo-text.success { color: #27ae60; }
        .shipping-progress-container { background: #eee; border-radius: 10px; height: 8px; width: 100%; overflow: hidden; border: 1px solid #e0e0e0; }
        .shipping-progress-bar { background: linear-gradient(90deg, #ffaa00, var(--primary-color)); height: 100%; width: 0%; transition: width 0.4s ease; }
        .shipping-progress-bar.success { background: #2cc76b; }

        .whatsapp-float-btn { position: fixed; bottom: 120px; left: 20px; background-color: #25d366; color: #fff; width: 60px; height: 60px; border-radius: 50px; text-align: center; font-size: 30px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 2000; display: flex; align-items: center; justify-content: center; text-decoration: none; }
        .whatsapp-float-btn:hover { transform: scale(1.1); color: #fff; }
        .loading-trigger { text-align: center; padding: 20px; font-weight: bold; color: #666; grid-column: 1 / -1; display: none; }

/* Compact product/category labels and a single-line checkout action. */
.model-title-header { font-size: 15px; padding: 9px 14px; margin-bottom: 12px; }
.tab-btn { font-size: 12px; padding: 7px 16px; }
.sticky-footer .order-btn { box-sizing: border-box; width: 100%; max-width: 480px; font-family: 'Cairo', sans-serif; font-size: 13px; padding: 10px 8px; gap: 0; min-height: 44px; }
#main-order-btn-text { white-space: nowrap; line-height: 1.8; }
@media (max-width: 640px) {
    .sticky-footer { padding: 9px 10px; gap: 6px; }
    .sticky-footer .order-btn { font-size: clamp(10px, 3vw, 13px); }
    .model-title-header { font-size: 14px; }
    .shipping-promo-text { font-size: 11px; line-height: 1.7; }
}
