/* Mobile Header Layout */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0.75rem 1rem !important;
        align-items: stretch !important;
    }

    /* Top row: Logo, Menu button, Cart */
    .header-top-row,
    .header-mobile-top {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        order: 1 !important;
    }
    
    /* Logo positioning */
    .logo {
        font-size: 1.4rem !important;
        font-weight: 700 !important;
        order: 1 !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    /* Header actions - menu button and cart on the right */
    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        order: 3 !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    /* Mobile menu button - show on mobile */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        padding: 8px !important;
        border-radius: 6px !important;
        transition: var(--transition) !important;
    }

    .mobile-menu-btn:hover {
        background: var(--secondary) !important;
    }

    /* Search row - full width below */
    .search-box {
        order: 2 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        flex: none !important;
    }

    .search-input {
        padding: 0.75rem 3rem 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
        border: 1.5px solid var(--border) !important;
    }

    .search-input:focus {
        border-color: var(--primary) !important;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    }

    .search-btn {
        right: 8px !important;
        left: auto !important;
        background: var(--primary) !important;
        border-radius: 6px !important;
        padding: 0.5rem !important;
    }

    /* Hide desktop links on mobile */
    .header-link {
        display: none !important;
    }

    /* Cart button styling */
    .cart-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }

    /* Hide desktop navigation */
    .nav {
        display: none !important;
    }

    /* Show mobile bottom navigation */
    .mobile-bottom-nav {
        display: block !important;
    }

    /* Container adjustments */
    .container {
        padding: 0 1rem !important;
        padding-bottom: 80px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}

/* Very small screens - 360px and below */
@media (max-width: 360px) {
    .header-container {
        padding: 0.75rem 0.5rem !important;
        gap: 0.5rem !important;
    }

    .search-box {
        margin: 0 0.5rem !important;
    }

    .search-input {
        padding: 0.6rem 2.5rem 0.6rem 0.75rem !important;
        font-size: 0.85rem !important;
    }

    .cart-btn {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    .logo {
        font-size: 1.3rem !important;
    }

    .container {
        padding: 0 0.5rem !important;
        padding-bottom: 80px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* Mobile screens between 480px and 768px */
@media (max-width: 480px) {
    .header-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .logo {
        text-align: center !important;
        order: 1 !important;
    }

    .header-actions {
        order: 2 !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .search-box {
        order: 3 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}