/* ============================================================ */
/* ===== منوی مخفی با همبرگری - نسخه اصلاح شده ===== */
/* ============================================================ */

/* ===== دکمه همبرگری ===== */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
    background: none;
    border: none;
    position: fixed;
    top: 15px;
    right: 15px;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== حالت RTL برای همبرگر ===== */
html[dir="rtl"] .hamburger-btn {
    right: auto;
    left: 15px;
}

html[dir="rtl"] .hamburger-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(-45deg);
}

html[dir="rtl"] .hamburger-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(45deg);
}

/* ============================================================ */
/* ===== منوی اصلی ===== */
/* ============================================================ */

#hiddenNav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 5px 0;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
}

/* ===== در دسکتاپ ===== */
@media (min-width: 993px) {
    #hiddenNav.visible {
        transform: translateY(0);
        margin-top: 45px;
    }
}

/* ===== در موبایل - منو مخفی بماند ===== */
@media (max-width: 992px) {
    #hiddenNav {
        transform: translateY(-100%) !important;
        transition: none !important;
    }
    
    #hiddenNav.visible {
        transform: translateY(-100%) !important;
        margin-top: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* ===== کانتینر ===== */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
    position: relative;
}

/* ===== حالت RTL ===== */
html[dir="rtl"] .nav-container {
    flex-direction: row-reverse;
}

html[dir="rtl"] .nav-menu li a {
    flex-direction: row-reverse;
}

/* ===== لوگو ===== */
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    color: #1f2a44;
    flex-shrink: 0;
}

.img-head {
    width: 40px;
    height: 30px;
    object-fit: contain;
}

/* ============================================================ */
/* ===== منو ===== */
/* ============================================================ */

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #333;
    padding: 8px 14px;
    border-radius: 20px;
    transition: 0.3s;
}

.nav-menu li a:hover {
    background: #c9a227;
    color: white;
}

.nav-menu li a i {
    font-size: 1.1rem;
}

/* ============================================================ */
/* ===== اوورلی (پس‌زمینه تیره) ===== */
/* ============================================================ */

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================================ */
/* ===== جلوگیری از اسکرول ===== */
/* ============================================================ */

body.no-scroll {
    overflow: hidden;
}

/* ============================================================ */
/* ===== ریسپانسیو ===== */
/* ============================================================ */

/* ===== دسکتاپ (992px به بالا) ===== */
@media (min-width: 993px) {
    .hamburger-btn {
        display: none !important;
    }
    
    .nav-menu {
        display: flex !important;
        position: static;
        flex-direction: row;
        gap: 20px;
        background: transparent;
        box-shadow: none;
        padding: 0;
        width: auto;
        height: auto;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto;
    }
    
    .nav-overlay {
        display: none !important;
    }
}

/* ===== تبلت و موبایل (992px و کمتر) ===== */
@media (max-width: 992px) {
    .hamburger-btn {
        display: flex;
    }
    
    /* ===== منو در موبایل - از راست وارد می‌شود ===== */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        padding: 80px 20px 30px;
        gap: 5px;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 999;
        pointer-events: auto;
    }
    
    /* ===== RTL برای موبایل ===== */
    html[dir="rtl"] .nav-menu {
        right: auto;
        left: -100%;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    }
    
    /* ===== منو باز ===== */
    .nav-menu.open,
    .nav-menu.active {
        right: 0;
    }
    
    html[dir="rtl"] .nav-menu.open,
    html[dir="rtl"] .nav-menu.active {
        right: auto;
        left: 0;
    }
    
    /* ===== آیتم‌های منو در موبایل ===== */
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu li a {
        width: 100%;
        padding: 12px 16px;
        border-radius: 12px;
        font-size: 1rem;
        gap: 12px;
        white-space: normal;
        justify-content: flex-start;
    }
    
    .nav-menu li a i {
        font-size: 1.2rem;
        width: 24px;
        text-align: center;
    }
    
    .nav-menu li a:hover {
        background: #c9a227;
        color: white;
    }
    
    /* ===== لوگو در موبایل مخفی شود ===== */
    .logo {
        display: none;
    }
}

/* ===== موبایل کوچک (480px و کمتر) ===== */
@media (max-width: 480px) {
    .hamburger-btn {
        width: 26px;
        height: 18px;
        top: 12px;
        right: 12px;
    }
    
    .hamburger-btn span {
        height: 2.5px;
    }
    
    .hamburger-btn.active span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }
    
    .hamburger-btn.active span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }
    
    html[dir="rtl"] .hamburger-btn {
        right: auto;
        left: 12px;
    }
    
    html[dir="rtl"] .hamburger-btn.active span:nth-child(1) {
        transform: translateY(7.5px) rotate(-45deg);
    }
    
    html[dir="rtl"] .hamburger-btn.active span:nth-child(3) {
        transform: translateY(-7.5px) rotate(45deg);
    }
    
    .nav-menu {
        width: 100%;
        padding: 70px 15px 20px;
    }
    
    .nav-menu li a {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .nav-menu li a i {
        font-size: 1rem;
        width: 20px;
    }
}