:root {
    --primary: #0066a2;
    --primary-dark: #004d7a;
    --primary-light: #e6f2f8;
    --secondary: #00a86b;
    --accent: #f39c12;
    --danger: #e74c3c;
    --dark: #1a1a2e;
    --gray: #6c757d;
    --light-gray: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   ===== LOGO UTILS (Global) =====
   ========================================================================== */
.logo-icon, .footer-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logo-icon img, .footer-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   ===== HEADER & CONTAINER =====
   ========================================================================== */
.header {
    background: var(--white); 
    box-shadow: var(--shadow);
    position: sticky; 
    top: 0; 
    z-index: 1000;
}

.header-container {
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 30px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 75px; 
}

/* الشعار المطور */
.logo { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    text-decoration: none; 
    flex-shrink: 0; 
}

.logo-icon { 
    width: 50px;  
    height: 50px; 
}

.logo-text h1 { 
    font-size: 17px; 
    font-weight: 800; 
    color: var(--primary); 
    line-height: 1.1; 
}

.logo-text span { 
    font-size: 11px; 
    color: var(--gray); 
    font-weight: 600; 
}

/* ==========================================================================
   ===== NAVIGATION DESKTOP (تم تقريب العناصر أكثر هنا) =====
   ========================================================================== */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px; 
    height: 100%;
    direction: rtl;
}

.nav-item {
    position: relative; 
    height: 100%;
    display: flex;
    align-items: center;
}

/* الخط الفاصل العمودي */
.nav-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: -3px; 
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px; /* تم تقصير الخط قليلاً ليناسب الحجم الجديد */
    background-color: rgba(0, 0, 0, 0.12); 
}

.nav-link {
    font-size: 13.5px; /* تم تصغير الخط قليلاً ليكون ملموماً أكثر */
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    padding: 6px 12px; /* تم تقليص الـ padding الأفقي من 10px إلى 6px لتقريب المسافات */
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap; 
    display: flex;
    align-items: center;
    gap: 4px; /* تقريب السهم الصغير من الكلمة */
}

.nav-link:hover, 
.nav-link.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08); 
}

/* ==========================================================================
   ===== DROPDOWN STYLING =====
   ========================================================================== */
.dropdown {
    position: absolute;
    top: 100%; 
    right: 0; 
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    border-top: 3px solid var(--primary); 
    padding: 10px 0;
    min-width: 260px; 
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: right;
}

.dropdown a i {
    color: var(--primary);
    font-size: 15px;
    width: 20px; 
    text-align: center;
}

.dropdown a:hover {
    background-color: #f8f9fa;
    color: var(--primary);
    padding-right: 25px; 
}

/* حماية الحافة اليسرى */
.nav-item:last-child .dropdown,
.nav-item:nth-last-child(2) .dropdown {
    right: auto;
    left: 0; 
}

/* ==========================================================================
   ===== RESPONSIVE BREAKPOINT =====
   ========================================================================== */
/* تحول آمن عند 1250px للحفاظ على انسيابية الهيدر */
@media (max-width: 1250px) {
    .nav-desktop {
        display: none; 
    }
    .mobile-menu-btn {
        display: block; 
    }
}

/* ===== FOOTER ===== */
.footer { 
    background: var(--dark); 
    color: var(--white); 
    padding: 80px 0 0; 
}

/* التعديل الجوهري هنا: تقسيم الـ Grid إلى 4 أعمدة */
.footer-grid {
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr 1fr; /* تم تحويلها لاستيعاب 4 أعمدة متناسقة */
    gap: 40px; 
    margin-bottom: 60px;
}

.footer-brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.footer-logo-icon {
    width: 50px;
    height: 50px;
}
.footer-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.footer-brand h3 { font-size: 20px; font-weight: 800; color: var(--white); margin: 0; }
.footer-brand p { opacity: 0.8; line-height: 1.8; margin-bottom: 20px; font-size: 14px; text-align: justify; }

.footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer-contact-item { display: flex; align-items: center; gap: 10px; opacity: 0.9; font-size: 14px; }
.footer-contact-item i { color: var(--accent); width: 20px; }

