/* ─────────── HOMEX shared styles ─────────── */
:root {
  --green: #10b981;          /* emerald — matches old site */
  --green-deep: #0e9d6f;
  --green-darker: #0a7a55;
  --green-soft: #e8f7f0;
  --green-tint: #f3fbf7;
  --ink: #0f0f10;
  --ink-2: #18181b;
  --ink-soft: #4b5563;
  --line: rgba(15,15,16,0.08);
  --line-strong: rgba(15,15,16,0.16);
  --bg: #ffffff;
  --bg-2: #fafafa;
  --gold: #d4a437;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

/* ─── Logo (HOMEX wordmark image) ─── */
.logo-img {
  height: 30px;
  width: auto;
  display: block;
}
.logo-img-light { display: none; }
/* On home: nav is transparent over hero -> show white logo, hide black */
body.nav-over-hero .logo-img-light { display: block; }
body.nav-over-hero .logo-img-dark { display: none; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-mark {
  width: 44px; height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}
.logo-mark::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--ink);
  border-radius: 50%;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}
.logo-mark::after {
  content: '';
  width: 14px;
  height: 22px;
  border: 2.5px solid var(--ink);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}
.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
}
.logo-text em {
  font-style: normal;
  /* nothing — kept simple */
}

/* ─── Nav ─── */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
/* On home: nav floats transparently over the hero */
body.nav-over-hero .nav {
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}
body.nav-over-hero .nav-links a { color: rgba(255,255,255,0.78); }
body.nav-over-hero .nav-links a:hover,
body.nav-over-hero .nav-links a.active { color: #fff; }
body.nav-over-hero .nav-links a.active::after { background: #fff; }
/* Push hero up under the nav */
body.nav-over-hero .hero { margin-top: -76px; padding-top: 76px; }
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 18px 0;
  gap: 32px;
}
.nav-links {
  display: flex;
  gap: 36px;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
}
.nav-links a {
  color: var(--ink-soft);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
  font-weight: 700;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 0; right: 0;
  height: 2px;
  background: var(--ink);
}
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Mobile hamburger button (visible only on ≤720px) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease, background-color .2s ease;
}
body.nav-over-hero .nav-burger { border-color: rgba(255,255,255,0.3); }
body.nav-over-hero .nav-burger span { background: #fff; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer (drops below the nav when hamburger is tapped) */
.nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  padding: 6px 20px 18px;
  flex-direction: column;
  z-index: 60;
}
.nav-drawer.open { display: flex; }
.nav-drawer > a {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.nav-drawer > a.active { color: var(--green); }
.nav-drawer-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.nav-drawer-actions .btn { flex: 1; padding: 12px 14px; }
.lang-toggle {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: var(--green-deep); }
.btn-dark { background: var(--ink); color: white; }
.btn-dark:hover { background: var(--ink-2); }
.btn-outline { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: white; }
.btn-outline-light { border: 1.5px solid white; color: white; background: transparent; }
.btn-outline-light:hover { background: white; color: var(--ink); }
.btn-outline-green { border: 1.5px solid var(--green); color: var(--green); background: white; }
.btn-outline-green:hover { background: var(--green); color: white; }
.btn-lg { padding: 16px 32px; font-size: 15px; }

/* ─── Page heading block (used on inner pages) ─── */
.page-head {
  padding: clamp(48px, 6vw, 80px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.page-head h1 {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 12px;
}
.page-head h1 .green { color: var(--green); }
.page-head p {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 640px;
  line-height: 1.7;
}
.crumbs {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  font-weight: 500;
}
.crumbs a:hover { color: var(--green); }
.crumbs span { opacity: 0.4; }

/* ─── Common section spacing ─── */
section.pad { padding: clamp(56px, 8vw, 100px) 0; }
.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 18px;
}
.section-title .green { color: var(--green); }
.section-sub {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 600px;
  line-height: 1.75;
}

/* ─── Footer (shared, dark) ─── */
.site-footer {
  background: var(--ink);
  color: white;
  padding: 64px 0 28px;
  margin-top: clamp(60px, 8vw, 100px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.site-footer h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 18px;
}
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.site-footer ul a, .site-footer .item {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s;
}
.site-footer ul a:hover { color: white; }
.site-footer .item .ico {
  width: 16px; height: 16px;
  color: var(--green);
  flex-shrink: 0;
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── Modal (shared) ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 36px 40px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 24px;
  font-weight: 300;
  border-radius: 50%;
}
.modal-close:hover { background: var(--green-soft); }
.modal h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}
.modal .modal-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
body[dir="rtl"] .modal-close { right: auto; left: 22px; }

/* form */
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.field label .req { color: #e11d48; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: white;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
}
.field input.filled { border-color: var(--green); }
.field textarea { resize: vertical; min-height: 100px; }
.field-block { margin-bottom: 22px; }
.field-block > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 24px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.check input { display: none; }
.check .box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.check input:checked + .box {
  background: var(--green);
  border-color: var(--green);
}
.check input:checked + .box::after {
  content: '';
  width: 5px;
  height: 9px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  margin-bottom: 2px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.btn-submit { background: var(--green); color: white; }
.btn-cancel { border: 1.5px solid var(--green); color: var(--green); background: white; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  /* Login + Contact buttons move into the drawer on mobile; lang toggle stays */
  .nav-actions .nav-btn { display: none; }
  .nav-burger { display: inline-flex; }
  .form-row, .checks { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .modal { padding: 28px 22px; }
}
