/* --- Global Styles & Variables --- */
@font-face {
    font-family: 'Almarai';
    src: url('../font/Almarai-Regular.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #F46E2F;
    --secondary-color: #505050;
    --background-light: #FFFFFF;
    --background-grey: #F9F9F9;
    --text-color: #333;
    --heading-font: 'Almarai', sans-serif;
    --body-font: 'Almarai', sans-serif;
    --step-0: clamp(1rem, 0.9rem + 0.25vw, 1.125rem); /* p (16px -> 18px) */
    --step-1: clamp(1.2rem, 1rem + 0.5vw, 1.5rem); /* h3 (19.2px -> 24px) */
    --step-2: clamp(1.5rem, 1.2rem + 1vw, 2rem); /* h2 (24px -> 32px) */
    --step-3: clamp(1.8rem, 1.3rem + 1.8vw, 2.75rem); /* h1 (28.8px -> 44px) */
}
/* === للمتصفحات المبنية على WebKit (Chrome, Edge, Safari) === */
::-webkit-scrollbar {
    width: 10px;                 /* عرض شريط التمرير */
}

::-webkit-scrollbar-track {
    background: #f1f1f1;         /* خلفية المسار */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #F46E2F;         /* لون المقبض */
    border-radius: 10px;
    border: 2px solid #f1f1f1;   /* يعطيه إحساس عائم */
}

::-webkit-scrollbar-thumb:hover {
    background: #d9571f;         /* لون أغمق عند الـ hover */
}

/* === لمتصفح Firefox === */
html {
    scrollbar-width: thin;                   /* رفيع */
    scrollbar-color: #F46E2F #f1f1f1;        /* المقبض ثم الخلفية */
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    line-height: 1.7;
    direction: rtl;
    margin: 0;
    /* padding-top: 80px;  تمت إزالته لجعل الهيدر فوق المحتوى */
    background-color: var(--background-light);
    font-size: var(--step-0);
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4 {
    color: var(--secondary-color);
    font-weight: 700;
}
h1 { font-size: var(--step-3); font-weight: 800; line-height: 1.2; }
h2 { font-size: var(--step-2); line-height: 1.3; }
h3 { font-size: var(--step-1); line-height: 1.4; }

.service-content h2{
    margin-top: 3rem !important;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: #d15b21;
}

section {
    padding: 50px 0;
}

.section-bg {
    background-color: var(--background-grey);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--background-light);
    box-shadow: 0 4px 15px rgba(244, 110, 47, 0.3);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(244, 110, 47, 0.5);
    color: var(--background-light);
}

/* --- Animation Effects --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Shared Component: Partner Card --- */
.partner-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Make card fill grid cell height */
    border: 1px solid #e9e9e9;
    padding: 10px 25px;
    text-align: center;
    border-radius: 8px;
    background: white;
    /* margin-bottom: 30px; Add bottom margin for stacking on small screens */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    justify-content: center; /* Center content vertically */
}
.partner-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(189, 94, 0, 0.366);
}
.partner-card img {
    max-width: 100%;
    height: 80px; /* Fixed height for logos */
    object-fit: contain; /* Ensure logo fits without distortion */
    margin: 0 auto 20px auto;
}
.partner-card h3 { margin: 10px 0 5px 0; flex-grow: 1; }
.partner-card span { color: #888; font-size: 0.9rem; margin-bottom: 15px; }
.btn-partner {
    display: block;
    padding: 10px 15px;
    background: #f1f1f1;
    color: var(--secondary-color);
    border-radius: 5px;
    font-weight: 700;
    transition: background 0.3s ease, color 0.3s ease;
}
.partner-card:hover .btn-partner { background: var(--primary-color); color: white; }

/* --- Header & Navigation --- */
.main-header {
    background: var(--background-light); /* الحالة الافتراضية: خلفية بيضاء */
    padding: 15px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1); /* الحالة الافتراضية: ظل خفيف */
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color); /* الحالة الافتراضية: لون داكن */
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo:hover {
    color: var(--primary-color);
}
.logo img {
    height: 45px; /* Control logo height */
    width: auto;
}
.logo span {
    display: block;
}
.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}
.main-nav a {
    display: block;
    padding: 10px 15px;
    color: var(--secondary-color); /* الحالة الافتراضية: لون داكن */
    font-weight: 700;
    position: relative;
    transition: all 0.3s ease;

}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 15px;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}
.main-nav a:hover::after, .main-nav a.active::after {
    width: calc(100% - 30px);
}
.main-nav a:hover {
    transform: translateY(-5px);
}
.nav-cta {
    background: var(--primary-color);
    color: white !important;
    border-radius: 50px;
    padding: 10px 20px !important;
    margin-right: 10px;
}
.nav-cta:hover {
  background: #c4551f; /* بديل لـ #d15b21 يحقق ~4.50:1 */
  color: #fff !important;
}

