/* ==========================================================================
   Caspiaro Unified Header & Navigation Styles
   ========================================================================== */

:root {
    --bg-header: rgba(255, 255, 255, 0.94);
    --copper: #B46E26;
    --copper-dark: #8C5318;
    --copper-tint: rgba(180, 110, 38, 0.08);
    --rose: #E11D48;
    --navy-brand: #0B192C;
}

body.dark-theme {
    --bg-header: rgba(11, 25, 44, 0.92);
}

/* ۱. نوار اطلاعیه و امداد بالای سایت */
.top-bar {
    background: #0B192C;
    color: #F8FAFC;
    font-size: 12.5px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 768px) {
    .top-bar {
        font-size: 13.5px;
        padding: 9px 0;
    }
}
.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-bar-detail {
    display: none;
}
@media (min-width: 640px) {
    .top-bar-detail {
        display: inline;
    }
}
.top-bar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #FFF;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
    direction: ltr;
}
.top-bar-link:hover {
    color: #E6A76E;
}
.top-bar-phone-text {
    display: none;
}
@media (min-width: 480px) {
    .top-bar-phone-text {
        display: inline;
        direction: rtl;
    }
}
.ping-dot {
    width: 8px;
    height: 8px;
    background: #22C55E;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #22C55E;
    animation: pingPulse 1.8s infinite;
}
@keyframes pingPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
}

/* ۲. هدر استیکی اصلی */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 62px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
@media (min-width: 768px) {
    .site-header {
        height: 72px;
    }
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 12px;
}
.brand-link {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    text-decoration: none;
}
.brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
}
@media (min-width: 768px) {
    .brand-logo-img {
        width: 42px;
        height: 42px;
    }
}
.brand-text-box {
    display: flex;
    flex-direction: column;
}
.brand-title {
    font-size: 19px;
    font-weight: 900;
    line-height: 1.2;
    background: linear-gradient(135deg, #B46E26, #E6A76E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}
@media (min-width: 768px) {
    .brand-title {
        font-size: 22px;
    }
}
.brand-sub {
    display: none;
    font-size: 9.5px;
    color: var(--text-muted, #64748B);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
}
@media (min-width: 1024px) {
    .brand-sub {
        display: block;
    }
}

/* ۳. منوی ناوبری دسکتاپ */
.header-nav {
    display: none;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary, #334155);
    white-space: nowrap;
}
@media (min-width: 1180px) {
    .header-nav {
        display: flex;
    }
}
.header-nav a {
    position: relative;
    padding: 6px 0;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}
.header-nav a:hover,
.header-nav a.active {
    color: var(--copper);
}

/* ۴. دراپ‌داون‌های دسکتاپ */
.nav-item-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 0;
    color: var(--text-secondary, #334155);
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.2s ease;
    user-select: none;
}
.nav-dropdown-trigger:hover,
.nav-item-dropdown:hover .nav-dropdown-trigger {
    color: var(--copper);
}
.nav-dropdown-trigger svg {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-item-dropdown:hover .nav-dropdown-trigger svg {
    transform: rotate(180deg);
}
.nav-item-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    right: -10px;
    left: -10px;
    height: 14px;
}
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: -10px;
    min-width: 275px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(180, 110, 38, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
    z-index: 1000;
}
.nav-item-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
.nav-dropdown-link:hover {
    background: var(--copper-tint);
}
.nav-dropdown-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(180, 110, 38, 0.1);
    color: var(--copper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.nav-dropdown-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}
.nav-dropdown-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    line-height: 1.4;
}
.nav-dropdown-desc {
    font-size: 11.5px;
    color: var(--text-muted, #64748B);
    line-height: 1.4;
    margin-top: 2px;
}

/* ۵. اکشن‌های هدر (تم، دکمه، همبرگر) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .header-actions {
        gap: 10px;
    }
}
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 15px;
    flex-shrink: 0;
    color: var(--text-primary, #0F172A);
}
.theme-toggle-btn:hover {
    border-color: var(--copper);
    background: var(--copper-tint);
}
#themeLabel {
    display: none;
}
.header-cta-btn {
    background: linear-gradient(135deg, #B46E26, #C88238);
    color: #FFF !important;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.header-cta-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
.cta-short { display: inline; }
.cta-full { display: none; }
@media (min-width: 640px) {
    .cta-short { display: none; }
    .cta-full { display: inline; }
}

/* دکمه همبرگری منوی موبایل و تبلت */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.mobile-menu-btn:hover {
    border-color: var(--copper);
    background: var(--copper-tint);
}
.hamburger-line {
    width: 18px;
    height: 2px;
    background: var(--text-primary, #0F172A);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
@media (min-width: 1180px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* ۶. کشوی منوی موبایل (Drawer) */
.mobile-drawer-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 25, 44, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.mobile-drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 86%;
    max-width: 350px;
    height: 100%;
    background: var(--bg-surface, #FFFFFF);
    border-left: 1px solid var(--border-color, #E2E8F0);
    z-index: 9999;
    box-shadow: -10px 0 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
    direction: rtl;
}
.mobile-drawer.active {
    transform: translateX(0);
    visibility: visible;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-page, #F8FAFC);
}
.drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-surface, #FFFFFF);
    color: var(--text-primary, #0F172A);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.drawer-close-btn:hover {
    border-color: var(--copper);
    color: var(--copper);
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}
.drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--bg-page, #F8FAFC);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    text-decoration: none;
    border: 1px solid var(--border-color, #E2E8F0);
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
.drawer-nav-item:hover {
    border-color: var(--copper);
    color: var(--copper);
    background: var(--copper-tint);
}
.drawer-section-title {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text-muted, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
    margin-bottom: 4px;
}
.drawer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.drawer-link-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--bg-page, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
.drawer-link-card:hover {
    border-color: var(--copper);
    background: var(--copper-tint);
}
.drawer-card-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(180, 110, 38, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}
.drawer-card-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
}
.drawer-card-sub {
    font-size: 11px;
    color: var(--text-muted, #64748B);
    margin-top: 1px;
}
.drawer-cities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.drawer-city-pill {
    padding: 7px 13px;
    border-radius: 20px;
    background: var(--bg-page, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary, #334155);
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
.drawer-city-pill:hover {
    border-color: var(--copper);
    color: var(--copper);
    background: var(--copper-tint);
}
.drawer-footer-cta {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #E2E8F0);
}
.drawer-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #B46E26, #C88238);
    color: #FFF;
    font-size: 14.5px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(180, 110, 38, 0.3);
}
