/* =========================================================
   هدر میخرم — لاکچری
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    transition: background .3s, border-color .3s;
}

.header-container {
    min-height: 76px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 30px;
}

/* ============ لوگو ============ */
.site-logo {
    color: var(--gold);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -1px;
    position: relative;
    transition: color .25s;
    flex-shrink: 0;
    margin-left: 20px;
}

.site-logo::after {
    content: "";
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: .4;
    transition: opacity .25s;
}

.site-logo:hover::after { opacity: 1; }

/* ============ سلکتور موقعیت ============ */
.header-location {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}

.header-location-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}

.header-location-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.location-icon {
    width: 16px;
    height: 16px;
    color: var(--gold);
    flex-shrink: 0;
}

.location-arrow {
    font-size: 10px;
    color: var(--text-muted);
}

/* دراپ‌داون */
.location-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 620px;
    max-width: 92vw;
    height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.location-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.location-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.location-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    font-size: 12px;
    padding: 0;
}

.location-close:hover {
    color: #e74c3c;
    border-color: #e74c3c;
}

.location-search {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.location-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.location-search input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.location-search input::placeholder { color: var(--text-faint); }

.location-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.location-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.location-col:first-child { border-left: 1px solid var(--border); }

.location-col-title {
    padding: 10px 20px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    background: var(--bg-elevated);
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.location-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    min-height: 0;
}

.location-list::-webkit-scrollbar { width: 6px; }
.location-list::-webkit-scrollbar-track { background: transparent; }
.location-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
.location-list::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.location-item {
    display: block;
    padding: 9px 14px;
    color: var(--text-soft);
    font-size: 13px;
    text-decoration: none;
    border-radius: 8px;
    transition: all .15s;
    cursor: pointer;
}

.location-item:hover {
    background: var(--gold-soft);
    color: var(--gold);
}

.location-item.active {
    background: var(--gold-soft);
    color: var(--gold);
    font-weight: 700;
}

.location-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-faint);
    font-size: 12px;
}

/* ============ منو ============ */
.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.main-nav a {
    padding: 9px 16px;
    border-radius: 9px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
    transition: all .2s ease;
    position: relative;
}

.main-nav a:hover {
    color: var(--gold);
    background: var(--gold-soft);
}

/* ============ جستجوی هدر ============ */
.header-search {
    flex: 1;
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: stretch;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all .25s ease;
}

.header-search:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.header-search input {
    flex: 1;
    width: 100%;
    height: 46px;
    padding: 0 18px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.header-search input::placeholder { color: var(--text-faint); }

.header-search button {
    height: 46px;
    padding: 0 26px;
    border: none;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}

.header-search button:hover {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}
/* ============ دکمه تغییر تم (Toggle Switch) ============ */
.theme-toggle {
    width: 62px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--bg-elevated);
    cursor: pointer;
    transition: all .3s ease;
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.theme-toggle:hover {
    border-color: var(--gold);
    box-shadow: 0 0 14px var(--gold-soft);
}

.theme-slider {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.theme-knob {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.power-icon {
    width: 14px;
    height: 14px;
    transition: transform .35s ease;
}

/* لایت مود → کلید سمت چپ میره */
.light-mode .theme-knob {
    right: calc(100% - 27px);
}

/* هاور → کلید یکم بزرگ‌تر */
.theme-toggle:hover .theme-knob {
    transform: scale(1.08);
}

/* دارک مود → آیکون کمی چرخیده */
.theme-toggle:not(:hover) .power-icon {
    transform: rotate(0deg);
}

.theme-toggle:hover .power-icon {
    transform: rotate(180deg);
}
/* ============ موبایل ============ */
@media (max-width: 1100px) {
    .header-container {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 20px;
    }

    .header-search {
        order: 3;
        width: 100%;
        max-width: none;
        flex-basis: 100%;
    }

    .header-location {
        margin-left: 0;
    }

    .main-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    .header-location { margin: 0; }
    .location-text { display: none; }
    .header-location-btn { padding: 9px 10px; }

    .location-dropdown {
        width: 95vw;
        height: auto;
        max-height: 85vh;
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }

    .location-dropdown.open {
        transform: translateX(-50%) translateY(0);
    }

    .location-columns { grid-template-columns: 1fr; }

    .location-col:first-child {
        border-left: none;
        border-bottom: 1px solid var(--border);
    }

    .location-col { max-height: 200px; }
}

@media (max-width: 600px) {
    .site-logo { font-size: 24px; margin-left: 0; }
    .main-nav { gap: 2px; }
    .main-nav a { padding: 7px 10px; font-size: 12px; }
    .header-search input, .header-search button { height: 42px; }
    .theme-toggle { width: 40px; height: 40px; }
}
/* بج پیام تو هدر */
.nav-with-badge {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    animation: navBadgePulse 2s ease-in-out infinite;
}

@keyframes navBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
/* دکمه پشتیبانی */
.header-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--gold-soft);
    border: 1px solid var(--gold-dark);
    border-radius: 10px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.header-support-btn:hover {
    background: var(--gold);
    color: #1a1a1a;
    border-color: var(--gold);
}

.header-support-btn svg {
    flex-shrink: 0;
}