:root {
    --emerald: #005632;    
    --fern: #526E49;      
    --copper: #A48560;       
    --pale-oak: #CDBDAB;     
    --white-smoke: #F5F5F5; 
    --alt-bg-color: #eaddcd; 
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --shadow: 0 10px 30px rgba(0, 86, 50, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--white-smoke);
    color: var(--text-dark);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- TEXTURE BACKGROUND --- */
body.texture-bg {
    background-image: linear-gradient(rgba(245, 245, 245, 0.9), rgba(245, 245, 245, 0.9)), url('../assets/back7.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- 1. FIXED NAVBAR --- */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 5%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.logo { height: 60px; width: auto; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
    color: var(--emerald); font-weight: 700; font-size: 1.1rem;
    transition: var(--transition); position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--copper); }
.nav-links a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -5px; right: 0; background-color: var(--copper); transition: var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 15px; }
.lang-menu { position: relative; display: inline-block; }
.lang-btn {
    background: transparent; border: 1px solid var(--copper); border-radius: 50%;
    width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; color: var(--emerald);
}
.lang-btn:hover { background-color: var(--copper); color: white; }
.lang-dropdown {
    display: none; position: absolute; top: 50px; left: 50%; transform: translateX(-50%);
    background-color: var(--white); min-width: 120px; box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px; z-index: 2000; text-align: center;
}
.lang-dropdown.show { display: block; animation: fadeIn 0.3s; }
.lang-dropdown a {
    color: var(--text-dark); padding: 12px 16px; display: block;
    font-size: 0.9rem; border-bottom: 1px solid #eee;
}
.lang-dropdown a:hover { background-color: var(--white-smoke); color: var(--emerald); }
.menu-toggle { display: none; font-size: 1.8rem; color: var(--emerald); cursor: pointer; z-index: 1001; }

/* --- 2. MAIN HERO SECTION (HOME) --- */
.main-hero {
    position: relative;
    height: 90vh;
    background: url('../assets/back7.jpg') no-repeat center center/cover;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin-bottom: 0; 
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0, 50, 30, 0.75), rgba(0, 86, 50, 0.4));
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; color: white; padding-top: 60px;
}
.hero-content { max-width: 800px; padding: 20px; z-index: 2; }
.badge {
    background: var(--copper); color: white; padding: 5px 15px; border-radius: 20px;
    font-size: 0.9rem; font-weight: bold; text-transform: uppercase; margin-bottom: 1rem; display: inline-block;
}
.main-hero h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 1rem; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.main-hero p { font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.95; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-btns { display: flex; gap: 15px; justify-content: center; }
.btn-primary { 
    background: var(--copper); color: white; padding: 12px 30px; 
    border-radius: 50px; font-weight: bold; transition: 0.3s; border: 2px solid var(--copper);
}
.btn-primary:hover { background: transparent; color: var(--copper); border-color: var(--copper); }
.btn-outline { 
    border: 2px solid white; color: white; padding: 12px 30px; 
    border-radius: 50px; font-weight: bold; transition: 0.3s; 
}
.btn-outline:hover { background: white; color: var(--emerald); }

.hero-stats {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px);
    display: flex; justify-content: center; gap: 4rem; padding: 1.5rem; 
    border-top: 1px solid rgba(255,255,255,0.1);
}
.stat-item { display: flex; align-items: center; gap: 10px; color: white; text-align: left; }
html[dir="rtl"] .stat-item { text-align: right; }
.stat-icon { font-size: 2rem; }
.stat-item strong { display: block; font-size: 1.5rem; line-height: 1; }
.stat-item p { font-size: 0.8rem; opacity: 0.8; margin: 0; }

