/* ---------------------------------- */
/* 1. Global & Variables */
/* ---------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #1A2F4F; /* أزرق داكن راقٍ (شعار) */
    --secondary-color: #FFC300; /* لون ذهبي/أصفر للتأكيد */
    --text-dark: #333333;
    --text-light: #fff;
    --bg-light: #F7F9FC; 
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl; 
    text-align: right;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden; 
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* ---------------------------------- */
/* 2. Header & Navigation */
/* ---------------------------------- */
header {
    background: var(--bg-light);
    padding: 15px 0;
    border-bottom: 3px solid var(--secondary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px; 
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-right: 25px;
}

nav ul li a {
    color: var(--text-dark);
    font-size: 1.1rem;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--secondary-color);
}

/* ---------------------------------- */
/* 3. Hero Section & Buttons */
/* ---------------------------------- */
.hero {
    background: linear-gradient(rgba(26, 47, 79, 0.75), rgba(26, 47, 79, 0.75)), url('hero-bg-professional.jpg') no-repeat center center/cover;
    color: var(--text-light);
    padding: 120px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin: 0 auto 30px auto;
}

.btn {
    display: inline-block;
    background: var(--secondary-color); 
    color: var(--primary-color); 
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 50px; 
    font-size: 1.1rem;
    font-weight: 700;
    transition: background 0.3s, transform 0.3s;
    border: none;
}

.btn:hover {
    background: #E0B400; 
    transform: translateY(-3px); 
}

.secondary-btn {
    background: var(--primary-color);
    color: var(--text-light);
}

.secondary-btn:hover {
    background: #0D223F;
}

.view-details-btn {
    display: block;
    margin-top: 15px;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 0.95rem;
}

/* ---------------------------------- */
/* 4. About Snippet & Contact Strip */
/* ---------------------------------- */
.about-snippet {
    padding: 60px 0;
    background: var(--bg-light);
}

.about-snippet .container {
    display: flex;
    gap: 40px;
    align-items: center;
}

.about-content {
    flex: 2;
    padding-right: 25px;
    border-right: 5px solid var(--secondary-color);
}

.about-image {
    flex: 0 0 48%; /* reserve roughly half the horizontal space */
    max-width: 560px; /* prevent the image block from growing too wide */
    height: auto; /* allow the block to size to the image */
    background-color: #e3e8f0;
    border-radius: 8px;
    overflow: hidden; /* hide excess parts of large images */
    display: flex;
    align-items: center; /* vertically center the image within the box */
    justify-content: center; /* horizontally center */
    padding: 6px; /* small padding so rounded corners show */
}

/* Keep the actual image constrained and preserve aspect ratio */
.about-image img {
    width: 100%;
    height: auto; /* preserve natural aspect ratio */
    max-height: 360px; /* defensive cap to avoid extremely tall images */
    object-fit: cover; /* crop subtly if needed while keeping aspect */
    display: block;
    border-radius: 6px;
}

.contact-strip {
    background: var(--primary-color); 
    color: var(--text-light);
    padding: 20px 0;
    text-align: center;
    font-size: 1.1rem;
}

.contact-strip h3 {
    margin-bottom: 5px;
}

/* ---------------------------------- */
/* 5. Footer */
/* ---------------------------------- */
footer {
    background: var(--text-dark);
    color: #ccc;
    padding: 20px 0;
    text-align: center;
}

footer a {
    color: #ccc;
}

/* ---------------------------------- */
/* 6. Inner Pages (General) */
/* ---------------------------------- */
.main-content {
    padding: 80px 0;
    min-height: 70vh;
}

.main-content h1 {
    color: var(--primary-color);
    margin-bottom: 40px;
    font-size: 2.5rem;
}

/* ---------------------------------- */
/* 7. About Page Specifics */
/* ---------------------------------- */
.vision-mission {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}

.card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex: 1;
    border-bottom: 4px solid var(--secondary-color);
}

.ceo-message {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--bg-light);
    margin-bottom: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.quote {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--primary-color);
    margin: 15px 0;
}

