/** site-header Start -------------------------------------------------------------------- **/
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: var(--bg-header);
    /* متغیر */
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    /* متغیر */
    position: sticky;
    top: 0px;
    z-index: 1000;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--text-main);
    transition: 0.3s;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    transition: 0.3s;
    font-weight: bold;
    font-family: 'Vazirmatn', sans-serif;
}

nav a:hover,
nav a.active {
    color: var(--text-highlight);
    font-weight: bold;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 1024px) {
    header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    nav ul {
        gap: 15px;
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        margin-bottom: 5px;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    nav ul {
        display: none;
    }

    nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    nav ul {
        display: flex;
        width: max-content;
        padding: 0 10px;
    }
}

/* --- تنظیمات اصلاح شده هدر --- */
.site-header {
    width: 100%;
    /* اجبار به عرض کامل */
    max-width: 100vw;
    /* جلوگیری از بیرون زدگی */
    box-sizing: border-box;
    /* محاسبه دقیق پدینگ */
    display: flex;
    justify-content: space-between;
    /* پخش کردن آیتم‌ها */
    align-items: center;
    padding: 15px 40px;
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1001;
    /* اولویت بالا */
    height: 80px;
}

/* لوگو و دکمه‌های سمت چپ فشرده نشوند */
.logo-link,
.header-actions {
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-text {
    color: var(--text-main);
    font-weight: 800;
}

/* منوی دسکتاپ - وسط چین و باز */
.desktop-nav {
    flex-grow: 1;
    /* اشغال فضای خالی وسط */
    display: flex;
    justify-content: center;
    /* وسط چین کردن لینک‌ها */
}

.desktop-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.desktop-nav a {
    text-decoration: none;
    color: var(--text-muted);
    transition: 0.3s;
    font-weight: 700;
    font-size: 0.95rem;
    position: relative;
    white-space: nowrap;
    /* جلوگیری از شکستن متن */
}

.desktop-nav a:hover {
    color: var(--text-highlight);
}

/* اکشن‌های دسکتاپ */
.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.1rem;
}

/* --- استایل منوی موبایل و دکمه همبرگری --- */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    position: relative;
    z-index: 2005;
    /* بسیار مهم: بالاتر از منوی باز شده */
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* پنل کشویی موبایل */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 2002;
    /* پایین‌تر از دکمه همبرگری */
    display: flex;
    flex-direction: column;
    padding: 90px 30px 30px 30px;
    /* پدینگ بالا زیاد تا زیر دکمه نرود */
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    visibility: hidden;
}

.mobile-menu-overlay.active {
    right: 0;
    visibility: visible;
}

.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* انیمیشن تبدیل به ضربدر */
.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: #ef4444;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: #ef4444;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-nav a {
    font-size: 1.1rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    display: block;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* ریسپانسیو */
@media (max-width: 1024px) {
    .site-header {
        padding: 15px 20px;
        height: 70px;
    }

    .desktop-nav,
    .desktop-actions {
        display: none;
    }

    .hamburger {
        display: block;
    }
}

/* اضافه کردن استایل جدید برای نگهدارنده */
.sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
}


/** site-header End -------------------------------------------------------------------- **/