/* --- 3. FEATURES GRID (HOME) --- */
.features-section { padding: 5rem 5%; background: transparent; text-align: center; }
.section-header { margin-bottom: 3rem; }
.section-header h2 { font-size: 2.5rem; color: var(--emerald); margin-bottom: 0.5rem; }
.section-header p { color: #666; font-size: 1.1rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.feature-card {
    background: rgba(255, 255, 255, 0.9); padding: 2rem; border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); transition: 0.3s; border: 1px solid #eee;
}
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: var(--copper); }
.f-icon { font-size: 3rem; margin-bottom: 1rem; }
.feature-card h3 { color: var(--emerald); margin-bottom: 1rem; font-size: 1.2rem; }
.feature-card p { color: #666; font-size: 0.95rem; line-height: 1.5; }

/* --- 4. ABOUT SECTION --- */
.about {
    padding: 4rem 5%; 
    background: transparent;
    color: var(--text-dark); display: flex; align-items: center; gap: 4rem;
}
.about-content { flex: 1; }
.about-content h2 { font-size: 2.5rem; margin-bottom: 1.5rem; color: var(--emerald); }
.about-content p { font-size: 1.1rem; margin-bottom: 1.5rem; color: #555; }
.about-img { flex: 1; }
.about-img img { border-radius: var(--radius); border: 7px solid var(--copper); box-shadow: var(--shadow); }

/* --- 5. HERO PRODUCTS --- */
.hero-product {
    min-height: 90vh; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 5rem 5%; 
    overflow: hidden; 
    flex-direction: row; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; 
}

/* AUTOMATIC ALTERNATING LAYOUT */
.hero-product:nth-of-type(even) {
    flex-direction: row-reverse;
}

/* Individual Product Backgrounds */
.steamed-rice {
    background-image: linear-gradient(rgba(245, 245, 245, 0.9), rgba(245, 245, 245, 0.9)), url('../assets/back.jpg');
}
.haricot {
    background-image: linear-gradient(rgba(234, 221, 205, 0.9), rgba(234, 221, 205, 0.9)), url('../assets/back2.jpg');
}
.pois-chiche {
    background-image: linear-gradient(rgba(245, 245, 245, 0.9), rgba(245, 245, 245, 0.9)), url('../assets/back4.jpg');
}
.white-rice{
    background-image: linear-gradient(rgba(106, 215, 144, 0.9), rgba(106, 215, 144, 0.9)), url('../assets/back3.jpg');
}
.lentil {
    background-image: linear-gradient(rgba(234, 221, 205, 0.9), rgba(234, 221, 205, 0.9)), url('../assets/back5.jpg');
}

.hero-text { flex: 1; max-width: 600px; z-index: 2; padding: 2rem; }
.hero-text h1 { font-size: 3.5rem; color: var(--emerald); line-height: 1.2; margin-bottom: 1rem; }
.hero-text p { font-size: 1.2rem; color: var(--fern); margin-bottom: 2rem; max-width: 90%; font-weight: 500; }
.hero-image-container { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; z-index: 2; }

/* --- FIX: Poster Sizing --- */
.Poster { 
    width: 70vh; /* Default for Desktop */
    max-width: 100%; /* Safety cap */
    height: auto;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.4));
    border-radius: 15px; border: 7px solid var(--fern);
}

/* --- 6. FOOTER --- */
footer { background-color: #003d23; color: var(--white); padding: 4rem 5% 2rem; position: relative; z-index: 2; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; margin-bottom: 3rem; }
.footer-col h4 { color: var(--copper); margin-bottom: 1.5rem; font-size: 1.2rem; }
.footer-col ul li { margin-bottom: 0.8rem; }
.copyright { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); color: #aaa; }
.map-container { margin-top: 15px; border-radius: 8px; overflow: hidden; }

/* --- 7. GENERIC COMPONENTS --- */
.cta-btn {
    background-color: var(--emerald); color: var(--white);
    padding: 0.8rem 1.5rem; border-radius: 50px;
    font-weight: 700; transition: var(--transition);
    border: 2px solid var(--emerald); display: inline-block; cursor: pointer;
}
.cta-btn:hover { background-color: transparent; color: var(--emerald); transform: translateY(-2px); }

/* PRODUCTS PAGE STYLES */
.products-container { padding: 5rem 5%; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2.5rem; }
.product-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: var(--transition); text-align: center;
}
.product-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 86, 50, 0.15); }
.p-image { height: 300px; background-color: rgba(245, 245, 245, 0.5); padding: 20px; display: flex; align-items: center; justify-content: center; }
.p-image img { max-height: 100%; width: auto; object-fit: contain; }
.p-info { padding: 1.5rem; }
.p-info h3 { color: var(--emerald); font-size: 1.4rem; margin-bottom: 0.5rem; }
.p-btn {
    display: block; text-align: center; padding: 0.8rem;
    border: 1px solid var(--copper); color: var(--copper); border-radius: 8px;
    font-weight: 700; transition: var(--transition);
}
.p-btn:hover { background-color: var(--copper); color: var(--white); }

