:root{
  --green:#047d35;
  --green-dark:#035f28;
  --white:#ffffff;
  --bg:#f6faf7;
  --text:#0f1a14;
  --muted:#6b7a72;
  --radius:18px;
  --shadow:0 10px 30px rgba(0,0,0,.08);
}

*{box-sizing:border-box; margin:0; padding:0}
body{
  font-family:"Tajawal",sans-serif;
  color:var(--text);
  background:var(--white);
  line-height:1.7;
}
img{max-width:100%; display:block}
a{text-decoration:none; color:inherit}
.container{width:min(1200px,92%); margin:auto}

/* ============ LOADER ============ */
#loader{
  position:fixed; inset:0; background:var(--white);
  display:grid; place-items:center; z-index:9999;
  transition:opacity .5s ease, visibility .5s ease;
}
#loader.hide{opacity:0; visibility:hidden}
.loader-card{
  text-align:center; padding:30px 26px; border-radius:24px;
  background:linear-gradient(180deg,#fff, #f2faf4);
  box-shadow:var(--shadow); width:min(420px,92%);
}
.loader-logo{
  width:110px; height:110px; margin:0 auto 12px;
  display:grid; place-items:center; border-radius:50%;
  background:#e9f7ee; border:3px solid var(--green);
  overflow:hidden;
}
.loader-logo img{width:70%; height:70%; object-fit:contain}
.logo-fallback{
  font-weight:900; color:var(--green);
  font-size:22px; display:none;
}
.loader-title{font-size:26px; font-weight:900; color:var(--green)}
.loader-sub{color:var(--muted); font-weight:600}
.loader-bar{
  width:100%; height:7px; background:#e6eee9; border-radius:100px;
  margin-top:18px; overflow:hidden;
}
.loader-bar span{
  display:block; height:100%; width:40%;
  background:var(--green);
  animation:loadbar 1.2s infinite ease-in-out;
}
@keyframes loadbar{
  0%{transform:translateX(-120%)}
  100%{transform:translateX(260%)}
}

/* ============ TOPBAR ============ */
.topbar{
  background:var(--green);
  color:var(--white);
  font-size:14px;
}
.topbar-content{
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 0; gap:10px; flex-wrap:wrap;
}
.topbar-item a{color:#eafff1}
.dot{width:7px;height:7px;background:#9cffc1;border-radius:50%;display:inline-block;margin-left:6px}
.sep{margin:0 8px; opacity:.7}

/* ============ NAVBAR ============ */
.navbar{
  position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom:1px solid #eef2ef;
}
.nav-content{display:flex; align-items:center; justify-content:space-between; padding:10px 0}
.brand{display:flex; gap:10px; align-items:center}
.brand img{width:46px;height:46px;object-fit:contain}
.brand-text strong{display:block; font-weight:900; color:var(--green)}
.brand-text small{color:var(--muted); font-weight:600}
.nav-links{
  display:flex; gap:14px; align-items:center;
}
.nav-links a{
  padding:8px 10px; border-radius:10px; font-weight:700; color:#193022;
}
.nav-links a.active, .nav-links a:hover{
  background:#eaf7ef; color:var(--green);
}

.nav-actions{display:flex; gap:8px; align-items:center}
.hamburger{
  display:none; width:42px; height:42px; border-radius:12px;
  border:1px solid #e7efe9; background:#fff;
  cursor:pointer; place-items:center; padding:8px;
}
.hamburger span{display:block;height:2px;background:#143022;margin:5px 0;border-radius:5px}

/* ============ BUTTONS ============ */
.btn{
  padding:10px 14px; border-radius:12px; font-weight:800;
  border:1px solid transparent; cursor:pointer; display:inline-flex;
  align-items:center; gap:6px; transition:.2s ease;
}
.btn.primary{background:var(--green); color:#fff}
.btn.primary:hover{background:var(--green-dark); transform:translateY(-1px)}
.btn.light{background:#fff;color:var(--green); border-color:#dfece4}
.btn.light:hover{background:#f4faf6}
.btn.ghost{background:#eef7f1;color:var(--green); border-color:#dfece4}
.btn.ghost:hover{background:#e3f3e9}
.w-full{width:100%; justify-content:center}

/* ============ HERO ============ */
.hero{position:relative}
.hero-slider{position:relative; height:78vh; min-height:520px; overflow:hidden}
.slide{
  position:absolute; inset:0; background-size:cover; background-position:center;
  opacity:0; transform:scale(1.05);
  transition:opacity .7s ease, transform 1.2s ease;
}
.slide.active{opacity:1; transform:scale(1)}
.overlay{position:absolute; inset:0; background:linear-gradient(90deg,rgba(4,125,53,.9), rgba(4,125,53,.2))}
.hero-content{
  position:relative; color:#fff; height:100%;
  display:flex; flex-direction:column; justify-content:center; gap:12px;
}
.hero-content h2{font-size:42px; font-weight:900}
.hero-content p{font-size:18px; max-width:650px}
.hero-cta{display:flex; gap:10px; flex-wrap:wrap}
.slider-btn{
  position:absolute; top:50%; transform:translateY(-50%);
  width:46px; height:46px; border-radius:50%;
  background:#fff; color:var(--green); border:none; font-size:28px; cursor:pointer;
  display:grid; place-items:center; box-shadow:var(--shadow);
}
.slider-btn.prev{right:18px}
.slider-btn.next{left:18px}
.slider-dots{
  position:absolute; bottom:14px; left:50%; transform:translateX(-50%);
  display:flex; gap:7px;
}
.slider-dots button{
  width:10px;height:10px;border-radius:50%; border:none; cursor:pointer;
  background:rgba(255,255,255,.6)
}
.slider-dots button.active{background:#fff; transform:scale(1.2)}

.hero-badges{
  display:grid; grid-template-columns:repeat(3,1fr); gap:12px;
  margin-top:-40px; position:relative; z-index:2;
}
.badge{
  background:#fff; border-radius:18px; box-shadow:var(--shadow);
  padding:14px; display:flex; gap:12px; align-items:center;
}
.badge-icon{font-size:28px}
.badge h4{color:var(--green); font-weight:900}
.badge p{color:var(--muted); font-size:14px}

/* ============ SECTIONS ============ */
.section{padding:70px 0}
.section-title{
  font-size:30px; font-weight:900; color:#0f2a1c; margin-bottom:16px;
}
.center{text-align:center}

.grid-2{
  display:grid; grid-template-columns:1.1fr .9fr; gap:22px; align-items:center;
}

/* ABOUT */
.about-text p{color:#24352b}
.about-list{margin-top:14px; display:grid; gap:8px}
.check{background:#f1f8f3; padding:10px 12px; border-radius:12px; font-weight:700}
.about-cta{margin-top:16px; display:flex; gap:8px}

.about-card{
  background:#fff; border-radius:20px; box-shadow:var(--shadow); overflow:hidden;
}
.about-img img{height:320px; width:100%; object-fit:cover}
.about-mini{display:grid; grid-template-columns:repeat(3,1fr); text-align:center}
.about-mini div{padding:14px}
.about-mini strong{font-size:24px;color:var(--green)}
.about-mini span{color:var(--muted); font-weight:700}

/* SERVICES */
.services{background:var(--bg)}
.cards-3{
  display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-top:14px
}
.card{
  background:#fff; border-radius:18px; box-shadow:var(--shadow);
  padding:18px; transition:.2s ease; border:1px solid #eef3ef;
}
.card:hover{transform:translateY(-4px); border-color:#d9eee2}
.card-icon{font-size:30px; margin-bottom:6px}
.card h4{color:#0f2a1c; font-weight:900}
.card p{color:var(--muted); font-size:15px}

/* STATS */
.stats{
  background:linear-gradient(180deg,#fff,#f3faf5);
  padding:40px 0;
}
.stats-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:12px;
}
.stat{
  background:#fff; border-radius:16px; padding:18px; text-align:center; box-shadow:var(--shadow);
}
.stat strong{font-size:30px; color:var(--green); font-weight:900}
.stat span{color:var(--muted); font-weight:800}

/* PRODUCTS */
.products-toolbar{
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; margin:8px 0 18px;
}
.filter-tabs{display:flex; gap:8px; flex-wrap:wrap}
.tab{
  padding:8px 12px; border-radius:12px; border:1px solid #e6efe9;
  background:#fff; font-weight:800; cursor:pointer; transition:.2s ease;
}
.tab.active, .tab:hover{background:#eaf7ef; color:var(--green); border-color:#d9eee2}
.search-box{
  position:relative; min-width:220px;
}
.search-box input{
  width:100%; padding:10px 36px 10px 12px; border-radius:12px;
  border:1px solid #e6efe9; outline:none; font-weight:700;
}
.search-box span{position:absolute; left:10px; top:50%; transform:translateY(-50%); opacity:.6}

.products-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:14px;
}
.product-card{
  background:#fff; border-radius:18px; overflow:hidden; box-shadow:var(--shadow);
  border:1px solid #eef3ef; transition:.2s ease;
}
.product-card:hover{transform:translateY(-4px); border-color:#d9eee2}
.product-img{position:relative}
.product-img img{height:210px; width:100%; object-fit:cover}
.tag{
  position:absolute; top:10px; right:10px; background:var(--green); color:#fff;
  padding:5px 9px; border-radius:999px; font-size:12px; font-weight:800;
}
.product-info{padding:14px}
.product-info h4{font-weight:900; margin-bottom:4px}
.product-info p{color:var(--muted); font-size:14px}
.product-actions{display:flex; gap:8px; margin-top:10px}

/* GALLERY */
.gallery{background:var(--bg)}
.gallery-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:12px;
}
.g-item{border-radius:14px; overflow:hidden; cursor:pointer; box-shadow:var(--shadow)}
.g-item img{height:220px; width:100%; object-fit:cover; transition:.25s}
.g-item:hover img{transform:scale(1.05)}

.lightbox{
  position:fixed; inset:0; background:rgba(0,0,0,.75);
  display:none; place-items:center; z-index:60; padding:20px;
}
.lightbox.show{display:grid}
.lightbox img{max-height:86vh; border-radius:12px}
.lightbox button{
  position:absolute; top:20px; left:20px; width:44px;height:44px;border-radius:50%;
  border:none;background:#fff;color:#111;font-size:20px;cursor:pointer;
}

/* TESTIMONIALS */
.testi-wrap{position:relative; margin-top:12px}
.testi-slider{overflow:hidden}
.testi-card{
  display:none; background:#fff; border-radius:18px; padding:18px; box-shadow:var(--shadow);
}
.testi-card.active{display:block; animation:fadeUp .4s ease}
@keyframes fadeUp{from{opacity:0; transform:translateY(8px)}to{opacity:1; transform:none}}
.testi-user{display:flex; gap:10px; align-items:center; margin-top:10px}
.avatar{
  width:42px;height:42px;border-radius:50%; background:#eaf7ef;color:var(--green);
  display:grid;place-items:center;font-weight:900;
}
.testi-card p{font-weight:700;color:#1b2a21}
.testi-card strong{font-weight:900}
.testi-card small{color:var(--muted); font-weight:700}
.testi-btn{
  position:absolute; top:50%; transform:translateY(-50%);
  width:44px;height:44px;border-radius:50%; border:none; cursor:pointer;
  background:#fff; color:var(--green); font-size:26px; box-shadow:var(--shadow);
}
.testi-btn.prev{right:-10px}
.testi-btn.next{left:-10px}

/* CONTACT */
.contact .map{
  width:100%; height:260px; border:0; border-radius:14px; margin-top:10px;
}
.info-list{display:grid; gap:8px; margin-top:10px}
.info-item{background:#f1f8f3; padding:10px 12px; border-radius:12px; font-weight:800}

.contact-form{
  background:#fff; border-radius:18px; padding:18px; box-shadow:var(--shadow);
  border:1px solid #eef3ef;
}
.contact-form h4{font-size:20px; font-weight:900; margin-bottom:8px}
.form-row{display:grid; gap:6px; margin-bottom:10px}
.form-row label{font-weight:800}
.form-row input, .form-row textarea, .form-row select{
  padding:10px 12px; border-radius:12px; border:1px solid #e6efe9; outline:none; font-weight:700;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus{
  border-color:var(--green); box-shadow:0 0 0 3px #eaf7ef;
}
.error{color:#d62929; font-weight:800; min-height:16px}
.form-success{
  margin-top:10px; background:#eaf7ef; color:var(--green);
  padding:8px 10px; border-radius:10px; font-weight:900; display:none;
}

/* FOOTER */
.footer{
  background:#0d2418; color:#e8f6ee; padding:38px 0 0;
}
.footer-grid{
  display:grid; grid-template-columns:2fr 1fr 1fr; gap:14px;
}
.foot-col h4{font-weight:900; margin-bottom:6px}
.foot-col p{color:#cfe6d7}
.foot-col a{display:block; margin-top:6px; color:#cfe6d7; font-weight:700}
.social{display:flex; gap:8px; margin-top:8px}
.social a{
  width:36px;height:36px;border-radius:8px;background:#173a27;display:grid;place-items:center;font-weight:900
}
.foot-bottom{
  padding:12px 0; border-top:1px solid rgba(255,255,255,.1); margin-top:14px; text-align:center;
}

/* FLOATING */
.float-whatsapp{
  position:fixed; bottom:16px; right:16px; width:54px;height:54px;border-radius:50%;
  background:var(--green); color:#fff; display:grid; place-items:center; font-size:22px;
  box-shadow:var(--shadow); z-index:70;
}
.back-top{
  position:fixed; bottom:16px; left:16px; width:54px;height:54px;border-radius:50%;
  background:#fff; color:var(--green); border:1px solid #e8efe9; display:none;
  place-items:center; font-size:20px; cursor:pointer; box-shadow:var(--shadow); z-index:70;
}
.back-top.show{display:grid}

/* MODAL */
.modal{
  position:fixed; inset:0; background:rgba(0,0,0,.6);
  display:none; place-items:center; z-index:80; padding:16px;
}
.modal.show{display:grid}
.modal-card{
  width:min(520px,95%); background:#fff; border-radius:18px; padding:16px; position:relative;
  animation:fadeUp .3s ease;
}
.modal-card img{height:240px; width:100%; object-fit:cover; border-radius:12px}
.modal-card h4{margin:8px 0 4px; font-weight:900}
.modal-card p{color:var(--muted); font-weight:700}
.modal-close{
  position:absolute; top:10px; left:10px; width:40px;height:40px;border-radius:50%; border:none; cursor:pointer;
  background:#fff; box-shadow:var(--shadow); font-size:18px;
}

/* REVEAL */
.reveal{opacity:0; transform:translateY(14px); transition:.6s ease}
.reveal.show{opacity:1; transform:none}

/* RESPONSIVE */
@media (max-width: 1000px){
  .grid-2{grid-template-columns:1fr}
  .cards-3, .products-grid, .gallery-grid{grid-template-columns:repeat(2,1fr)}
  .hero-badges{grid-template-columns:1fr; margin-top:10px}
  .footer-grid{grid-template-columns:1fr}
}
@media (max-width: 640px){
  .nav-links{
    position:fixed; top:64px; right:0; left:0;
    background:#fff; border-bottom:1px solid #eef2ef;
    padding:12px; display:none; flex-direction:column; align-items:flex-start;
  }
  .nav-links.open{display:flex}
  .hamburger{display:grid}
  .hero-content h2{font-size:30px}
  .cards-3, .products-grid, .gallery-grid{grid-template-columns:1fr}
}
/* ================== GLOBAL IMAGE CONTROL ================== */
/* يخلي كل الصور ما تكسرش ال layout */
img{
  width: 100%;
  height: auto;
}

/* ================== HERO (موبايل) ================== */
.hero-slider{
  height: 72vh;
  min-height: 460px;
}

@media (max-width: 640px){
  .hero-slider{
    height: 62vh;
    min-height: 380px;
  }

  .hero-content{
    padding-top: 30px;
    padding-bottom: 90px; /* مساحة للدوتس والبنرات */
  }

  .hero-content h2{
    font-size: 26px;
    line-height: 1.35;
  }

  .hero-content p{
    font-size: 15px;
    max-width: 100%;
  }

  .hero-cta .btn{
    width: 100%;
    justify-content: center;
  }

  .slider-btn{
    width: 40px; height: 40px; font-size: 22px;
  }
  .slider-btn.prev{ right: 10px; }
  .slider-btn.next{ left: 10px; }

  .slider-dots{
    bottom: 10px;
  }
}

/* ================== BADGES (موبايل) ================== */
.hero-badges{
  grid-template-columns: repeat(3,1fr);
}

@media (max-width: 1000px){
  .hero-badges{
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
  }
}

@media (max-width: 640px){
  .hero-badges{
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
  }
  .badge{
    padding: 12px;
  }
}

/* ================== ABOUT IMAGE FIX ================== */
.about-img img{
  width: 100%;
  aspect-ratio: 16 / 9;   /* نفس النسبة دائماً */
  height: auto;
  object-fit: cover;
}

/* ================== SERVICES / CARDS (موبايل) ================== */
@media (max-width: 640px){
  .cards-3{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card{
    padding: 14px;
  }
}

/* ================== PRODUCTS IMAGE FIX ================== */
/* مهم: يمنع اختلاف ارتفاع الكروت بسبب الصور */
.product-img img{
  width: 100%;
  aspect-ratio: 4 / 3;    /* ثابت */
  height: auto;
  object-fit: cover;
}

.product-card{
  display: flex;
  flex-direction: column;
  height: 100%; /* يخلي الكروت متساوية */
}
.product-info{
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.product-actions{
  margin-top: auto; /* الأزرار تنزل تحت دائماً */
}

@media (max-width: 1000px){
  .products-grid{
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 640px){
  .products-grid{
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .products-toolbar{
    flex-direction: column;
    align-items: stretch;
  }
  .search-box{
    width: 100%;
  }
}

/* ================== GALLERY IMAGE FIX ================== */
.g-item img{
  width: 100%;
  aspect-ratio: 1 / 1;   /* مربعات متساوية */
  height: auto;
  object-fit: cover;
}

@media (max-width: 1000px){
  .gallery-grid{
    grid-template-columns: repeat(2,1fr);
  }
}
@media (max-width: 640px){
  .gallery-grid{
    grid-template-columns: 1fr;
  }
}

/* ================== MODAL IMAGE FIX ================== */
.modal-card img{
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}

/* ================== STATS (موبايل) ================== */
@media (max-width: 640px){
  .stats-grid{
    grid-template-columns: repeat(2,1fr);
    gap: 8px;
  }
}

/* ================== NAV (موبايل) تحسين المسافات ================== */
@media (max-width: 640px){
  .topbar-content{
    justify-content: center;
    text-align: center;
  }
  .nav-links{
    gap: 6px;
  }
  .nav-links a{
    width: 100%;
  }
}
