:root {
    --primary-green: #1b4332;
    --accent-green: #40916c;
    --mint-bg: #f8faf9;
    --white: #ffffff;
    --dark: #2d3436;
}

html { 
    scroll-behavior: smooth; 
    /* Remove overflow-x here, it's better handled on the body */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'El Messiri', sans-serif; background-color: var(--white); color: var(--dark); line-height: 1.8; text-align: center; overflow-x: hidden; }

/* Global Centering for Sections */
section {
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

/* --- Enhanced White Navbar --- */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8%;
    height: 90px;
    background-color: transparent; /* Initially transparent on the hero */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* State when user scrolls down */
nav.scrolled {
    height: 70px;
    background-color: rgba(255, 255, 255, 0.95);
    /* backdrop-filter: blur(10px); Removed to prevent laggy scrolling */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    color: var(--white); /* White on green background */
    transition: color 0.3s;
}

nav.scrolled .logo-text {
    color: var(--primary-green); /* Turns green on white background */
}

/* Nav Links & Hover Animation */
nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
    align-items: center;
}

nav ul li a {
    color: var(--white);
    font-weight: 600;
    font-size: 18px;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
    text-decoration: none; /* <--- Add this line here */
}

nav.scrolled ul li a {
    color: var(--dark);
}

/* Animated Underline Hover */
nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    right: 0;
    background-color: var(--accent-green);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a:hover {
    color: var(--accent-green) !important;
}

/* --- Burger Menu (Hidden on Desktop) --- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 2100;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

nav.scrolled .hamburger span {
    background-color: var(--primary-green);
}

/* --- Mobile View (Responsive) --- */
/* --- UNIVERSAL MOBILE FIXES --- */

@media (max-width: 992px) {
    /* 1. Burger Menu Fix */
    .hamburger { display: flex; }
    nav {
        padding: 0 5%;
        background-color: rgba(255, 255, 255, 0.95); /* Better visibility on mobile */
    }
    
    .logo-text { color: var(--primary-green) !important; }
    .hamburger span { background-color: var(--primary-green) !important; }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%; /* Slide from right in RTL */
        left: auto;
        width: 80%; /* Don't cover the whole screen, looks better */
        height: 100vh;
        background-color: var(--white);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1); /* Shadow on left for RTL */
        display: flex;
        flex-direction: column;
        justify-content: center;
        transition: 0.4s ease-in-out;
    }

    nav ul.active {
        right: 0;
    }

    /* 2. Circle Hero Scaling */
    #section2 {
        padding-top: 100px;
        overflow: hidden; /* Prevent circle items from bleeding out */
    }

    .circle-container {
        width: 300px; /* Scale down for mobile */
        height: 300px;
        transform: scale(0.8); /* Shrink further if needed */
    }

    .card {
        width: 80px;
        height: 80px;
    }

    .center-circle {
        width: 120px;
        height: 120px;
    }

    /* Recalculate radius for 300px container (approx 120px translation) */
    .item-1 { transform: translate(120px, 0); }
    .item-2 { transform: translate(85px, 85px); }
    .item-3 { transform: translate(0, 120px); }
    .item-4 { transform: translate(-85px, 85px); }
    .item-5 { transform: translate(-120px, 0); }
    .item-6 { transform: translate(-85px, -85px); }
    .item-7 { transform: translate(0, -120px); }
    .item-8 { transform: translate(85px, -85px); }

    nav ul li a {
        color: var(--primary-green) !important; /* Forces items to be green/dark on mobile */
        font-size: 22px; /* Optional: Make them a bit larger for touch */
    }
}

@media (max-width: 768px) {
    /* 3. Grid Fix - Essential */
    .about-grid {
        grid-template-columns: 1fr; /* Stack cards vertically */
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .contact-panel {
        width: 95%;
        margin-top: 20px; /* Remove the negative margin on mobile */
        padding: 30px 20px;
    }
}

/* 4. Global Image Safety */
img {
    max-width: 100%;
    height: auto;
}

/* Hero Section */
/* --- Hero Section & Circle Container --- */
#section2 {
    position: relative;
    min-height: 100vh; /* min-height is safer than height */
    height: auto; 
    padding: 120px 20px 60px;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    overflow: visible; /* Changed from hidden to visible */
}