/* SINGLE PRODUCT PAGE STYLES */
.single-product-container { padding: 8rem 5% 4rem; max-width: 1200px; margin: 0 auto; }
.back-link {
    display: inline-block; margin-bottom: 2rem; font-weight: bold; color: var(--emerald);
    background: white; padding: 10px 20px; border-radius: 50px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.details-wrapper {
    display: flex; gap: 4rem; background: rgba(255, 255, 255, 0.95); padding: 3rem;
    border-radius: var(--radius); box-shadow: var(--shadow); align-items: center;
}
.detail-image { flex: 1; display: flex; justify-content: center; padding: 2rem; }
.detail-image img { max-height: 500px; width: auto; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.2)); }
.detail-info { flex: 1; }
.nutrition-box { margin-bottom: 2rem; background: #fdfdfd; border: 1px solid #eee; border-radius: 8px; padding: 1.5rem; }
.nutrition-table { width: 100%; border-collapse: collapse; }
.nutrition-table td { padding: 12px 0; border-bottom: 1px solid #eee; }

/* CONTACT FORM STYLES */
.contact-form-container.full-width {
    width: 95%; max-width: 1300px; margin: 0 auto; 
    background-color: rgba(255, 255, 255, 0.98);
    padding: 3rem; border-radius: var(--radius); box-shadow: var(--shadow); text-align: right; 
}
html[dir="ltr"] .contact-form-container.full-width { text-align: left; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--emerald); font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px;
    font-family: inherit; font-size: 1rem; outline: none; transition: border 0.3s;
}
.horizontal-split-layout { display: flex; gap: 3rem; align-items: flex-start; }
.products-section { flex: 3; }
.comments-section { flex: 2; }
.product-row { display: flex; justify-content: space-between; align-items: center; background: var(--white-smoke); padding: 15px; border-radius: 8px; margin-bottom: 10px; }
.checkbox-container { display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--emerald); flex: 1; font-weight: 700;}
.qty-input { width: 100px; padding: 10px; border: 1px solid #ccc; border-radius: 6px; text-align: center; }
.section-title { color: var(--text-dark); font-size: 1.3rem; margin-bottom: 1rem; border-bottom: 3px solid var(--emerald); display: inline-block; padding-bottom: 5px; }

/* UTILS & ANIMATION */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

.whatsapp-float {
    position: fixed; bottom: 20px; left: 20px; width: 60px; height: 60px;
    background-color: #25d366; border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000; display: flex; justify-content: center; align-items: center;
}
.whatsapp-float img { width: 35px; height: 35px; }
.force-ltr { direction: ltr !important; display: inline-block; }

/* ==========================================================================
   RESPONSIVE FIXES - THIS IS THE CRITICAL PART
   ========================================================================== */

@media (max-width: 900px) {
    /* --- FIX: Stack Products Vertically --- */
    .hero-product, .hero-product:nth-of-type(even) {
        flex-direction: column-reverse !important; /* Image on top, Text bottom */
        text-align: center;
        justify-content: center;
        padding: 4rem 5% 2rem;
        min-height: auto;
        gap: 2rem;
    }

    /* --- FIX: PREVENT HUGE IMAGES --- */
    .Poster {
        width: 100% !important; /* Force width to fit screen */
        height: auto;
        max-width: 350px; /* Limit size so it doesn't look weird */
    }

    .hero-text { margin-bottom: 0; padding: 1rem 0; }
    .hero-text h1 { font-size: 2.2rem; }
    .hero-image-container { width: 100%; margin: 0 auto; }
    
    .horizontal-split-layout { flex-direction: column; }
    .details-wrapper { flex-direction: column; padding: 1.5rem; }
    .about { flex-direction: column-reverse; text-align: center; padding: 3rem 5%; }
}

@media (max-width: 768px) {
    /* --- FIX: Mobile Menu Background --- */
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; width: 100%;
        background-color: var(--white); /* White background added */
        flex-direction: column; align-items: center;
        padding: 2rem 0; box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-top: 1px solid rgba(0,0,0,0.05);
    }
    .nav-links.active { display: flex; animation: slideDown 0.3s ease forwards; }
    .nav-links li { margin: 1rem 0; width: 100%; text-align: center; }
    .menu-toggle { display: block; }
    
    .main-hero h1 { font-size: 1.8rem; }
    
    /* --- FIX: Stats Layout --- */
    .hero-stats { 
        flex-direction: column; 
        gap: 1.5rem; 
        align-items: center; 
        padding: 2rem;
        position: relative;
        background: rgba(0,0,0,0.7);
    }
    
    .contact-form-container.full-width { padding: 1.5rem; width: 100%; }
    .product-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .qty-input { width: 100%; }
    .detail-image img { max-height: 300px; }
}
