/* ==========================================================
   ========== HEADER.CSS - طراحی مدرن 2026 ==========
   ========================================================== */

/* ----- 1. Top Bar (نوار بالایی) ----- */
.top-bar {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.35rem 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: 0 var(--container-padding, 1rem);
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.top-bar-left span i {
    color: var(--primary, #e86878);
    margin-left: 4px;
}

.top-bar-divider {
    color: rgba(255, 255, 255, 0.1);
}

.top-bar-right a {
    color: rgba(255, 255, 255, 0.4);
    transition: var(--transition-base, 0.3s ease);
    font-size: 0.85rem;
}
.top-bar-right a:hover {
    color: var(--primary, #e86878);
}

.top-bar-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

/* ----- 2. Main Header (هدر اصلی) ----- */
.main-header {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: var(--transition-base, 0.3s ease);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: 0 var(--container-padding, 1rem);
}

/* ----- 3. لوگو ----- */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo img {
    height: clamp(28px, 4vw, 35px);
    width: auto;
}

.header-logo span {
    font-family: var(--font-display, 'Orbitron', 'Segoe UI', sans-serif);
    font-size: clamp(0.95rem, 2vw, 1.3rem);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.header-logo span span {
    color: var(--primary, #e86878);
}

/* ----- 4. نوار جستجو ----- */
.header-search {
    flex: 1;
    max-width: 480px;
    margin: 0 0.5rem;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition-base, 0.3s ease);
    padding: 0 0.3rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.search-wrapper:focus-within {
    border-color: var(--primary, #e86878);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 30px rgba(232, 104, 120, 0.08), 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: scale(1.01);
}

.search-icon {
    color: rgba(255, 255, 255, 0.3);
    padding: 0 0.8rem;
    font-size: 0.9rem;
    transition: var(--transition-fast, 0.15s ease);
}
.search-wrapper:focus-within .search-icon {
    color: var(--primary, #e86878);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem 0;
    color: #fff;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    outline: none;
    min-width: 100px;
}
.search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-btn {
    background: var(--primary, #e86878);
    border: none;
    border-radius: 50px;
    color: #fff;
    padding: 0.4rem 1.2rem;
    cursor: pointer;
    transition: var(--transition-spring, 0.5s cubic-bezier(0.34, 1.56, 0.64, 1));
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(232, 104, 120, 0.2);
}
.search-btn:hover {
    background: var(--primary-dark, #d15a6a);
    transform: scale(1.04);
    box-shadow: 0 6px 25px rgba(232, 104, 120, 0.3);
}
.search-btn:active {
    transform: scale(0.96);
}

/* ----- 5. بخش راست هدر (اکشن‌ها) ----- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

/* سبد خرید */
.header-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 5vw, 42px);
    height: clamp(32px, 5vw, 42px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: #ccc;
    text-decoration: none;
    transition: var(--transition-spring, 0.5s cubic-bezier(0.34, 1.56, 0.64, 1));
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.header-cart:hover {
    background: rgba(232, 104, 120, 0.1);
    color: var(--primary, #e86878);
    border-color: rgba(232, 104, 120, 0.25);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), var(--neon-glow, 0 0 30px rgba(232, 104, 120, 0.15));
}
.header-cart:active {
    transform: scale(0.92);
}
.header-cart i {
    font-size: clamp(0.8rem, 1.2vw, 1.1rem);
}

.header-cart .cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary, #e86878);
    color: #fff;
    border-radius: 50%;
    padding: 0.1rem 0.35rem;
    font-size: clamp(0.5rem, 0.7vw, 0.6rem);
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--bg-primary, #0a0a0a);
    box-shadow: 0 2px 8px rgba(232, 104, 120, 0.4);
}

/* ----- 6. احراز هویت ----- */
.header-auth {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 600;
    transition: var(--transition-spring, 0.5s cubic-bezier(0.34, 1.56, 0.64, 1));
    border: none;
    cursor: pointer;
}

.login-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.login-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.register-btn {
    background: var(--primary, #e86878);
    color: #fff;
    box-shadow: 0 4px 15px rgba(232, 104, 120, 0.25);
}
.register-btn:hover {
    background: var(--primary-dark, #d15a6a);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 30px rgba(232, 104, 120, 0.35);
}

/* ----- 7. دراپ‌داون کاربر ----- */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 1rem 0.35rem 0.8rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #ccc;
    cursor: pointer;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    transition: var(--transition-spring, 0.5s cubic-bezier(0.34, 1.56, 0.64, 1));
}
.user-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateY(-2px);
    border-color: rgba(232, 104, 120, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.user-btn i:first-child {
    color: var(--primary, #e86878);
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
}
.user-btn i:last-child {
    font-size: 0.6rem;
    margin-right: 2px;
    transition: var(--transition-base, 0.3s ease);
}
.user-dropdown:hover .user-btn i:last-child {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 110%;
    left: 0;
    min-width: 200px;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.4rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    transition: var(--transition-base, 0.3s ease);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), var(--neon-glow, 0 0 30px rgba(232, 104, 120, 0.05));
    z-index: 1001;
}
.user-dropdown:hover .user-dropdown-menu,
.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 1.2rem;
    color: #ccc;
    text-decoration: none;
    transition: var(--transition-fast, 0.15s ease);
    font-size: 0.85rem;
    border-left: 2px solid transparent;
}
.user-dropdown-menu a:hover {
    background: rgba(232, 104, 120, 0.08);
    color: #fff;
    border-left-color: var(--primary, #e86878);
}
.user-dropdown-menu a i {
    width: 20px;
    font-size: 0.9rem;
    color: var(--text-muted, #6a6464);
    transition: var(--transition-fast, 0.15s ease);
}
.user-dropdown-menu a:hover i {
    color: var(--primary, #e86878);
}
.user-dropdown-menu .logout-btn {
    color: #e74c3c;
}
.user-dropdown-menu .logout-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-left-color: #e74c3c;
}
.user-dropdown-menu .logout-btn i {
    color: #e74c3c;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.3rem 0.8rem;
}

/* ----- 8. نوار ناوبری (Navbar) ----- */
.navbar {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.4rem 0;
    position: sticky;
    top: clamp(62px, 10vh, 72px);
    z-index: 998;
    transition: var(--transition-base, 0.3s ease);
}
.navbar.scrolled {
    background: rgba(10, 10, 10, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    top: 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: 0 var(--container-padding, 1rem);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    transition: var(--transition-base, 0.3s ease);
    font-size: clamp(0.8rem, 0.9vw, 0.85rem);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary, #e86878);
    transition: var(--transition-base, 0.3s ease);
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(232, 104, 120, 0.3);
}
.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}
.nav-link:hover::after {
    width: 60%;
}
.nav-link.active {
    color: var(--primary, #e86878);
    background: rgba(232, 104, 120, 0.08);
}
.nav-link.active::after {
    width: 60%;
}
.nav-link i {
    font-size: 0.8rem;
}

/* ----- 9. دراپ‌داون در نوار ناوبری ----- */
.dropdown {
    position: relative;
}
.dropdown-toggle {
    cursor: pointer;
}
.dropdown-arrow {
    font-size: 0.5rem;
    margin-right: 3px;
    transition: var(--transition-base, 0.3s ease);
}
.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    right: 0;
    min-width: 200px;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.4rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    transition: var(--transition-base, 0.3s ease);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), var(--neon-glow, 0 0 30px rgba(232, 104, 120, 0.05));
    z-index: 1001;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.45rem 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition-fast, 0.15s ease);
    font-size: 0.82rem;
    border-left: 2px solid transparent;
}
.dropdown-menu li a:hover {
    background: rgba(232, 104, 120, 0.08);
    color: #fff;
    border-left-color: var(--primary, #e86878);
}
.dropdown-menu li a i {
    width: 20px;
    font-size: 0.85rem;
    color: var(--text-muted, #6a6464);
    transition: var(--transition-fast, 0.15s ease);
}
.dropdown-menu li a:hover i {
    color: var(--primary, #e86878);
}

/* ----- 10. دکمه همبرگر (موبایل) ----- */
.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition-base, 0.3s ease);
    padding: 0.3rem;
    border-radius: 8px;
}
.nav-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================
   ========== واکنش‌گرایی ==========
   ========================================================== */

@media (max-width: 1024px) {
    .header-search {
        max-width: 320px;
    }
    .search-input {
        font-size: 0.8rem;
    }
    .search-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    /* Top Bar */
    .top-bar {
        display: none;
    }

    /* Main Header */
    .main-header {
        padding: 0.4rem 0;
        position: sticky;
        top: 0;
    }
    .header-container {
        gap: 0.8rem;
        flex-wrap: wrap;
    }
    .header-logo img {
        height: 28px;
    }
    .header-logo span {
        font-size: 0.95rem;
    }

    .header-search {
        order: 3;
        max-width: 100%;
        flex: 0 0 100%;
        margin: 0;
    }
    .search-wrapper {
        padding: 0 0.2rem;
    }
    .search-input {
        padding: 0.5rem 0;
        font-size: 0.85rem;
    }
    .search-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }

    .header-actions {
        gap: 0.4rem;
    }
    .header-cart {
        width: 36px;
        height: 36px;
    }
    .header-cart i {
        font-size: 0.9rem;
    }
    .auth-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
    }
    .register-btn {
        display: none;
    }

    /* Navbar */
    .navbar {
        position: sticky;
        top: clamp(85px, 12vh, 110px);
        padding: 0.3rem 0;
    }
    .nav-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(10, 10, 10, 0.98);
        padding: 0.5rem;
        border-radius: 12px;
        margin-top: 0.3rem;
        gap: 0.1rem;
        border: 1px solid rgba(255, 255, 255, 0.04);
        max-height: 70vh;
        overflow-y: auto;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-container {
        flex-wrap: wrap;
    }
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        width: 100%;
        border-radius: 6px;
    }
    .nav-link::after {
        display: none;
    }
    .nav-link.active {
        border-left: 2px solid var(--primary, #e86878);
    }

    /* Dropdown در موبایل */
    .dropdown {
        width: 100%;
    }
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(255, 255, 255, 0.02);
        border: none;
        border-radius: 8px;
        box-shadow: none;
        padding: 0.2rem 0;
        display: none;
        width: 100%;
        backdrop-filter: none;
    }
    .dropdown.active .dropdown-menu {
        display: block;
    }
    .dropdown-menu li a {
        padding: 0.35rem 1rem 0.35rem 2rem;
        font-size: 0.8rem;
        border-left: none;
    }
    .dropdown-menu li a:hover {
        border-left: none;
        background: rgba(232, 104, 120, 0.05);
    }

    /* User Dropdown در موبایل */
    .user-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(255, 255, 255, 0.02);
        border: none;
        border-radius: 8px;
        box-shadow: none;
        padding: 0.2rem 0;
        display: none;
        width: 100%;
        backdrop-filter: none;
    }
    .user-dropdown.active .user-dropdown-menu {
        display: block;
    }
    .user-dropdown-menu a {
        padding: 0.35rem 1rem 0.35rem 2rem;
        font-size: 0.8rem;
        border-left: none;
    }
    .user-dropdown-menu a:hover {
        border-left: none;
        background: rgba(232, 104, 120, 0.05);
    }
}

@media (max-width: 480px) {
    .header-logo span {
        font-size: 0.85rem;
    }
    .header-logo img {
        height: 24px;
    }
    .auth-btn {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    .login-btn i {
        display: none;
    }
    .header-cart {
        width: 32px;
        height: 32px;
    }
    .header-cart i {
        font-size: 0.8rem;
    }
    .header-cart .cart-badge {
        font-size: 0.5rem;
        min-width: 14px;
        padding: 0.05rem 0.25rem;
    }
    .navbar {
        top: clamp(72px, 10vh, 90px);
    }
    .search-input {
        font-size: 0.75rem;
    }
    .search-btn {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    .search-icon {
        padding: 0 0.4rem;
        font-size: 0.7rem;
    }
}