:root{
  --bg: #070A12;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.09);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --line: rgba(255,255,255,.12);
  --gold: #D7B56D;
  --accent:#7DE0FF;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --radius: 18px;
  --radius2: 26px;
  --max: 1180px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(1200px 800px at 15% 0%, rgba(125,224,255,.18), transparent 55%),
    radial-gradient(900px 700px at 85% 15%, rgba(215,181,109,.20), transparent 55%),
    linear-gradient(180deg, #050611, #050611 45%, #070A12);
  color:var(--text);
  font-family: Cairo, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x:hidden;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}
.container{max-width:var(--max); margin:0 auto; padding:0 20px}

/* Header */
header{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(12px);
  background: rgba(7,10,18,.55);
  border-bottom:1px solid var(--line);
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
  gap:14px;
}
.brand{display:flex; align-items:center; gap:12px; min-width: 220px;}
.brand img{width:44px; height:44px; border-radius:14px; background: rgba(255,255,255,.08); padding:6px}
.brand .name{display:flex; flex-direction:column; line-height:1.1}
.brand .name strong{font-size:16px; letter-spacing:.2px}
.brand .name span{font-size:12px; color:var(--muted)}

nav ul{
  display:flex; gap:18px; list-style:none; padding:0; margin:0;
  align-items:center;
}
nav a{
  font-size:13px; color:var(--muted);
  padding:8px 10px; border-radius:12px;
  transition:.2s ease;
}
nav a:hover{color:var(--text); background: rgba(255,255,255,.06)}
nav a.active{
  color:var(--text);
  background: rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.10)
}

.actions{display:flex; align-items:center; gap:10px}
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  font-size:13px;
  cursor:pointer;
  transition:.2s ease;
  display:inline-flex; align-items:center; gap:8px;
  white-space:nowrap;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,.10)}
.btn.primary{
  border-color: rgba(215,181,109,.45);
  background: linear-gradient(135deg, rgba(215,181,109,.22), rgba(125,224,255,.10));
  box-shadow: 0 12px 40px rgba(215,181,109,.10);
}
.pill{
  font-size:12px; color:rgba(255,255,255,.78);
  border:1px solid rgba(215,181,109,.35);
  background: rgba(215,181,109,.10);
  padding:6px 10px; border-radius:999px;
}

/* Page hero */
.page-hero{padding:40px 0 18px}
.hero-card{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding:26px;
  position:relative;
  overflow:hidden;
}
.hero-card:before{
  content:"";
  position:absolute; inset:-2px;
  background: radial-gradient(700px 300px at 20% 0%, rgba(125,224,255,.22), transparent 60%),
              radial-gradient(700px 300px at 80% 30%, rgba(215,181,109,.18), transparent 55%);
  pointer-events:none;
  opacity:.95;
}
.hero-card > *{position:relative; z-index:1}
.kicker{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:12px}
h1{margin:0; font-size:34px; letter-spacing:.2px; line-height:1.15}
.subtitle{
  margin-top:10px;
  font-size:14px;
  color:var(--muted);
  line-height:1.9;
  max-width: 72ch;
}

/* Sections */
section{padding:24px 0}
.section-head{
  display:flex; align-items:end; justify-content:space-between;
  gap:16px; margin-bottom:16px;
}
.section-head h2{margin:0; font-size:20px}
.section-head p{margin:0; color:var(--muted); font-size:13px; line-height:1.8; max-width:70ch}

.grid-3{display:grid; grid-template-columns: repeat(3, 1fr); gap:14px}
.grid-2{display:grid; grid-template-columns: repeat(2, 1fr); gap:14px}

.card{
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding:18px;
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}
.card h3{margin:0 0 8px; font-size:16px}
.card p{margin:0; color:var(--muted); font-size:13px; line-height:1.9}

.icon{
  width:42px; height:42px; border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(215,181,109,.18), rgba(125,224,255,.10));
  border:1px solid rgba(255,255,255,.12);
  margin-bottom:10px;
}

