/* ════════════════════════════════════════════════════════════════
   مكتبة نزار — طبقة البنية
   تُحمَّل بعد style.css وتُحدِّث الرأس والذيل والقائمة وبنية التطبيق
   إلى البنية المعتمدة في قالب مجد. كل الألوان من المتغيّرات، فالطقم
   اللوني يبدّلها كلها دفعة واحدة.
═══════════════════════════════════════════════════════════════════ */

/* ── 0. أدوات عامة ─────────────────────────────────────────────── */
.aw-skip-link {
  position: absolute;
  right: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 700;
}
.aw-skip-link:focus { right: 16px; }

/* ── 1. الرأس ──────────────────────────────────────────────────── */
.aw-header__strip { padding: 7px 0; text-align: start; }

.aw-header__strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.aw-header__strip-contact { font-size: 12.5px; line-height: 1.7; }
.aw-header__sep { opacity: .45; margin: 0 2px; }

.aw-header__inner { grid-template-columns: auto 1fr auto; gap: 20px; }

.aw-logo {
  flex-direction: row;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.aw-logo__img { max-height: 54px; width: auto; object-fit: contain; }

.aw-logo__mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  display: block;
}
.aw-logo__mark img { width: 100%; height: 100%; display: block; }

.aw-logo__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.aw-logo__name { line-height: 1.3; }

/* عدّاد السلة: الصفر لا يصرخ */
.aw-nav__cart-count.is-empty {
  background: var(--cream-mid);
  color: var(--ink-soft);
}

/* ── 2. أيقونات التواصل ────────────────────────────────────────── */
.aw-social { display: inline-flex; align-items: center; gap: 8px; }

.aw-social__link {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--gold-rgb), .34);
  background: rgba(255, 255, 255, .07);
  color: inherit;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.aw-social__link svg { width: 15px; height: 15px; fill: currentColor; }
.aw-social__link:hover {
  transform: translateY(-2px);
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}

.aw-header__social { color: rgba(255, 255, 255, .78); }
.aw-header__social--mobile { display: none; }

.aw-footer__social {
  margin-top: 16px;
  color: rgba(255, 255, 255, .8);
}

/* ── 3. زر قائمة الهاتف ────────────────────────────────────────── */
.aw-subnav__mobile-head { display: none; }

.aw-mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  padding: 8px 15px;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.aw-mobile-menu-toggle__icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}
.aw-mobile-menu-toggle__icon i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.aw-mobile-home-link { font-size: 13px; font-weight: 700; }

body.aw-mobile-menu-open .aw-mobile-menu-toggle__icon i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.aw-mobile-menu-open .aw-mobile-menu-toggle__icon i:nth-child(2) { opacity: 0; }
body.aw-mobile-menu-open .aw-mobile-menu-toggle__icon i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ── 4. الذيل ──────────────────────────────────────────────────── */
.aw-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding: 52px 0 36px;
}
.aw-footer__grid.has-map { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; }

.aw-footer__logo { display: inline-block; margin-bottom: 14px; }
.aw-footer__logo img {
  max-height: 56px;
  width: auto;
  border-radius: 14px;
  box-shadow: var(--sh-sm);
}

.aw-footer__brand-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.aw-footer__desc {
  font-size: 13.5px;
  line-height: 1.95;
  color: rgba(255, 255, 255, .62);
  max-width: 46ch;
}

.aw-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}
.aw-footer__contact a { color: var(--gold-lt); }
.aw-footer__contact a:hover { color: #fff; }

.aw-footer__col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-lt);
  letter-spacing: .05em;
  margin-bottom: 16px;
}

.aw-footer__menu { display: flex; flex-direction: column; gap: 11px; }
.aw-footer__menu a {
  font-size: 13.5px;
  color: rgba(255, 255, 255, .66);
  transition: color .2s, padding .2s;
}
.aw-footer__menu a:hover { color: var(--gold-lt); padding-inline-start: 4px; }

.aw-footer__map-frame {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid rgba(var(--gold-rgb), .3);
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, .05);
}
.aw-footer__map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.aw-footer__map-link {
  display: inline-block;
  margin-top: 11px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-lt);
}
.aw-footer__map-link:hover { color: #fff; }

/* ── 5. قسم تحميل التطبيق ──────────────────────────────────────── */
.aw-footer__app {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 26px;
  padding: 26px 28px;
  margin-bottom: 8px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 92% 50%, rgba(var(--gold-rgb), .20), transparent 58%),
    rgba(255, 255, 255, .05);
  border: 1px solid rgba(var(--gold-rgb), .26);
}

.aw-footer__app-text h3 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 7px;
}
.aw-footer__app-text p {
  font-size: 13.5px;
  line-height: 1.9;
  color: rgba(255, 255, 255, .66);
  max-width: 54ch;
}

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

.aw-footer__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform .2s ease, opacity .2s ease;
}
.aw-footer__badge img { height: 46px; width: auto; display: block; }
.aw-footer__badge:hover { transform: translateY(-2px); }

