/* تحديد الألوان الأساسية بناءً على الشعار والموقع المشابه */
:root {
    --primary-color: #008000;
    --secondary-color: #404040;
    --accent-color: #4a4a4a;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
}

/* التنسيق الأساسي للجسم والخطوط */
body {
    /* استخدام خط Tajawal المستورد */
    font-family: 'Tajawal', sans-serif; 
    margin: 0;
    padding: 0;
    background-color: var(--light-bg); 
    color: var(--accent-color);
    /* الاتجاه الافتراضي يتم تحديده من HTML tag */
    line-height: 1.6;
    scroll-padding-top: 50px; 
}

/* تنسيق الحاويات العامة */
.site-main, .top-bar-content, .header-content, .nav-content, .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* ========================================================= */
/* قواعد CSS الخاصة باللغة الإنجليزية (RTL to LTR)     */
/* ========================================================= */

/* عندما يكون الاتجاه إنجليزي (ltr) */
html[dir="ltr"] body {
    text-align: left;
}

html[dir="ltr"] .language-switcher {
    text-align: right;
}

/* 1. قائمة التنقل تبدأ من اليسار */
html[dir="ltr"] .nav-links {
    justify-content: flex-start; 
}

/* 2. عكس ترتيب الصورة والنص في قسم "من نحن" (About Us) */
html[dir="ltr"] .about-content {
    /* الصورة ستكون في اليمين والنص في اليسار */
    flex-direction: row; 
}

/* 3. عكس ترتيب الصورة والنص في قسم "الخدمات" (Services) */
html[dir="ltr"] .services-content {
    /* الصورة ستكون في اليمين والنص في اليسار */
    flex-direction: row; 
}

/* تعديل موقع علامات القائمة (Bullets) لتبدأ من اليسار */
html[dir="ltr"] .about-text li, html[dir="ltr"] .services-text li {
    padding-left: 25px;
    padding-right: 0;
}
html[dir="ltr"] .about-text li::before, html[dir="ltr"] .services-text li::before {
    left: 0;
    right: auto;
}

/* محاذاة الفوتر */
html[dir="ltr"] .contact-info-footer {
    text-align: left;
}
/* تنسيق رابط الهاتف والبريد ليظهر بلون فاتح */
.phone-number, .contact-info-footer a {
    color: var(--light-bg); 
    text-decoration: none;
}


/* ======================= 1. الشريط العلوي (Top Bar) ======================= */
.top-bar {
    background-color: var(--primary-color); 
    color: var(--white);
    font-size: 0.8em;
    padding: 8px 0;
}

.top-bar-content {
    display: flex;
    justify-content: flex-end; 
    align-items: center;
}

.language-switcher a {
    color: var(--white);
    text-decoration: none;
    padding: 0 5px;
    cursor: pointer;
}
.language-switcher .active {
    font-weight: bold;
}

/* ======================= 2. الهيدر والشعار ======================= */
.main-header {
    background-color: var(--white);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px; 
}

.factory-logo {
    height: 70px; 
    width: auto;
}

.title-container {
    padding-left: 0; 
    padding-right: 0;
    border-left: none;
    border-right: none;
}

.factory-name {
    font-size: 1.8em; 
    margin: 0;
    font-weight: 900; 
    color: var(--secondary-color); 
}

.slogan {
    font-size: 0.9em; 
    margin: 2px 0;
    color: var(--primary-color); 
}

.since-date {
    font-size: 0.7em; 
    margin: 0;
    color: #888;
}

/* ======================= 3. قائمة التنقل (Navigation Bar) ======================= */
.nav-bar {
    background-color: var(--secondary-color); 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-start; 
}

.nav-links li a {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s;
    font-weight: 700; 
}

.nav-links li a:hover, .nav-links li a.active {
    background-color: var(--primary-color); 
}

/* ======================= 4. تنسيقات الأقسام الرئيسية ======================= */
.section-padding {
    background-color: var(--white);
    padding: 40px; 
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); 
}

h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    font-weight: 700;
    font-size: 2em;
    margin-bottom: 20px;
}

/* تنسيق قسم "من نحن" الافتراضي (RTL) */
.about-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    /* الترتيب الافتراضي (RTL): صورة يمين، نص يسار */
    flex-direction: row-reverse; 
}

.about-text {
    flex: 2; 
}

.about-text ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.about-text li {
    margin-bottom: 10px;
    position: relative;
    padding-right: 25px;
}

.about-text li::before {
    content: '▪'; 
    color: var(--primary-color);
    position: absolute;
    right: 0;
    top: 0;
    font-weight: bold;
}

.about-image {
    flex: 1; 
    min-width: 250px; 
}

.showcase-img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* تنسيق قسم "الخدمات" الافتراضي (RTL) */
.services-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    /* الترتيب الافتراضي (RTL): صورة يسار، نص يمين */
    flex-direction: row; 
}
.services-image {
    flex: 1;
    min-width: 250px;
}
.services-text {
    flex: 2;
}


/* ======================= 5. الفوتر (التذييل) ======================= */
footer {
    background-color: var(--secondary-color); 
    color: var(--light-bg);
    margin-top: 30px;
}

.contact-footer {
    padding: 30px 15px;
    border-bottom: 1px solid #555;
}

.contact-info-footer {
    display: flex;
    justify-content: center; 
    gap: 50px;
    font-size: 0.9em;
}

.contact-info-footer p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-info-footer span[dir="ltr"], .contact-info-footer a[dir="ltr"] {
    direction: ltr; 
}

.copyright-bar {
    text-align: center;
    padding: 15px;
    background-color: #333; 
    font-size: 0.85em;
}


/* ======================= 6. الاستجابة للشاشات الصغيرة ======================= */
@media (max-width: 900px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .title-container {
        padding-left: 0;
    }
    .nav-links {
        justify-content: space-around;
        flex-wrap: wrap;
    }
    
    .about-content, .services-content {
        /* على الجوال، الجميع يعود إلى الترتيب العمودي الطبيعي */
        flex-direction: column; 
    }
    .about-image, .services-image {
        order: -1; /* لجعل الصورة تظهر قبل النص على الجوال */
        margin-bottom: 20px;
    }

    .contact-info-footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    .contact-info-footer p {
        justify-content: center;
    }
}