/* ================================================
   RESPONSIVE HEADER STYLES FOR WHIMSY WISHES V2
   ================================================
   This file provides mobile-specific overrides for header.php
   Target: Mobile devices (max-width: 768px)
   ================================================ */

/* ================================
   MOBILE STYLES (≤768px)
   ================================ */
@media (max-width: 768px) {
    
    /* --------------------------------
       RESTRUCTURE TOP CONTAINER
       -------------------------------- */
    .top-container {
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 10px 15px;
        padding: 15px !important;
        align-items: center;
    }
    
    /* --------------------------------
       1. LOGO - TOP LEFT
       -------------------------------- */
    .logo {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }
    
    .logo-text {
        font-size: 20px !important;
    }
    
    .logo img {
        height: 35px !important;
    }
    
    /* --------------------------------
       2. HAMBURGER MENU - TOP RIGHT
       -------------------------------- */
    .mobile-menu-toggle {
        display: flex !important;
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        align-self: start;
        position: static !important;
        transform: none !important;
        z-index: 10;
        padding: 8px;
    }
    
    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        background: white;
        margin: 3px 0;
        transition: 0.3s;
        border-radius: 2px;
    }
    
    /* --------------------------------
       3. USER/eOW
       -------------------------------- */
    .user-cart-section {
        grid-column: 1 / 4;
        grid-row: 2;
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        align-items: center !important;
        width: 100% !important;
        gap: 15px !important;
        margin-top: 0 !important;
    }
    
    /* --------------------------------
       4. USER INFO - DIRECTLY BELOW LOGO
       -------------------------------- */
    .user-info {
        grid-column: 1;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        justify-self: start;
    }
    
    /* --------------------------------
       5. USERNAME/WELCOME MESSAGE
       -------------------------------- */
    .username {
        font-size: 14px !important;
        padding: 10px 16px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    
    /* --------------------------------
       6. HIDE LOGOUT BUTTON ON MOBILE
       -------------------------------- */
    .btn-logout,
    .logout-btn {
        display: none !important;
    }
    
    /* --------------------------------
       7. AUTH BUTTONS (for logged out users) - BELOW LOGO
       -------------------------------- */
    .auth-buttons {
        grid-column: 1;
        display: flex !important;
        gap: 10px;
        justify-self: start;
    }
    
    .auth-buttons .btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* --------------------------------
       8. CART ICON - RIGHT SIDE, ALIGNED WITH HAMBURGER
       -------------------------------- */
    .cart-icon {
        grid-column: 3;
        display: flex !important;
        position: relative;
        background: rgba(255,255,255,0.15);
        backdrop-filter: blur(10px);
        padding: 12px;
        border-radius: 50%;
        color: white;
        text-decoration: none;
        font-size: 18px;
        transition: all 0.3s ease;
        border: 1px solid rgba(255,255,255,0.2);
        flex-shrink: 0;
        justify-self: end;
    }
    
    .cart-icon:hover {
        background: rgba(255,255,255,0.25);
        transform: translateY(-2px);
    }
    
    .cart-count {
        position: absolute;
        top: -6px;
        right: -6px;
        background: #ad1457;
        color: white;
        font-size: 11px;
        font-weight: bold;
        padding: 3px 7px;
        border-radius: 50%;
        min-width: 20px;
        text-align: center;
    }
    
    /* --------------------------------
       9. HIDE DESKTOP NAV MENU
       -------------------------------- */
    .nav-menu {
        display: none !important;
    }
    
    /* --------------------------------
       10. MOBILE NAVIGATION DROPDOWN
       -------------------------------- */
    .mobile-nav {
        padding: 0;
        box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.05);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }
    
    .mobile-nav.active {
        display: block !important;
        max-height: 500px;
    }
    
    .mobile-nav a {
        display: flex;
        align-items: center;
        padding: 16px 20px;
        color: #666;
        text-decoration: none;
        border-bottom: 1px solid #f5f5f5;
        transition: all 0.3s ease;
        font-weight: 500;
    }
    
    .mobile-nav a:hover {
        background: linear-gradient(135deg, rgba(217, 26, 114, 0.08) 0%, rgba(233, 30, 99, 0.08) 100%);
        color: #d91a72;
        padding-left: 30px;
    }
    
    .mobile-nav a:last-child {
        border-bottom: none;
    }
    
    /* --------------------------------
       11. REMOVE CART FROM MOBILE MENU
       -------------------------------- */
    .mobile-nav-cart {
        display: none !important;
    }
    
    /* --------------------------------
       12. HAMBURGER ANIMATION
       -------------------------------- */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* ================================
   SMALL MOBILE STYLES (≤480px)
   ================================ */
@media (max-width: 480px) {
    
    .top-container {
        gap: 12px;
        padding: 12px 15px !important;
    }
    
    /* Logo adjustments */
    .logo-text {
        font-size: 18px !important;
    }
    
    .logo img {
        height: 30px !important;
    }
    
    /* Username truncation */
    .username {
        font-size: 13px !important;
        padding: 9px 14px !important;
        max-width: 180px;
    }
    
    /* Auth buttons */
    .auth-buttons .btn {
        padding: 9px 14px;
        font-size: 12px;
    }
    
    /* Cart icon */
    .cart-icon {
        padding: 10px !important;
        font-size: 16px !important;
    }
    
    .cart-count {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    
    /* Mobile nav spacing */
    .mobile-nav a {
        padding: 14px 15px;
        font-size: 14px;
    }
}

/* ================================
   EXTRA SMALL SCREENS (≤360px)
   ================================ */
@media (max-width: 360px) {
    
    .username {
        font-size: 12px !important;
        padding: 8px 12px !important;
        max-width: 140px;
    }
    
    .logo-text {
        font-size: 16px !important;
    }
    
    .auth-buttons {
        gap: 8px;
    }
    
    .auth-buttons .btn {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* ================================
   TABLET ADJUSTMENTS (769px - 1024px)
   ================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    
    .cart-icon {
        display: flex !important;
    }
    
    .btn-logout {
        display: inline-block !important;
    }
    
    .nav-menu a {
        padding: 18px 20px;
        font-size: 14px;
    }
}

/* ================================
   ACCESSIBILITY ENHANCEMENTS
   ================================ */
@media (max-width: 768px) {
    
    /* Focus states */
    .mobile-nav a:focus {
        outline: 2px solid #d91a72;
        outline-offset: -2px;
        background: linear-gradient(135deg, rgba(217, 26, 114, 0.1) 0%, rgba(233, 30, 99, 0.1) 100%);
    }
    
    .cart-icon:focus {
        outline: 2px solid white;
        outline-offset: 2px;
    }
    
    /* Touch target sizes */
    .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .cart-icon {
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    /* Smooth scrolling */
    .mobile-nav.active {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ================================
   PRINT STYLES
   ================================ */
@media print {
    .header,
    .mobile-menu-toggle,
    .mobile-nav,
    .cart-icon,
    .btn-logout {
        display: none !important;
    }
}