/* ---------------------------
   1. Top Bar Ticker (الشريط المتحرك)
--------------------------- */
.top-bar-ticker {
    background-color: var(--color-gold-main); /* خلفية ذهبية */
    color: var(--color-charcoal-900);
    font-size: 0.9rem;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    height: 40px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 101; /* فوق الهيدر */
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 20s linear infinite;
}

@keyframes ticker-scroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(100%, 0, 0); } /* للغة العربية من اليسار لليمين */
}

/* ---------------------------
   2. Site Header (Base)
--------------------------- */
.site-header {
    position: absolute; /* شفاف فوق الهيرو */
    top: 0; /* إذا كان الشريط موجوداً، سيحتاج JS لضبطه أو margin-top */
    top: 40px; /* في حال وجود الشريط */
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
    border-bottom: 1px solid rgba(255,255,255,0.1); /* خط خفيف جداً */
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

/* حالة السكرول (يتم إضافتها عبر JS) */
.site-header.scrolled {
    position: fixed;
    top: 0;
    background-color: var(--color-charcoal-900); /* يتحول للأسود الفحمي */
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border-bottom: none;
    height: 70px; /* تصغير الارتفاع قليلاً */
}
.site-header.scrolled .header-container {
    height: 70px;
}

/* ---------------------------
   3. Desktop Menu
--------------------------- */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
    margin: 0;
}

.main-navigation ul li a {
    color: #fff;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

/* تأثير الهوفر الذهبي */
.main-navigation ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-gold-main);
    transition: width 0.3s ease;
}

.main-navigation ul li a:hover::after {
    width: 100%;
}

/* ---------------------------
   4. Header Tools & Mobile Toggle
--------------------------- */
.header-tools {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tool-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.tool-btn:hover {
    color: var(--color-gold-main);
}

/* Burger Icon */
.mobile-toggle {
    display: none; /* مخفي في الديسكتوب */
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.mobile-toggle .bar {
    width: 25px;
    height: 2px;
    background-color: #fff;
    transition: 0.3s;
}

/* =========================================
   تنسيقات قائمة الموبايل (Mobile Menu Overlay) - مصحح
   ========================================= */
.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; 
    height: 100%; /* تغطية كاملة للشاشة */
    background-color: rgba(18, 18, 18, 0.98); /* خلفية داكنة شبه معتمة */
    z-index: 9999;
    
    /* الخصائص السحرية لضبط التموضع والسكرول */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* نبدأ من الأعلى بدلاً من الوسط */
    align-items: center;
    
    /* الحركة */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    
    /* [هام جداً] السماح بالسكرول داخل القائمة إذا كانت طويلة */
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; /* نعومة السكرول في آيفون */
    padding-top: 80px; /* مسافة من الأعلى عشان زر الإغلاق */
    padding-bottom: 50px;
}

/* حالة التفعيل */
.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* زر الإغلاق */
.close-mobile-menu {
    position: absolute;
    top: 25px; right: 25px;
    background: none; border: none;
    color: #fff; font-size: 2rem;
    cursor: pointer;
    z-index: 10001; /* فوق كل شيء */
}

/* حاوية الروابط */
.mobile-menu-overlay ul {
    list-style: none;
    padding: 0; margin: 0;
    text-align: center;
    width: 100%;
}

.mobile-menu-overlay ul li {
    margin: 0;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.05); /* خط فاصل خفيف */
}

/* تصغير الروابط لتكون مناسبة للهاتف */
.mobile-menu-overlay ul li a {
    display: block;
    font-size: 1.2rem; /* [تعديل] حجم خط أصغر ومناسب (كان كبيراً جداً سابقاً) */
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    padding: 15px 0; /* مساحة للنقر */
    transition: 0.3s;
}

.mobile-menu-overlay ul li a:hover {
    color: var(--color-gold-main);
    background: rgba(255,255,255,0.02);
}

/* التعامل مع القوائم المنسدلة في الموبايل (Sub-menus) */
.mobile-menu-overlay ul .sub-menu {
    display: none; /* مخفية افتراضياً */
    background: rgba(0,0,0,0.2);
    padding: 10px 0;
}
.mobile-menu-overlay ul li.active > .sub-menu {
    display: block; /* تظهر عند الضغط */
}
.mobile-menu-overlay ul .sub-menu li a {
    font-size: 1rem; /* القائمة الفرعية أصغر قليلاً */
    color: #ccc;
    padding: 10px 0;
}
/* ---------------------------
   6. Responsive Rules
--------------------------- */
@media (max-width: 992px) {
    .desktop-only { display: none; }
    .mobile-toggle { display: flex; }
}