/* ============================================
   OnlinePharmacy - Header Component Styles
   Blur effect, 80px height, responsive
   ============================================ */

/* Global: barcha sahifada header ostida content boshlansin */
body {
    padding-top: 80px;
}

/* --- Main Header --- */
header.site-header {
    height: 80px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    /* Search inputlar ko'rinib turishi uchun overflow yashirilmaydi */
    overflow: visible;
}

header.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Logo (Left) --- */
.header-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, #6a00f4 0%, #b084f4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin: 0;
}

/* --- Nav Links (Center) --- */
.header-nav {
    display: flex;
    align-items: center;
}

.header-nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.header-nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.header-nav-link:hover {
    color: #6a00f4;
    background: rgba(106, 0, 244, 0.06);
}

.header-nav-link.active {
    background: linear-gradient(90deg, #6a00f4 0%, #b084f4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.header-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #6a00f4 0%, #b084f4 100%);
    border-radius: 2px;
}

/* --- Actions Block (Right) --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative; /* Added for dropdown positioning */
}

/* NOTE: Account Dropdown Button Styles */
#account-dropdown-container {
    position: relative;
}

#account-dropdown-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

#account-dropdown-button:hover {
    background: rgba(106, 0, 244, 0.04);
}

#account-dropdown-button .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #6a00f4; /* Highlight avatar border */
}

#account-dropdown-button #username-display {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

/* NOTE: Account Dropdown Menu Styles */
#account-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    width: 220px;
    list-style: none;
    margin: 12px 0 0 0; /* Increased margin for more spacing */
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 999;
}

#account-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#account-dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 12px; /* Increased gap for better icon spacing */
    padding: 12px 18px; /* Adjusted padding */
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#account-dropdown-menu li a:hover {
    background: rgba(106, 0, 244, 0.06);
    color: #6a00f4;
}

/* --- Login Button --- */
.btn-login-header {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #6a00f4 0%, #b084f4 100%);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(106, 0, 244, 0.2);
}

.btn-login-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 0, 244, 0.35);
}

/* --- Cart --- */
.header-cart {
    display: flex;
    align-items: center;
}

.cart-link {
    text-decoration: none;
    position: relative;
    color: #333;
    font-size: 20px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* --- Hamburger Menu (Mobile) --- */
.header-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border: none;
    background: transparent;
    z-index: 1100;
}

.header-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.header-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.header-hamburger.active span:nth-child(2) { opacity: 0; }
.header-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Mobile Overlay --- */
.header-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1040;
}
.header-overlay.active { display: block; }

/* NOTE: Page Loader Styles */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure it's on top of everything */
    transition: opacity 0.5s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #6a00f4; /* Primary color */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Responsive */
@media (max-width: 768px) {
    .header-hamburger { display: flex; }
    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 100px 30px 30px;
        transition: right 0.4s ease;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
        z-index: 1050;
    }
    .header-nav.mobile-open { right: 0; }
    .header-nav-menu { flex-direction: column; gap: 10px; width: 100%; }
    .header-nav-link { display: block; padding: 12px; font-size: 16px; width: 100%; }
    .header-nav-link.active::after { display: none; }

    .header-right {
        position: static; /* Reset position for mobile */
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        width: 100%;
        margin-top: 20px;
    }

    /* NOTE: Adjust account dropdown for mobile */
    #account-dropdown-container {
        width: 100%;
    }

    #account-dropdown-button {
        width: 100%;
        justify-content: flex-start;
    }

    #account-dropdown-menu {
        position: static; /* Reset position for mobile */
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0;
        transform: translateY(0);
        opacity: 1; /* Always visible on mobile when parent is shown */
        visibility: visible; /* Always visible on mobile when parent is shown */
        margin-top: 10px;
    }

    .btn-login-header {
        width: 100%;
        text-align: center;
    }
}

/* UI Cleanup: Sticker elementlarni yashirish */
.sticker, .badge, .chip, .promo, .floating-badge, .ribbon, .label, .sale-badge, .new-badge, .product-badge, .category-label, .trust-badge {
    display: none !important;
}