/* =========================================
   UNIFIED MOBILE HEADER STYLES - CleanCat.ie
   Version: 3.0 - Clean Architecture
   ========================================= */

/* MOBILE ONLY STYLES */
@media (max-width: 768px) {
    
    /* === HIDE ORIGINAL DESKTOP HEADER === */
    .header {
        display: none !important;
    }
    
    /* === MAIN MOBILE HEADER CONTAINER === */
    .mobile-sticky-header-simple {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(232, 236, 242, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(0, 187, 252, 0.2);
        
        /* Layout with equal distribution */
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 10px;
        height: 60px;
        box-sizing: border-box;
        gap: 10px;
    }
    
    /* Push body content down */
    body.mobile-header-simple-active {
        padding-top: 60px !important;
    }
    
    /* === LOGO SECTION (33%) === */
    .mobile-sticky-logo-simple {
        flex: 1 1 33.33%;
        width: 33.33%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-decoration: none;
        overflow: hidden;
    }
    
    .mobile-sticky-logo-simple img {
        height: 44px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
        object-position: left center;
    }
    
    /* === SERVICES BUTTON (34%) === */
    .mobile-nav-center-simple {
        flex: 1 1 33.34%;
        width: 33.34%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Services button - good readable size when Make Order button is present */
    .mobile-sticky-header-simple:has(.mobile-make-order-btn.show) .mobile-services-btn-simple,
    .mobile-sticky-header-simple:has(.mobile-make-order-btn.show) #mobile-services-btn-simple {
        width: 100%;
        max-width: none;
        height: 44px;
        padding: 8px 12px;
        background: white !important;
        color: #000000 !important;
        border: 1px solid #007bff !important;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        white-space: pre-line;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
        transition: all 0.3s ease;
        box-sizing: border-box;
    }
    
    /* Services button - larger size when Make Order button is NOT present (cart is empty) */
    .mobile-sticky-header-simple:not(:has(.mobile-make-order-btn.show)) .mobile-services-btn-simple,
    .mobile-sticky-header-simple:not(:has(.mobile-make-order-btn.show)) #mobile-services-btn-simple {
        width: 100%;
        max-width: none;
        height: 44px;
        padding: 0 12px;
        background: white !important;
        color: #000000 !important;
        border: 1px solid #007bff !important;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 500;
        line-height: 1.1;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
        transition: all 0.3s ease;
        box-sizing: border-box;
        vertical-align: middle;
    }
    
    .mobile-services-btn-simple:hover,
    .mobile-services-btn-simple:active {
        background: #f8f9fa !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25);
    }
    
    /* === MAKE ORDER SECTION (33%) === */
    .mobile-cart-section {
        flex: 1 1 33.33%;
        width: 33.33%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    
    /* Make Order Button */
    .mobile-make-order-btn,
    #mobile-make-order-btn {
        width: 100%;
        max-width: none; /* Remove max-width limit */
        height: 44px;
        padding: 8px 12px;
        background: linear-gradient(135deg, #ff6b35, #ff8c42) !important;
        color: white !important;
        border: none;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        white-space: normal;
        display: none; /* Hidden by default */
        align-items: center;
        justify-content: center;
        gap: 6px;
        box-shadow: 0 3px 12px rgba(255, 107, 53, 0.3);
        transition: all 0.3s ease;
        box-sizing: border-box;
        cursor: pointer;
    }
    
    /* Show Make Order when has items */
    .mobile-make-order-btn.show {
        display: flex !important;
    }
    
    .mobile-make-order-btn:hover,
    .mobile-make-order-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 16px rgba(255, 107, 53, 0.4);
        background: linear-gradient(135deg, #ff8c42, #ff6b35) !important;
    }
    
    /* Order count badge */
    .mobile-order-count {
        background: rgba(255, 255, 255, 0.3);
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 700;
        flex-shrink: 0;
    }
    
    /* === CART BUTTON (COMPLETELY HIDDEN) === */
    .mobile-cart-btn-simple,
    #mobile-cart-btn-simple,
    .mobile-cart-count-simple {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        pointer-events: none !important;
    }
    
    /* === RESPONSIVE ADJUSTMENTS FOR EQUAL DISTRIBUTION === */
    /* When cart is empty - redistribute space */
    .mobile-sticky-header-simple:not(:has(.mobile-make-order-btn.show)) .mobile-sticky-logo-simple {
        flex: 1 1 40%;
        width: 40%;
    }
    
    .mobile-sticky-header-simple:not(:has(.mobile-make-order-btn.show)) .mobile-nav-center-simple {
        flex: 1 1 60%;
        width: 60%;
    }
    
    .mobile-sticky-header-simple:not(:has(.mobile-make-order-btn.show)) .mobile-cart-section {
        display: none !important;
        flex: 0 !important;
        width: 0 !important;
    }
    
    /* === SMALL SCREEN ADJUSTMENTS === */
    @media (max-width: 380px) {
        .mobile-sticky-header-simple {
            padding: 6px 8px;
            gap: 6px;
        }
        
        .mobile-services-btn-simple,
        #mobile-services-btn-simple {
            font-size: 10px;
            padding: 6px 8px;
        }
        
        .mobile-make-order-btn,
        #mobile-make-order-btn {
            font-size: 10px;
            padding: 6px 8px;
        }
        
        .mobile-sticky-logo-simple img {
            height: 36px;
        }
    }
}

/* === DESKTOP - HIDE MOBILE HEADER === */
@media (min-width: 769px) {
    .mobile-sticky-header-simple,
    .mobile-nav-center-simple,
    .mobile-services-btn-simple,
    .mobile-cart-btn-simple,
    .mobile-make-order-btn,
    .mobile-cart-section,
    .mobile-sticky-logo-simple {
        display: none !important;
        visibility: hidden !important;
    }
    
    body {
        padding-top: 0 !important;
    }
}

/* === FORCE HIDE ALL CART ICONS ON MOBILE === */
@media (max-width: 768px) {
    /* Hide any dynamically created cart elements but NOT cart modal */
    .cart-icon,
    .cart-button,
    .mobile-cart-icon,
    #cart-icon,
    #mobile-cart-icon,
    [class*="cart-icon"],
    [id*="cart-icon"]:not(.mobile-make-order-btn) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}