#section2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.7) 0%, rgba(45, 106, 79, 0.7) 100%);
    z-index: 1;
}

.circle-container {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 40px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}


.hero-text {
    text-align: center;
    margin-top: 20px;
    color: #fff;
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-text button {
    background-color: var(--accent-green);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.hero-text button:hover {
    background-color: var(--primary-green);
}

/* The Center Piece */
.center-circle {
    position: absolute;
    width: 200px;
    height: 200px;
    background: #fff;
    border-radius: 50%;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.2);
    border: 5px solid var(--accent-green);
}

.center-circle img {
    width: 70%;
    object-fit: contain;
}

/* Individual Card (Circle Segments) */
.card {
    position: absolute;
    width: 140px;  /* Increased size */
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: all 0.4s ease;
    background: #fff;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Position Calculation 
   Formula: translate(cos(angle) * radius, sin(angle) * radius)
   Radius: 180px for 500px container
*/
/* Increased spacing by increasing the translation radius to 240px */
/* Balanced spacing with a 210px radius */
.item-1 { transform: translate(210px, 0); }
.item-2 { transform: translate(148px, 148px); }
.item-3 { transform: translate(0, 210px); }
.item-4 { transform: translate(-148px, 148px); }
.item-5 { transform: translate(-210px, 0); }
.item-6 { transform: translate(-148px, -148px); }
.item-7 { transform: translate(0, -210px); }
.item-8 { transform: translate(148px, -148px); } /* This fixes the misplaced image */
/* Hover Effects */
.card:hover {
    z-index: 10;
    border-color: var(--accent-green);
    cursor: pointer;
}

/* --- Layout Improvements (Centered & Spacious) --- */
.intro-panel {
    text-align: center;
    margin-bottom: 50px;
    color: #fff;
}

.intro-panel h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .circle-container {
        width: 450px;
        height: 450px;
    }
    .card {
        width: 110px;
        height: 110px;
    }
    .center-circle {
        width: 150px;
        height: 150px;
    }
    /* Adjusted radius for mobile: 170px */
    .item-1 { transform: translate(170px, 0); }
    .item-2 { transform: translate(120px, 120px); }
    .item-3 { transform: translate(0, 170px); }
    .item-4 { transform: translate(-120px, 120px); }
    .item-5 { transform: translate(-170px, 0); }
    .item-6 { transform: translate(-120px, -120px); }
    .item-7 { transform: translate(0, -170px); }
    .item-8 { transform: translate(120px, -120px); }
}
/* Circular Gallery Section */
#section5 { background-color: var(--white); padding: 120px 20px; }
#section5 h2 { margin-bottom: 60px; font-size: 32px; color: var(--primary-green); }

.circle-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 50px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.product-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.circle-img-wrapper {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--mint-bg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.circle-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-circle:hover .circle-img-wrapper {
    transform: scale(1.1);
    border-color: var(--accent-green);
}

.product-circle h3 {
    font-size: 18px;
    color: var(--primary-green);
    font-weight: 700;
}

/* Why Choose Us Section */
/* --- About Us Section Styles --- */
#section6 {
    background-color: var(--mint-bg);
    padding: 100px 8%;
}

.about-container {
    max-width: 1100px;
    width: 100%;
}

.section-title {
    color: var(--primary-green);
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.about-lead {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 2;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 300px);
    gap: 30px;
    justify-content: center;
}

.about-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
    border-bottom: 5px solid transparent;
}

.about-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-green);
}

.about-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;

}

.about-card i {
    font-size: 3rem;
    color: var(--accent-green);
    display: block;
    text-align: center;
    margin-bottom: 20px;
}

.about-card h3 {
    color: var(--primary-green);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.about-card p {
    font-size: 0.95rem;
    color: #666;
}

/* تحسين العرض للهواتف */
@media (max-width: 768px) {
    .section-title { font-size: 2rem; }
    .about-lead { font-size: 1.1rem; }
}
.services-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    max-width: 1200px;
    margin-top: 40px;
}
.service-item {
    background: white;
    padding: 50px 30px;
    border-radius: 25px;
    flex: 1 1 300px;
    max-width: 350px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

/* Contact Section - Centered Fix */
#section7 { padding: 0; height: auto; display: flex; flex-direction: column; }
.section7-map-wrapper { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 100%;
    background: transparent;
}

.contact-panel {
    background: white;
    padding: 60px 40px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 600px;
    margin: -100px auto 50px; /* Pulls it up over the map */
    z-index: 10;
}

.contact-panel h2 {
    color: var(--primary-green);
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 700;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 30px;
    background: var(--mint-bg);
    border-radius: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--dark);
    border: 2px solid transparent;
    width: 400px;
}