.footer-title { font-size: 18px; font-weight: 700; margin-bottom: 25px; position: relative; padding-bottom: 10px; color: var(--white); }
.footer-title::after { content: ''; position: absolute; bottom: 0; right: 0; width: 40px; height: 3px; background: var(--accent); border-radius: 2px; }

.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: rgba(255,255,255,0.8); text-decoration: none; transition: var(--transition); display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.4; }
.footer-links a:hover { color: var(--accent); padding-right: 5px; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 25px 0; text-align: center; opacity: 0.7; font-size: 14px; }

/* Remaining existing styles for navigation, mobile menu, etc. */
.top-bar { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); color: var(--white); padding: 8px 0; font-size: 14px; }
.top-bar-container { max-width: 1400px; margin: 0 auto; padding: 0 30px; display: flex; justify-content: space-between; align-items: center; }
.top-bar-info { display: flex; gap: 25px; }
.top-bar-social { display: flex; gap: 15px; }
.top-bar-social a { color: var(--white); transition: var(--transition); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.1); text-decoration: none; }
.top-bar-social a:hover { background: var(--accent); transform: translateY(-2px); }
.nav-desktop { display: flex; gap: 5px; }
.nav-item { position: relative; }
.nav-link { padding: 12px 20px; color: var(--dark); text-decoration: none; font-weight: 600; font-size: 15px; border-radius: 8px; transition: var(--transition); display: flex; align-items: center; gap: 5px; }
.nav-link:hover, .nav-link.active { background: var(--primary-light); color: var(--primary); }
.dropdown { position: absolute; top: 100%; right: 0; background: var(--white); min-width: 250px; box-shadow: var(--shadow-hover); border-radius: 12px; padding: 10px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: var(--transition); border-top: 3px solid var(--primary); z-index: 100; }
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 12px 15px; color: var(--dark); text-decoration: none; border-radius: 8px; transition: var(--transition); font-size: 14px; }
.dropdown a:hover { background: var(--primary-light); color: var(--primary); padding-right: 20px; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; color: var(--primary); cursor: pointer; }
.mobile-nav { position: fixed; top: 0; right: -100%; width: 300px; height: 100vh; background: var(--white); z-index: 2000; box-shadow: -5px 0 30px rgba(0,0,0,0.1); transition: var(--transition); padding: 30px; overflow-y: auto; }
.mobile-nav.active { right: 0; }

/* ==== Mobile nav close button ==== */
.mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 25px;
    background: var(--light-gray);
    border: none;
    border-radius: 50%;
    color: var(--dark);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}
.mobile-nav-close:hover {
    background: var(--danger);
    color: var(--white);
}

/* ==== Mobile nav links ==== */
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    color: var(--dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    border-radius: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition);
}
.mobile-nav-links a i {
    color: var(--primary);
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.mobile-nav-links a:hover,
.mobile-nav-links a:active {
    background: var(--primary-light);
    color: var(--primary);
    padding-right: 18px;
}

/* ==== Mobile nav accordion groups (dropdown pages on mobile) ==== */
.mobile-nav-group {
    display: flex;
    flex-direction: column;
}
.mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    color: var(--dark);
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
}
.mobile-nav-toggle span {
    display: flex;
    align-items: center;
    gap: 14px;
}
.mobile-nav-toggle span i {
    color: var(--primary);
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.mobile-nav-toggle .toggle-icon {
    font-size: 12px;
    color: var(--gray);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.mobile-nav-toggle:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.mobile-nav-group.open .mobile-nav-toggle .toggle-icon {
    transform: rotate(180deg);
}
.mobile-nav-submenu {
    max-height: 0;
    overflow: hidden;
    background: var(--light-gray);
    border-radius: 8px;
    transition: max-height 0.3s ease;
}
.mobile-nav-group.open .mobile-nav-submenu {
    max-height: 400px;
}
.mobile-nav-submenu a {
    padding-right: 46px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.mobile-nav-submenu a:last-child {
    border-bottom: none;
}
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1500; opacity: 0; visibility: hidden; transition: var(--transition); }
.overlay.active { opacity: 1; visibility: visible; }

@media (max-width: 992px) { .nav-desktop { display: none; } .mobile-menu-btn { display: block; } .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }
@media (max-width: 768px) { .top-bar-info { display: none; } .footer-grid { grid-template-columns: 1fr; } }
@media (max-width: 576px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }