/* تحسينات القائمة المحمولة والعزل التام */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #d4af37;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.mobile-menu-btn:hover {
    color: #fff;
}

/* طبقة الخلفية المعتمة (Overlay) */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998 !important; /* خلف القائمة مباشرة */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* التنسيق الافتراضي للقائمة المحمولة (مخفية) */
.mobile-menu {
    position: fixed;
    top: 0;
    width: 75%; /* حجم أنيق كما طلب المستخدم */
    height: 100vh;
    background-color: #111 !important;
    z-index: 9999 !important; /* أعلى z-index لضمان العزل */
    transition: all 0.3s ease-in-out;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none; /* منع التفاعل وهي مخفية */
}

.mobile-menu.active {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important; /* تفعيل التفاعل عند الفتح */
}

/* للنسخة العربية (RTL) */
html[dir="rtl"] .mobile-menu {
    right: -100%;
    left: auto;
}

html[dir="rtl"] .mobile-menu.active {
    right: 0;
    left: auto;
}

/* للنسخة الإنجليزية (LTR) */
html[dir="ltr"] .mobile-menu {
    left: -100%;
    right: auto;
}

html[dir="ltr"] .mobile-menu.active {
    left: 0;
    right: auto;
}

/* زر الإغلاق */
.close-menu {
    align-self: flex-end;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.mobile-nav {
    width: 100%;
    display: block !important;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex !important;
    flex-direction: column;
    width: 100%;
}

.mobile-nav ul li {
    margin-bottom: 0.8rem;
    width: 100%;
    text-align: center;
    display: block !important;
}

.mobile-nav ul li a {
    color: #fff !important;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    display: block !important;
    padding: 0.6rem 0;
    width: 100%;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.mobile-nav ul li a:hover {
    color: #d4af37 !important;
}

.mobile-menu .language-switch {
    margin-top: 1.5rem;
    background-color: #d4af37;
    border: none;
    color: #000;
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    width: 70%;
}

/* إظهار زر القائمة في الجوال فقط */
@media (max-width: 768px) {
    header nav {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    .language-switch:not(.mobile-menu .language-switch) {
        display: none !important;
    }
}
