/* =========================================
   استایل هدر چسبان و شیشه‌ای (دارک)
========================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

/* =========================================
   استایل لوگوی تصویری
========================================= */
.logo a {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.logo img {
    max-width: 100%;
    height: 55px; /* ارتفاع دسکتاپ */
    width: auto;
    display: block;
    transition: height 0.3s ease;
}

/* =========================================
   استایل منوی داینامیک (دسکتاپ)
========================================= */
.primary-menu {
    list-style: none;
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0;
}

.primary-menu > li {
    position: relative;
}

.primary-menu a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.primary-menu a:hover {
    color: var(--cta-bg);
}

/* فلش کنار منوهای والد در دسکتاپ */
.menu-item-has-children > a::after {
    content: "▾";
    font-size: 14px;
    margin-right: 6px;
    opacity: 0.7;
}

/* باکس دراپ‌داون زیرمنوها */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    right: 0; /* راست‌چین برای سایت فارسی */
    min-width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 999;
}

/* نمایش دراپ‌داون در هاور دسکتاپ */
.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu li {
    width: 100%;
}

.primary-menu .sub-menu a {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 400;
}

/* حذف فلش از زیرمنوها */
.primary-menu .sub-menu .menu-item-has-children > a::after {
    content: "◂";
    position: absolute;
    left: 15px;
}

.primary-menu .sub-menu a:hover {
    background: var(--bg-surface-light);
    color: var(--cta-bg);
    padding-right: 25px; /* افکت تو رفتگی ریز */
}

/* دکمه آکاردئون (مخفی در دسکتاپ) */
.submenu-toggle {
    display: none;
}

/* =========================================
   استایل دکمه CTA
========================================= */
.btn-cta {
    background-color: var(--cta-bg);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-cta:hover {
    background-color: var(--cta-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(179, 57, 57, 0.4);
}

/* دکمه همبرگری (مخفی در دسکتاپ) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10000;
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: all 0.3s ease;
}
/* مخفی کردن منوی موبایل در حالت دسکتاپ */
.mobile-menu-container {
    display: none;
}
/* =========================================
   ریسپانسیو - تبلت و موبایل
========================================= */
@media (max-width: 992px) {
    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo img {
        height: 42px;
    }

    /* همبرگری سمت راست */
    .menu-toggle {
        display: flex;
        order: 1;
        position: relative;
    }

    /* لوگو سمت چپ */
    .logo {
        order: 2;
    }

    /* مخفی کردن دکمه CTA دسکتاپ */
    .header-cta {
        display: none;
    }

    /* منوی کشویی آف‌کانوس از راست */
    .main-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: #000000; /* بک‌گراند مشکی کلاسیک سالید */
        border-left: 1px solid var(--border-color);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.8);
        transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 9998;
        padding-top: 100px;
        box-sizing: border-box;
    }

    .main-nav.toggled {
        right: 0;
    }

    /* استایل‌های داخل منوی داینامیک موبایل */
    .primary-menu {
        flex-direction: column;
        padding: 0 30px;
        gap: 15px;
        text-align: right;
    }

    .primary-menu > li {
        width: 100%;
        position: relative;
    }

    .primary-menu a {
        font-size: 16px;
        display: block;
        padding: 10px 0;
    }

    /* خنثی کردن استایل هاور و فلش دسکتاپ تو موبایل */
    .menu-item-has-children > a::after {
        display: none;
    }

    /* استایل زیرمنو تو حالت موبایل (آکاردئونی) */
    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 20px 0 0;
        margin: 5px 0 10px 0;
        border-right: 2px solid var(--border-color);
        display: none;
    }

    .primary-menu .sub-menu.open {
        display: block;
    }

    /* دکمه اختصاصی باز کردن زیرمنو تو موبایل */
    .submenu-toggle {
        display: flex;
        position: absolute;
        left: 0;
        top: 2px;
        width: 25px;
        height: 25px;
        align-items: center;
        justify-content: center;
        background: var(--bg-surface-light);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        color: var(--text-main);
        cursor: pointer;
        transition: transform 0.3s ease, background 0.3s ease;
    }

    .submenu-toggle.active {
        transform: rotate(180deg);
        background: var(--cta-bg);
        border-color: var(--cta-bg);
        color: #fff;
    }

    /* انیمیشن تبدیل همبرگر به ضربدر */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    /* مخفی کردن منوی دسکتاپ در حالت موبایل */
    .desktop-menu-container {
        display: none;
    }

    /* نمایش کانتینر موبایل */
    .mobile-menu-container {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
        padding-bottom: 40px; /* فاصله از پایین صفحه */
    }

    /* استایل دکمه CTA شفاف موبایل */
    .mobile-cta-wrapper {
        margin-bottom: 7.5rem;
        padding: 0px 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .btn-mobile-cta {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px 0;
        background: #912e2e;
        color: #FFF;
        border: 2px solid #912e2e;
        border-radius: 8px;
        text-decoration: none;
        font-size: 16px;
        font-weight: bold;
        transition: all 0.3s;
        box-sizing: border-box;
    }

    .btn-mobile-cta:hover {
        background: #7e1717;
        color: #fff;
    }
}