.nav-cta::after { display: none !important; }

.nav-toggle { display: none; }

/* --- Transparent Header State (Homepage Only) --- */
.main-header.header-transparent {
    background: transparent;
    box-shadow: none;
}
.main-header.header-transparent .logo,
.main-header.header-transparent .main-nav a {
    color: var(--background-light); /* لون أبيض في الهيدر الشفاف */
}
.main-header.header-transparent .nav-toggle {
    color: var(--background-light); /* لون أبيض للأيقونة في الهيدر الشفاف */
}

/* --- Scrolled Header State (Overrides Transparent State) --- */
.main-header.header-scrolled { /* هذا الصنف يضاف بواسطة JS */
    background: var(--background-light);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}
.main-header.header-transparent.header-scrolled .logo,
.main-header.header-transparent.header-scrolled .main-nav a,
.main-header.header-transparent.header-scrolled .nav-toggle {
    color: var(--secondary-color); /* إرجاع اللون الداكن عند النزول في الصفحة الرئيسية */
}
.main-header.header-scrolled .nav-cta {
    color: white !important; /* التأكد من بقاء لون زر CTA أبيض */
}

/* --- Footer --- */ 
.main-footer {
    background: #333;
    color: #a9a9a9;
    padding-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}
.footer-col .logo {
    color: white;
    margin-bottom: 20px;
}
.footer-col .logo img {
    height: 40px;
}
.footer-about {
    line-height: 1.8;
    margin-bottom: 20px;
}
.footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}
.footer-col h4::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}
.footer-col ul {
    list-style: none;
    padding: 0;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul a {
    color: #a9a9a9;
    transition: all 0.3s ease;
}
.footer-col ul a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}
.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
}
.contact-info i {
    color: var(--primary-color);
}
.social-links a {
    color: white;
    margin: 0 10px;
    font-size: 1.3rem;
}
.social-links a:first-child { margin-right: 0; }
.footer-bottom {
    border-top: 1px solid #444;
    padding: 20px 0;
    text-align: center;
    /* font-size: 0.9rem; */
    /* font-weight: bold !important; */
}

/* --- Responsive Navigation --- */
@media (max-width: 992px) {
    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        width: 100%;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }
    .main-nav.active {
        max-height: 500px; /* A large enough value */
    }
    .main-nav ul {
        flex-direction: column;
        padding: 10px 0;
    }
    .main-nav a {
        color: var(--secondary-color); /* التأكد من أن لون الروابط داكن دائماً داخل القائمة المنسدلة */
    }
    .nav-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.8rem;
        color: var(--secondary-color); /* الحالة الافتراضية: لون داكن */
        cursor: pointer;
    }
    .logo span {
        display: none; /* Hide text logo on smaller screens to save space */
    }
}
@media (max-width: 768px) {
    .footer-grid { text-align: center; }
    .footer-col h4::after { right: 50%; transform: translateX(50%); }
}
