/* ==================== HEADER & NAVIGATION ==================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    z-index: 1000;
    padding: 18px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    font-weight: 800;
    color: #1a1a1a;
}

.logo i {
    font-size: 30px;
    color: #00b96b;
}

.logo strong {
    color: #00b96b;
}

/* Navigation */
.nav {
    flex: 1;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #495057;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    color: #00b96b;
    background: rgba(0, 185, 107, 0.08);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
    background: rgba(0, 185, 107, 0.08);
    color: #00b96b;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions button,
.header-actions > a:not(.login-link) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: #495057;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    font-size: 18px;
    cursor: pointer;
}

.header-actions button:hover,
.header-actions > a:not(.login-link):hover {
    color: #00b96b;
}

.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #00b96b;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #ffffff;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #1a1a1a;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.mobile-menu-btn:hover {
    color: #00b96b;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown .user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    color: #495057;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-dropdown .user-btn:hover {
    background: rgba(0, 185, 107, 0.08);
    color: #00b96b;
    border-color: #00b96b;
}

.user-dropdown .user-name {
    font-family: 'Poppins', sans-serif;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 220px;
    width: min(280px, 90vw);
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.user-dropdown:hover .dropdown-menu,
.user-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #495057;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown .dropdown-menu a:last-child {
    border-bottom: none;
}

.user-dropdown .dropdown-menu a:hover {
    background: #f9f9f9;
    color: #00b96b;
}

.user-dropdown .dropdown-menu a i {
    width: 18px;
    color: #999;
}

.user-dropdown .dropdown-menu a:hover i {
    color: #00b96b;
}

.dropdown-divider {
    height: 2px;
    background: #e5e5e5;
    margin: 5px 0;
}

.user-dropdown .logout-link {
    color: #e74c3c !important;
}

.user-dropdown .logout-link:hover {
    background: #fff5f5 !important;
    color: #c0392b !important;
}

.user-dropdown .logout-link i {
    color: #e74c3c !important;
}

/* Login Link */
.login-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    background: #00b96b;
}

.login-link:hover {
    background: #00a35e;
    color: #ffffff;
}

.login-link span {
    font-family: 'Poppins', sans-serif;
}

.login-link i {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 992px) {
    .header {
        padding: 15px 0;
    }

    .nav {
        display: block !important;
        position: fixed;
        top: 72px; /* Approximate header height */
        left: -100%;
        width: 100%;
        height: calc(100vh - 72px);
        background: #ffffff;
        transition: all 0.3s ease-in-out;
        overflow-y: auto;
        padding: 20px 0;
        box-shadow: none;
        border-top: 1px solid #e9ecef;
        z-index: 990; /* Just below header (1000) */
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav.active,
    body.menu-open .nav {
        left: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .nav-menu > li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #f1f3f5;
    }
    
    .nav-menu > li > a {
        display: flex;
        justify-content: space-between;
        padding: 15px 25px;
        border-radius: 0;
        font-size: 15px;
        width: 100%;
    }

    .nav-menu > li > a:hover {
        background-color: #f8f9fa;
    }
    
    .nav .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 0;
        border: none;
        border-top: 1px solid #f1f3f5;
        box-shadow: none;
        background: #f8f9fa;
        padding: 0;
        display: none; /* Hidden by default on mobile */
    }

    .nav .dropdown.active .dropdown-menu {
        display: block !important;
    }

    .nav .dropdown-menu li a {
        padding: 12px 40px;
        font-size: 14px;
    }

    .nav .dropdown > a i {
        transition: transform 0.3s;
    }

    .nav .dropdown.active > a i {
        transform: rotate(180deg);
    }
}

@media (min-width: 993px) {
    .mobile-menu-btn {
        display: none !important;
    }

    .nav {
        position: static;
        left: 0;
        height: auto;
        overflow: visible;
        padding: 0;
    }
}