/* Gallery */
.gallery{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px;
}
.gallery .big{
  border-radius: var(--radius2);
  overflow:hidden;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  min-height: 360px;
}
.gallery .big img{width:100%; height:100%; object-fit:cover}
.gallery .small{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.thumb{
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  min-height: 172px;
}
.thumb img{width:100%; height:100%; object-fit:cover}

/* Products grid */
.products{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:14px;
}
.product{
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
}
.product .img{height:170px; background: rgba(255,255,255,.04)}
.product .img img{width:100%; height:100%; object-fit:cover}
.product .body{padding:14px}
.product h3{margin:0 0 6px; font-size:15px}
.product p{margin:0; color:var(--muted); font-size:13px; line-height:1.8}
.tagrow{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.tag{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
}

/* Contact */
.contact-wrap{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  align-items:stretch;
}
.contact-list{display:flex; flex-direction:column; gap:10px; margin-top:6px}
.row{
  display:flex; justify-content:space-between; gap:12px;
  padding:12px 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: 14px;
  align-items:center;
}
.row .label{font-size:12px; color:var(--muted)}
.row .value{font-size:13px}
.note{
  border:1px dashed rgba(255,255,255,.22);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  padding:16px;
  color:var(--muted);
  line-height:1.9;
  text-align:center;
}

/* Quote form */
.form{
  display:grid;
  gap:10px;
  margin-top:12px;
}
.field{
  display:grid;
  gap:6px;
}
.field label{
  font-size:12px;
  color:var(--muted);
}
.input, textarea{
  width:100%;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:12px 12px;
  border-radius: 14px;
  outline:none;
  font-family: inherit;
  font-size:13px;
}
textarea{min-height:120px; resize: vertical}
.hint{font-size:12px; color:var(--muted); line-height:1.7}

/* Footer */
footer{
  padding:18px 0 26px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
}
.foot{display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between}

/* Scroll reveal animation */
.reveal{
  opacity:0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
  will-change: opacity, transform;
}
.reveal.show{
  opacity:1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 760px){
  nav ul{
    display:flex;
    gap:10px;
    padding:0;
    margin:0;
    list-style:none;
    align-items:center;

    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav ul::-webkit-scrollbar{ display:none; }

  nav a{
    white-space: nowrap;
  }

  /* هذا يمنع أي عنصر يسبب تمدد بعرض أكبر من الشاشة */
  .nav{ flex-wrap: wrap; }
  .brand{ min-width: 0; }
  .actions{ flex-wrap: wrap; max-width:100%; }

  .grid-3{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
  .gallery{grid-template-columns:1fr}
  .contact-wrap{grid-template-columns:1fr}
  .products{grid-template-columns:1fr}
}

/* LTR when English */
html[dir="ltr"] body{font-family: Inter, Cairo, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;}
html[dir="ltr"] .brand{min-width: 260px;}

/* ==== Index gallery (FINAL – safe) ==== */

/* الوضع الافتراضي = الكمبيوتر (3 أعمدة كما كان) */
.gallery.equal{
  display: grid;
  grid-template-columns: repeat(3, 220px); /* نفس الحجم القديم */
  gap: 18px;
  justify-content: center;
  margin: 0 auto;
}

.gallery.equal .thumb{
  width: 220px;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
}

.gallery.equal .thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.gallery.equal .thumb:hover img{
  transform: scale(1.05);
}


/* ===== FIX MOBILE HEADER + NAV (FORCE) ===== */
@media (max-width: 760px){

  nav ul{
    display: flex !important;
    gap: 10px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: center !important;

    /* قابل للتمرير بدل ما يكسر العرض ويعمل شريط جانبي */
    overflow-x: auto !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav ul::-webkit-scrollbar{ display:none; }

  nav a{
    white-space: nowrap !important;
  }

  /* 2) امنع الشريط الجانبي العريض (أي عنصر خارج العرض) */
  html, body{
    overflow-x: hidden !important;
    max-width: 100% !important;
  }
  header, .container, .nav, .hero-card{
    max-width: 100% !important;
  }

  /* 3) خلي الهيدر يلف بشكل طبيعي على الموبايل */
  .nav{
    flex-wrap: wrap !important;
  }
  .brand{
    min-width: 0 !important; /* هذا مهم عشان ما يدزّ عناصر للهامش ويعمل شريط */
  }
  .actions{
    flex-wrap: wrap !important;
    max-width: 100% !important;
  }

  /* 4) خلي الـ pill الطويل ما يسبب توسّع */
  .pill{
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}