/* =========================================
   HEADER BASE STYLES
   ========================================= */
.site-header {
    background: #ffffff; padding: 10px 0; position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); width: 100%;
}
.header-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
}

/* Logo & Title */
.header-logo-group { display: flex; align-items: center; text-decoration: none; gap: 10px; }
.header-logo-img { height: 50px; width: auto; }
.header-site-title { font-size: 1.5rem; font-weight: 800; color: #2c3e50; margin: 0; white-space: nowrap; font-family: 'Montserrat', sans-serif;}
.header-site-title span { font-weight: 300; color: #f39c12; margin-left: 5px; }

/* =========================================
   DESKTOP NAVIGATION (HOVER DROPDOWN)
   ========================================= */
.header-nav-container { display: flex; align-items: center; flex-grow: 1; }
.header-nav-links { display: flex; list-style: none; margin: 0 0 0 30px; padding: 0; gap: 25px; }

.header-nav-links li { position: relative; padding: 15px 0; }
.header-nav-links li a { 
    text-decoration: none; color: #2c3e50; font-weight: 700; font-size: 0.9rem; 
    text-transform: uppercase; transition: 0.3s;
}
.header-nav-links li a:hover { color: #f39c12; }

.menu-item-has-children > a::after {
    content: '▾'; margin-left: 5px; color: #f39c12; font-size: 0.8rem;
}

/* Sub-Menu Styles */
.header-nav-links .sub-menu {
    position: absolute; top: 100%; left: 0;
    background: #ffffff; min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px; padding: 10px 0; margin: 0;
    list-style: none; border-top: 3px solid #f39c12;
    z-index: 999;
    opacity: 0; visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    display: block !important;
}

@media (min-width: 992px) {
    .header-nav-links li:hover > .sub-menu {
        opacity: 1; visibility: visible; transform: translateY(0);
    }
}

.sub-menu li { padding: 0 !important; margin: 0 !important; width: 100%; }
.sub-menu li a {
    padding: 12px 20px !important; display: block !important;
    font-size: 0.85rem !important; color: #2c3e50 !important;
    border-bottom: 1px solid #f9f9f9;
}
.sub-menu li a:hover {
    background: #fdf2e2 !important; color: #f39c12 !important; padding-left: 25px !important;
}

.header-actions-wrapper {
    display: flex; align-items: center; gap: 15px; margin-left: auto;
}

/* =========================================
   MOBILE VIEW (< 991px) - MASTER FIX
   ========================================= */
.header-menu-toggle, .header-close-btn { display: none; }

@media (max-width: 991px) {
    .header-container {
        padding: 0 15px; /* Thodi jagah bachane ke liye padding kam ki */
    }
    
    /* 🔥 FIX 1: Logo group ki cha चौड़ाई fix ki taaki nav button ko jagah mile */
    .header-logo-group {
        max-width: 80%; 
    }
    
    /* 🔥 FIX 2: Text ko lachila (flexible) banaya */
    .header-site-title { 
        font-size: 1.15rem !important; 
        white-space: normal !important; /* Lamba text hone par chipne ki jagah wrap ho jayega */
        line-height: 1.2;
    }
    
    /* 🔥 FIX 3: Nav Button ko ziddi banaya taaki wo kabhi chhipe na */
    .header-menu-toggle { 
        display: flex !important; flex-direction: column; gap: 5px; 
        background: none; border: none; cursor: pointer; padding: 5px;
        flex-shrink: 0 !important; /* Ye button ko dabne/chhipne nahi dega */
        margin-left: auto;
    }
    .header-menu-toggle span { width: 28px; height: 3px; background: #2c3e50; border-radius: 2px; }
    
    .header-nav-container {
        position: fixed; top: 0; right: -320px; width: 300px; height: 100vh;
        background: #ffffff; flex-direction: column; padding: 80px 20px;
        transition: 0.3s; z-index: 2000; box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        display: flex; align-items: flex-start; overflow-y: auto;
    }
    .header-nav-container.active { right: 0; }
    .header-close-btn { display: block; position: absolute; top: 20px; right: 20px; font-size: 35px; background: none; border: none; color: #2c3e50; cursor: pointer;}
    
    .header-nav-links { flex-direction: column; width: 100%; gap: 0; margin: 0; }
    .header-nav-links li { width: 100%; border-bottom: 1px solid #eee; padding: 15px 0; }
    
    .header-nav-links .sub-menu {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; padding-left: 20px; background: #f9f9f9;
        display: block !important; margin-top: 10px;
    }
    
    .header-actions-wrapper { 
        margin: 30px 0 0 0; width: 100%; flex-direction: column; align-items: stretch; gap: 15px;
    }
    
    .cf-user-menu { flex-direction: column; width: 100%; gap: 15px !important; }
    .header-actions-wrapper a { text-align: center; justify-content: center; width: 100%; box-sizing: border-box; display: block !important; }
}

/* 🔥 FIX 4: Extremely Small Phones (< 480px) */
@media (max-width: 480px) {
    .header-logo-img { height: 38px; } /* Logo icon thoda chota kiya */
    .header-site-title { font-size: 0.95rem !important; } /* Font size aur adjust ki */
    .header-logo-group { gap: 6px; }
}