.info-item:nth-child(1) {
    margin-right: 0;
}

.info-item:nth-child(2) {
    margin-right: 40px;
}

.info-item:nth-child(3) {
    margin-right: 80px;
}

.info-item:nth-child(4) {
    margin-right: 120px;
}
.info-item:hover {
    background: var(--accent-green);
    color: white;
    border-color: var(--primary-green);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.info-item i {
    color: var(--accent-green);
    font-size: 24px;
    transition: color 0.3s;
}

.info-item:hover i {
    color: white;
}

.info-item p {
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

.map-container { width: 100%; height: 450px; z-index: 1; }

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s all ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .circle-img-wrapper { width: 150px; height: 150px; }
    .contact-panel { margin-top: 20px; padding: 40px 20px; }
    .contact-panel h2 { font-size: 2rem; }
    .info-item { padding: 20px; gap: 10px; margin-right: 0; width: 90%; }
    .info-item:nth-child(1) { margin-right: 0; }
    .info-item:nth-child(2) { margin-right: 0; }
    .info-item:nth-child(3) { margin-right: 0; }
    .info-item:nth-child(4) { margin-right: 0; }
    .info-item i { font-size: 20px; }
    .info-item p { font-size: 0.9rem; }
    #section2 { padding-top: 120px; }
    section { padding: 60px 15px; }
    .services-list { gap: 20px; max-width: 100%; }
    .service-item { padding: 30px 20px; max-width: 100%; flex: 1 1 45%; }
    .circle-gallery { 
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
    }
    .product-circle h3 { font-size: 16px; }
    .hero-text { margin-top: 30px; }
    .hero-text h1 { font-size: 2rem; }
    .hero-text button { padding: 12px 25px; font-size: 16px; }
}

/* Extra small screens */
@media (max-width: 480px) {
    nav { padding: 0 5%; height: 80px; }
    nav.scrolled { height: 60px; }
    .logo-text { font-size: 20px; }
    nav ul { gap: 20px; }
    nav ul li a { font-size: 16px; }
    #section2 { padding: 100px 10px; }
    .circle-container { width: 350px; height: 350px; }
    .card { width: 90px; height: 90px; }
    .center-circle { width: 120px; height: 120px; }
    .center-circle h1 { font-size: 14px; }
    .center-circle p { font-size: 10px; }
    /* Radius: 115px */
    .item-1 { transform: translate(115px, 0); }
    .item-2 { transform: translate(81px, 81px); }
    .item-3 { transform: translate(0, 115px); }
    .item-4 { transform: translate(-81px, 81px); }
    .item-5 { transform: translate(-115px, 0); }
    .item-6 { transform: translate(-81px, -81px); }
    .item-7 { transform: translate(0, -115px); }
    .item-8 { transform: translate(81px, -81px); }
    section { padding: 40px 10px; }
    .circle-gallery { 
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    .circle-img-wrapper { width: 120px; height: 120px; }
    .contact-panel { padding: 30px 15px; max-width: 95%; }
    .info-item { padding: 15px 10px; width: 85%; }
    .info-item:nth-child(1) { margin-right: 0; }
    .info-item:nth-child(2) { margin-right: 0; }
    .info-item:nth-child(3) { margin-right: 0; }
    .map-container { height: 300px; }
    .hero-text h1 { font-size: 1.8rem; }
    .hero-text button { padding: 10px 20px; font-size: 14px; }
    .services-list { gap: 15px; max-width: 100%; }
    .service-item { padding: 25px 15px; flex: 1 1 100%; }
    .about-grid { grid-template-columns: 1fr; gap: 20px; }
    .about-card { padding: 20px 15px; }
    .about-card img { height: 120px; }
    .about-card i { font-size: 2.5rem; margin-bottom: 15px; }
    .about-card h3 { font-size: 1.2rem; }
    .about-card p { font-size: 0.9rem; }
}