.aw-footer__badge--soon {
  padding: 11px 17px;
  min-height: 46px;
  border-radius: 11px;
  border: 1px dashed rgba(255, 255, 255, .3);
  background: rgba(0, 0, 0, .18);
  color: rgba(255, 255, 255, .72);
  font-size: 12.5px;
  font-weight: 700;
  cursor: default;
}
.aw-footer__badge--soon:hover { transform: none; }

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

/* ── 6. زر تثبيت التطبيق ───────────────────────────────────────── */
.nizar-install {
  position: fixed;
  inset-inline-start: 16px;
  bottom: 16px;
  z-index: 9000;
  display: none;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: start;
  line-height: 1.6;
  box-shadow: var(--sh-lg);
  cursor: pointer;
  transform: translateY(14px);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.nizar-install.is-visible { display: flex; transform: translateY(0); opacity: 1; }
.nizar-install__icon { font-size: 19px; }
.nizar-install__text { flex: 1; min-width: 0; }
.nizar-install__close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  font-size: 17px;
  line-height: 1;
}

/* ── 7. وضع التطبيق ────────────────────────────────────────────── */
body.nizar-app-mode .aw-header__strip { display: none !important; }
body.nizar-app-mode .aw-header { position: sticky; top: 0; }
body.nizar-app-mode .nizar-install { display: none !important; }
body.nizar-app-mode .aw-footer__app { display: none; }
/* الذيل يبقى ظاهرًا داخل التطبيق: فيه روابط السياسات التي يشترطها المتجران. */
body.nizar-app-mode .aw-footer { display: block; }

@supports (padding: env(safe-area-inset-bottom)) {
  body.nizar-app-mode .aw-footer__bottom { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── 8. استجابة ────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .aw-footer__grid.has-map { grid-template-columns: 1.4fr 1fr 1fr; }
  .aw-footer__map { grid-column: 1 / -1; max-width: 520px; }
}

@media (max-width: 900px) {
  .aw-header__inner { grid-template-columns: 1fr auto; row-gap: 14px; }
  .aw-search { grid-column: 1 / -1; order: 3; }
  .aw-header__social { display: none; }
  .aw-header__social--mobile { display: inline-flex; }
  .aw-header__strip-inner { justify-content: center; text-align: center; }

  .aw-subnav__mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
  }
  .aw-subnav__inner {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 10px;
  }
  body.aw-mobile-menu-open .aw-subnav__inner { display: flex; }
  .aw-subnav__inner a { padding: 11px 4px; border-top: 1px solid rgba(255, 255, 255, .12); }
}

@media (max-width: 760px) {
  .aw-footer__grid,
  .aw-footer__grid.has-map { grid-template-columns: 1fr; gap: 30px; padding: 38px 0 26px; }
  .aw-footer__map { max-width: none; }
  .aw-footer__app { padding: 22px; }
  .aw-footer__badges { width: 100%; }
  .aw-footer__badge,
  .aw-footer__badge--soon { flex: 1 1 160px; justify-content: center; }
  .aw-footer__bottom { flex-direction: column; align-items: flex-start; font-size: 12.5px; }
  .nizar-install { inset-inline: 12px; bottom: 12px; max-width: none; }
}

/* 3.1.1 — One menu tree and explicit header grid positions. */
.aw-header__mobile-social{display:none}
.aw-header .aw-header__inner{grid-template-columns:minmax(170px,auto) minmax(0,1fr) auto}
.aw-header .aw-logo{grid-column:1;grid-row:1}
.aw-header .aw-search{grid-column:2;grid-row:1;min-width:0;width:100%}
.aw-header .aw-nav{grid-column:3;grid-row:1}
.aw-header .aw-header-menu{display:flex;flex-wrap:wrap;align-items:center;gap:0;margin:0;padding:0;list-style:none;width:100%}
.aw-header .aw-header-menu li{list-style:none;margin:0;padding:0;position:relative}
.aw-header .aw-header-menu li::marker{content:''}
.aw-header .aw-header-menu .sub-menu{list-style:none;display:none;position:absolute;top:100%;inset-inline-start:0;min-width:190px;background:var(--cream-lt);padding:8px;margin:0;box-shadow:var(--sh-sm);z-index:20}
.aw-header .aw-header-menu li:hover>.sub-menu,.aw-header .aw-header-menu li:focus-within>.sub-menu{display:block}
.aw-header .aw-subnav__inner{overflow:visible}
@media(max-width:900px){
 .aw-header .aw-header__inner{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto}
 .aw-header .aw-nav{grid-column:2;grid-row:1}
 .aw-header .aw-search{grid-column:1 / -1;grid-row:2;order:initial}
 .aw-header .aw-header-menu{flex-direction:column;align-items:stretch}
 .aw-header .aw-header-menu .sub-menu{display:block;position:static;box-shadow:none;padding:0 16px;min-width:0}
 .aw-header .aw-header-menu a{display:block}
}
