/* =========================================================================
   Layout المشترك — Header / Mega Menu / Mobile Drawer / Footer / WhatsApp
   ========================================================================= */

/* ---------------------------------------------------------------
   Promo / Announcement bar (أعلى الصفحة، يمرّ ثم يثبت الهيدر)
   --------------------------------------------------------------- */
.promo-bar { background: var(--ink-panel); color: #fff; position: relative; z-index: 101; }
.promo-bar[hidden] { display: none; }
.promo-bar__in {
  display: flex; align-items: center; justify-content: center; gap: 8px 16px;
  padding: 9px 44px; text-align: center; flex-wrap: wrap; font-size: .9rem; color: rgba(255,255,255,.82);
}
.promo-bar strong { color: #fff; font-weight: 700; }
.promo-bar .hot { color: #9CC0FF; font-weight: 700; }
.promo-bar__cta { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.4); padding-bottom: 1px; }
.promo-bar__cta:hover { border-color: #fff; }
.promo-bar__close {
  position: absolute; inset-inline-end: 10px; inset-block-start: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: rgba(255,255,255,.6); display: grid; place-items: center;
}
.promo-bar__close:hover { background: rgba(255,255,255,.1); color: #fff; }
.promo-bar__close svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------
   Header (sticky + blur on scroll)
   --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled {
  background: rgba(251,250,248,.78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
}
.header-inner {
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; color: var(--ink); font-size: 1.15rem; letter-spacing: -.01em; }
.logo__mark { width: 38px; height: 38px; flex: none; display: block; }
.logo__svg { width: 100%; height: 100%; display: block; }
.logo__img { height: 44px; width: auto; display: block; }          /* الشعار الرسمي (مقصوص) */
.logo__fallback { display: none; align-items: center; gap: 11px; }  /* يظهر إن غابت الصورة */
.logo__word { display: inline-flex; flex-direction: column; }
.logo small { display: block; font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -2px; }

/* Primary nav */
.nav { display: none; }
@media (min-width: 1000px) { .nav { display: flex; align-items: center; gap: 4px; } }
.nav > a, .nav > .has-mega > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; border: 0; background: transparent;
  font-size: .95rem; font-weight: 500; color: var(--ink-soft);
  transition: color .2s, background .2s;
}
.nav > a:hover, .nav > .has-mega > button:hover { color: var(--ink); background: rgba(16,21,27,.04); }
.nav > a.is-active, .nav > .has-mega.is-active > button { color: var(--ink); font-weight: 600; }
.nav > a.is-active { background: rgba(16,21,27,.05); }
.nav .caret { width: 15px; height: 15px; transition: transform .25s var(--ease); }

.header-cta { display: none; }
@media (min-width: 1000px) { .header-cta { display: inline-flex; } }

/* ---------------------------------------------------------------
   Mega Menu
   --------------------------------------------------------------- */
.has-mega { position: static; }
.mega {
  position: absolute; inset-inline: 0; top: calc(var(--header-h) - 6px);
  margin-inline: auto; width: min(1080px, calc(100% - 48px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-3);
  padding: 28px; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  z-index: 90;
}
.has-mega:hover .mega, .has-mega:focus-within .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.has-mega:hover .caret { transform: rotate(180deg); }
.mega__grid { display: grid; grid-template-columns: repeat(3, 1fr) 1.1fr; gap: 12px; }
.mega__col h4 { font-size: .78rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; margin-bottom: 8px; padding-inline-start: 12px; }
.mega__link { display: flex; gap: 12px; padding: 11px 12px; border-radius: 11px; transition: background .18s; }
.mega__link:hover { background: var(--accent-tint-2); }
.mega__link .ic { width: 20px; height: 20px; color: var(--accent-strong); margin-top: 2px; flex: none; }
.mega__link b { display: block; font-size: .95rem; font-weight: 600; color: var(--ink); }
.mega__link span { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.mega__promo {
  background: var(--ink-panel); color: #fff; border-radius: var(--r);
  padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
}
.mega__promo h5 { color: #fff; font-size: 1.05rem; }
.mega__promo p { font-size: .875rem; color: rgba(255,255,255,.65); }

/* ---------------------------------------------------------------
   Mobile burger + drawer
   --------------------------------------------------------------- */
.burger {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
}
@media (min-width: 1000px) { .burger { display: none; } }
.burger svg { width: 22px; height: 22px; color: var(--ink); }

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(16,21,27,.4); z-index: 200;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 210;
  width: min(400px, 88vw); background: var(--bg);
  transform: translateX(100%);      /* LTR: مثبّت على اليمين -> يختفي لليمين */
  visibility: hidden;                /* حماية: لا يظهر إطلاقاً وهو مغلق */
  transition: transform .35s var(--ease), visibility .35s;
  display: flex; flex-direction: column; padding: 20px; overflow-y: auto;
}
[dir="rtl"] .drawer { transform: translateX(-100%); } /* RTL: مثبّت على اليسار -> يختفي لليسار */
.drawer.is-open { transform: translateX(0) !important; visibility: visible; }
.drawer__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.drawer__close { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.drawer__close svg { width: 22px; height: 22px; }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav > a, .drawer .acc__btn {
  padding: 15px 8px; font-size: 1.05rem; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: transparent; border-inline: 0; border-top: 0; text-align: start;
}
.acc__btn .caret { width: 18px; height: 18px; transition: transform .25s; color: var(--muted); }
.acc.is-open .acc__btn .caret { transform: rotate(180deg); }
.acc__panel { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.acc.is-open .acc__panel { max-height: 420px; }
.acc__panel a { display: block; padding: 11px 20px; color: var(--ink-soft); font-size: .98rem; }
.acc__panel a:hover { color: var(--accent-strong); }
.drawer__foot { margin-top: auto; padding-top: 24px; }

/* ---------------------------------------------------------------
   Sticky mobile CTA bar
   --------------------------------------------------------------- */
.mobile-cta {
  position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 80;
  display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(251,250,248,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(120%); transition: transform .35s var(--ease);
}
.mobile-cta.is-visible { transform: translateY(0); }
@media (min-width: 1000px) { .mobile-cta { display: none !important; } }
.mobile-cta .btn { flex: 1; }

/* ---------------------------------------------------------------
   WhatsApp floating
   --------------------------------------------------------------- */
.wa-float {
  position: fixed; inset-block-end: 22px; inset-inline-start: 22px; z-index: 70;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px 12px 14px; border-radius: var(--r-pill);
  background: #1FA755; color: #fff; box-shadow: var(--sh-3);
  font-size: .92rem; font-weight: 600;
  transition: transform .2s var(--ease), background .2s;
}
.wa-float:hover { transform: translateY(-2px); background: #17864A; }
.wa-float svg { width: 22px; height: 22px; flex: none; }
.wa-float .wa-label { transition: max-width .3s var(--ease); }
@media (max-width: 640px) {
  .wa-float { inset-block-end: 84px; padding: 13px; }
  .wa-float .wa-label { display: none; }
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer { background: var(--ink-panel); color: rgba(255,255,255,.6); padding-top: clamp(56px,5vw,88px); }
.site-footer h4 { color: #fff; font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: none; margin-bottom: 18px; color: rgba(255,255,255,.5); }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
@media (min-width: 1000px){ .footer-grid { grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr; } }
.footer-grid a { color: rgba(255,255,255,.6); font-size: .95rem; display: inline-block; padding: 6px 0; transition: color .2s; }
.footer-grid a:hover { color: #fff; }
.footer-brand .logo { color:#fff; margin-bottom: 16px; }
.footer-brand .logo small { color: rgba(255,255,255,.5); }
.footer-brand p { font-size: .95rem; color: rgba(255,255,255,.55); max-width: 320px; }
.footer-contact { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.footer-contact a { display: inline-flex; align-items: center; gap: 10px; }
.footer-contact .ic { width: 18px; height: 18px; color: #9CC0FF; flex: none; }
.footer-social { display: flex; gap: 10px; margin-top: 22px; }
.footer-social a { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-dark-2); display: grid; place-items: center; }
.footer-social a:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.4); }
.footer-social svg { width: 19px; height: 19px; }
.footer-bottom {
  margin-top: clamp(48px,5vw,72px); border-top: 1px solid var(--line-dark);
  padding-block: 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  font-size: .875rem; color: rgba(255,255,255,.45);
}
.footer-bottom .repl { color: #9CC0FF; }

/* National Day promo bar (اليوم الوطني) */
.promo-bar--nd { background: linear-gradient(90deg, #00572B, #006C35 55
/* National Day promo bar (اليوم الوطني) */
.promo-bar--nd { background: linear-gradient(90deg, #00572B, #006C35 55%, #04803F); }
.promo-bar--nd .hot { color: #FCE7A6; }
.promo-bar--nd .promo-bar__cta { border-bottom-color: rgba(255,255,255,.55); }