.names-tag {
    margin-top: 15px;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.values ul {
    list-style: none;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.values li {
    margin-bottom: 10px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
    position: relative;
}

.values li::before {
    content: '★';
    color: var(--secondary-color);
    position: absolute;
    right: -25px;
}


/* ---------------------------------- */
/* 8. Products Page Specifics */
/* ---------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    text-align: center;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--bg-light);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.product-card h3 {
    color: var(--primary-color);
    margin: 10px 0;
}

/* Product card images and load-more support */
.product-card img {
    width: 100%;
    height: auto; /* preserve natural aspect ratio */
    max-height: 220px; /* limit very tall images */
    object-fit: contain; /* show whole image without cropping */
    background: #ffffff; /* fill any extra space when using contain */
    border-radius: 6px;
    display: block;
    margin-bottom: 12px;
}

.product-card.hidden {
    display: none;
}

/* ---------------------------------- */
/* 9. Contact Page Specifics (Desktop) */
/* ---------------------------------- */
.contact-grid {
    /* Keep the desktop layout as 2fr 1fr */
    display: grid;
    grid-template-columns: 2fr 1fr; 
    gap: 40px;
    margin-top: 40px;
}

.contact-form, .contact-info {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.contact-form h2, .contact-info h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.info-card {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid var(--bg-light);
    border-radius: 6px;
    transition: background 0.3s;
}

.info-card:hover {
    background: var(--bg-light);
}

.info-card i {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.info-card h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}


/* ---------------------------------- */
/* 10. Animations & Keyframes */
/* ---------------------------------- */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* تطبيق الحركات الأساسية */
.fade-in-up, .slide-in-left, .slide-in-right, .bounce-in, .zoom-in {
    animation-fill-mode: both; 
    opacity: 0; 
}

/* تحديد أزمنة الحركات */
.fade-in-up { animation-name: fadeInUp; animation-duration: 0.7s; }
.slide-in-left { animation-name: slideInLeft; animation-duration: 0.8s; }
.slide-in-right { animation-name: slideInRight; animation-duration: 0.8s; }
.bounce-in { animation-name: bounceIn; animation-duration: 1.5s; } 
.zoom-in { animation-name: zoomIn; animation-duration: 0.6s; }


/* تأثير التتابع (Stagger) */
.fade-in-up-stagger li { 
    animation-name: fadeInUp; 
    animation-duration: 0.7s;
    animation-fill-mode: both;
    opacity: 0; 
}

.fade-in-up-stagger li:nth-child(1) { animation-delay: 0.3s; }
.fade-in-up-stagger li:nth-child(2) { animation-delay: 0.5s; }
.fade-in-up-stagger li:nth-child(3) { animation-delay: 0.7s; }
.fade-in-up-stagger li:nth-child(4) { animation-delay: 0.9s; }

/* ---------------------------------- */
/* 11. Mobile Responsiveness (Media Query) */
/* ---------------------------------- */
@media (max-width: 768px) {
    
    /* 1. Header & Navigation */
    header .container {
        flex-direction: column; /* ترتيب رأسي للشعار والقائمة */
    }

    nav ul {
        flex-direction: column; /* ترتيب رأسي لروابط القائمة */
        text-align: center;
        width: 100%;
        margin-top: 10px;
    }

    nav ul li {
        margin: 5px 0;
    }

    /* 2. Hero Section */
    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    /* 3. About Snippet */
    .about-snippet .container {
        flex-direction: column; /* ترتيب رأسي لقسم "عن الشركة" */
    }
    
    .about-content {
        padding-right: 0;
        border-right: none;
        border-bottom: 5px solid var(--secondary-color); /* نقل الخط الفاصل للأسفل */
        padding-bottom: 25px;
        margin-bottom: 25px;
    }

    .about-image {
        height: 200px;
    }
    
    /* 4. Contact Strip */
    .contact-strip p {
        display: flex; /* ترتيب أرقام الهواتف والبريد رأسيًا */
        flex-direction: column;
        gap: 5px;
    }

    /* 5. About Page (Vision & Mission) */
    .vision-mission {
        flex-direction: column;
        gap: 20px;
    }

    /* 6. Products Page */
    .product-grid {
        grid-template-columns: 1fr; /* عمود واحد للمنتجات */
    }

    /* 7. Contact Page Layout FIX */
    .contact-grid {
        grid-template-columns: 1fr; /* عمود واحد لصفحة الاتصال */
        gap: 30px;
    }
    
    /* ضمان أن النموذج (form) يظهر أولاً والمعلومات (info) تظهر ثانيًا */
    .contact-form {
        order: 1; /* يأتي النموذج أولاً */
    }

    .contact-info {
        order: 2; /* تأتي المعلومات ثانيًا */
    }
}