*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #0d1b2a;
  background: #f4f7fb;
  scroll-behavior: smooth;
}

/* لأن الهيدر صار fixed */
body {
  padding-top: 72px; /* عدّلها إذا ارتفاع الهيدر مختلف */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

:root {
  --primary: #d4262e;
  --secondary: #0d6efd;
  --muted: #f0f3f7;
  --dark: #0b1524;
  --light: #ffffff;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* ===== Header (FIXED) أعلى من أي شيء ===== */
.topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e6eaf0;

  /* ✅ مهم جدًا لحل مشكلة قصّ المنيو على الجوال */
  overflow: visible !important;
}

.nav {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__logo {
  width: 44px;
  height: 44px;
}

.brand__text strong {
  display: block;
  font-weight: 800;
}

.brand__text small {
  color: #4b5563;
}

.menu {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.menu a {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.menu a:hover {
  background: #f3f5f8;
}

.menu .cta {
  background: var(--primary);
  color: #fff;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e6eaf0;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 100001;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 4px;
  background: #0d1b2a;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle__bars::before {
  top: -6px;
}

.menu-toggle__bars::after {
  top: 6px;
}

.menu-toggle.is-open .menu-toggle__bars {
  transform: rotate(45deg);
}

.menu-toggle.is-open .menu-toggle__bars::before {
  transform: rotate(-90deg) translateX(-6px);
}

.menu-toggle.is-open .menu-toggle__bars::after {
  opacity: 0;
}

/* ===== Hero + Slider stacking fix ===== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 70vh;
  min-height: 70svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}

.slider {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none; /* ✅ يمنع السلايدر من خطف اللمس */
}

.slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(13, 27, 42, 0.8),
    rgba(13, 27, 42, 0.35)
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 80px 0;
}

.eyebrow {
  color: #c7d2fe;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.3;
}

h2 {
  font-size: clamp(24px, 3vw, 30px);
}

.lead {
  max-width: 640px;
  line-height: 1.7;
}

.hero__cta {
  margin: 18px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 30px rgba(212, 38, 46, 0.3);
}

.btn.ghost {
  border-color: #fff;
  color: #fff;
  background: transparent;
}

.btn:hover {
  transform: translateY(-2px);
}

.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.contacts .label {
  display: block;
  color: #d1d5db;
  font-size: 14px;
}

.contacts a {
  font-weight: 800;
  color: #fff;
}

.contacts--light .label {
  color: #c9d4e5;
}

.section {
  padding: 70px 0;
  background: #fff;
}

.section.muted {
  background: var(--muted);
}

.section.dark {
  background: var(--dark);
  color: #fff;
}

.grid {
  display: grid;
  gap: 26px;
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.five-col {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: stretch;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.card.photo img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.overlay-text {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
}

.values .value-card {
  background: #fff;
  padding: 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  background: #eef2ff;
  color: #1d4ed8;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.list li {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e6eaf0;
  line-height: 1.6;
}

.services .service {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e6eaf0;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
}

.services .service span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.clients {
  gap: 16px;
}

.clients img {
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1px solid #e5e7eb;
}

.logos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: center;
}

.glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.glass img {
  opacity: 0.9;
}

.sub-hero {
  padding: 70px 0 50px;
}

.articles-hero {
  background: linear-gradient(140deg, #0b1524 0%, #162b45 100%);
  color: #e5e7eb;
  border-bottom: 1px solid #1f2b3a;
}

.articles-hero .lead {
  color: #cbd5e1;
}

.articles-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.articles-hero .chip {
  background: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.post-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid #e6eaf0;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 13px;
}

.badge--amber {
  background: #fef3c7;
  color: #92400e;
}

.meta-text {
  color: #6b7280;
  font-size: 14px;
}

.post-intro {
  margin: 8px 0 14px;
  line-height: 1.7;
}

.post-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.post-section h3 {
  margin-bottom: 8px;
}

.post-steps,
.post-list {
  margin: 0;
  padding-inline-start: 20px;
  display: grid;
  gap: 8px;
  line-height: 1.7;
}

.post-steps {
  list-style: decimal;
}

.post-list {
  list-style: disc;
}

.muted-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e6eaf0;
}

.post-cta {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(
    120deg,
    rgba(212, 38, 46, 0.08),
    rgba(11, 21, 36, 0.08)
  );
  border: 1px solid #e6eaf0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.post-cta .btn {
  flex-shrink: 0;
}

.post-card .btn.ghost {
  border-color: var(--primary);
  color: var(--primary);
}

.post-card .btn.ghost:hover {
  background: rgba(212, 38, 46, 0.08);
}

.post-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.post-detail {
  display: grid;
  gap: 14px;
}

.post-detail .post-steps,
.post-detail .post-list {
  padding-inline-start: 22px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0d6efd;
  font-weight: 800;
  margin-bottom: 6px;
}

.footer {
  background: #0b1524;
  color: #c9d4e5;
  padding: 24px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__links,
.footer__contact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer a {
  color: #e5e7eb;
  font-weight: 700;
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e5e7eb;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

.whatsapp-fab {
  position: fixed;
  bottom: 22px;
  right: 18px;
  background: #25d366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.35);
  z-index: 40;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.whatsapp-fab svg {
  width: 24px;
  height: 24px;
}

.whatsapp-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(37, 211, 102, 0.45);
}

/* ===== Responsive tweaks ===== */
@media (max-width: 768px) {
  .hero__content {
    padding: 60px 0;
  }

  .services .service {
    font-size: 15px;
  }

  .post-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .post-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .section {
    padding: 56px 0;
  }
}

/* ✅ الحل النهائي للمنيو بالجوال: مستقلة تمامًا عن الهيدر */
@media (max-width: 1024px) {
  .nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-inline-start: auto;
  }

  .brand__text small {
    display: none;
  }

  /* المنيو (ID) Overlay منفصلة */
  #primary-menu {
    position: fixed !important;
    top: 72px; /* نفس padding-top في body */
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    /* دعم الأجهزة التي تستخدم dynamic viewport units */
    height: calc(100dvh - 72px);
    max-height: calc(100dvh - 72px);

    display: none;
    flex-direction: column;
    align-items: stretch;

    padding: 14px;
    gap: 10px;

    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);

    overflow-y: auto;
    z-index: 999999; /* أعلى من أي شيء */

    border: 0;
    border-top: 1px solid #e6eaf0;
    border-radius: 0;
    box-shadow: none;
  }

  #primary-menu.open {
    display: flex !important;
  }

  #primary-menu a {
    width: 100%;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid #e6eaf0;
    background: #fff;
  }

  #primary-menu a:hover {
    background: #f3f5f8;
  }

  #primary-menu .cta {
    border-color: transparent;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .whatsapp-fab {
    right: 14px;
    bottom: 16px;
    padding: 12px 14px;
  }

  .whatsapp-fab span {
    display: none;
  }

  .hero__content {
    padding: 44px 0;
  }

  .section {
    padding: 52px 0;
  }

  .brand__logo {
    width: 40px;
    height: 40px;
  }

  .brand__text strong {
    font-size: 15px;
  }
}

/* Scroll lock when menu open (JS يضيفها) */
body.menu-open {
  overflow: hidden;
}
