/* ============================================================
   AGADIR NOMAD TRIPS — new header 2026 (nx-header)
   Modern premium travel header. JS builds markup into #siteHeaderMount.
   Hooks that must stay: #aeHeaderShell #aeHeaderMenuToggle #aeHeaderDrawer
   #aeHeaderLangSelect #aeMobileLangSelect #google_translate_element
   [data-brand-*] [data-language-select] [data-menu-prefixes]
   ============================================================ */
.nx-header-shell {
  --nx-blue: #0B4BAF;
  --nx-blue-deep: #073B8C;
  --nx-blue-ink: #062F70;
  --nx-blue-bright: #1767C9;
  --nx-orange: #F79426;
  --nx-orange-dark: #E97818;
  --nx-orange-soft: #FFAE45;
  --nx-ink: #172333;
  --nx-muted: #667085;
  --nx-line: #E5E9F0;
  --nx-bg: #FFFFFF;
  --nx-shell-shadow: 0 10px 34px rgba(7, 59, 140, .14);
  position: sticky;
  top: 0;
  z-index: 2200;
  font-family: var(--font-ui, "Poppins", system-ui, sans-serif);
}
.nx-header-shell,
.nx-header-shell * { box-sizing: border-box; }

/* ---------- micro utility bar ---------- */
.nx-header__micro {
  background: linear-gradient(90deg, var(--nx-blue-ink), var(--nx-blue-deep));
  color: #DCE8FA;
  font-size: .74rem;
}
.nx-header__micro-inner {
  width: min(1320px, calc(100% - 40px));
  margin-inline: auto;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nx-header__micro-left,
.nx-header__micro-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nx-header__rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-weight: 700;
  font-size: .7rem;
  white-space: nowrap;
}
.nx-header__rating i { color: var(--nx-orange-soft); font-size: .68rem; }
.nx-header__micro-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 4px 2px;
  border-radius: 6px;
  white-space: nowrap;
}
.nx-header__micro-link:hover { color: var(--nx-orange-soft); }
.nx-header__micro-link i { font-size: .78rem; }
.nx-header__micro-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, .22); }
.nx-header__micro-label { color: #9DB4D8; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.nx-header__language-select {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  border-radius: 999px;
  font: 700 .72rem/1 inherit;
  padding: 5px 8px;
  cursor: pointer;
}
.nx-header__language-select option { color: #172333; }
.nx-header__translate-host { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- main bar ---------- */
.nx-header__main {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nx-line);
  transition: box-shadow 200ms ease;
}
.nx-header-shell.is-scrolled .nx-header__main { box-shadow: var(--nx-shell-shadow); }
.nx-header__main-inner {
  position: relative;
  width: min(1320px, calc(100% - 40px));
  margin-inline: auto;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
}
.nx-header__brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #FFFFFF;
  border: 1px solid rgba(11, 75, 175, .10);
  border-radius: 16px;
  padding: 6px 12px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(7, 59, 140, .16);
}
.nx-header__brand:hover { box-shadow: 0 12px 30px rgba(7, 59, 140, .22); }
.nx-header__brand img {
  width: 116px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ---------- desktop nav ---------- */
.nx-header__nav { display: flex; align-items: center; justify-content: flex-start; gap: 4px; min-width: 0; }
.nx-header__nav--right { justify-content: flex-end; gap: 2px; }
.nx-header__menu-item { position: relative; }
.nx-header__menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 9px;
  border-radius: 12px;
  color: var(--nx-ink);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  position: relative;
}
.nx-header__menu-trigger::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 7px;
  height: 3px;
  border-radius: 3px;
  background: var(--nx-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}
.nx-header__menu-trigger:hover::after,
.nx-header__menu-item.is-open .nx-header__menu-trigger::after,
.nx-header__menu-item.is-current .nx-header__menu-trigger::after { transform: scaleX(1); }
.nx-header__menu-trigger i { font-size: .68rem; color: var(--nx-muted); transition: transform 200ms ease; }
.nx-header__menu-item.is-open .nx-header__menu-trigger i { transform: rotate(180deg); }
.nx-header__menu-item.is-open .nx-header__menu-trigger,
.nx-header__menu-trigger:hover { background: #F2F6FC; }
.nx-header__nav-link {
  padding: 12px 9px;
  border-radius: 12px;
  color: var(--nx-ink);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  position: relative;
}
.nx-header__nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 7px;
  height: 3px;
  border-radius: 3px;
  background: var(--nx-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}
.nx-header__nav-link:hover::after,
.nx-header__nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nx-header__nav-link:hover { background: #F2F6FC; }
.nx-header__nav-link[aria-current="page"] { color: var(--nx-blue); }

/* dropdown card */
.nx-header__dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  left: 50%;
  min-width: 270px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--nx-line);
  border-radius: 18px;
  box-shadow: 0 26px 60px rgba(7, 59, 140, .18);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity 200ms ease, transform 220ms ease, visibility 200ms;
}
.nx-header__menu-item.is-open .nx-header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.nx-header__dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid var(--nx-line);
  border-top: 1px solid var(--nx-line);
  transform: translateX(-50%) rotate(45deg);
}
.nx-header__dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--nx-ink);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
}
.nx-header__dropdown a i { color: var(--nx-blue); font-size: .8rem; width: 18px; text-align: center; }
.nx-header__dropdown a:hover { background: #F2F6FC; color: var(--nx-blue-deep); }
.nx-header__dropdown a[aria-current="page"] { background: #EAF0FA; color: var(--nx-blue-deep); font-weight: 700; }

/* ---------- actions ---------- */
.nx-header__actions { display: flex; align-items: center; grid-column: 2; justify-self: end; gap: 10px; }
.nx-header__icon-btn {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--nx-line);
  color: var(--nx-blue);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.nx-header__icon-btn:hover { border-color: var(--nx-blue); background: #EAF0FA; transform: translateY(-1px); }
.nx-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--nx-blue-bright), var(--nx-blue));
  color: #fff !important;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(11, 75, 175, .38);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  white-space: nowrap;
}
.nx-header__cta:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 16px 32px rgba(7, 59, 140, .42); }
.nx-header__cta i { font-size: .8rem; }

/* focus */
.nx-header-shell a:focus-visible,
.nx-header-shell button:focus-visible,
.nx-header-shell summary:focus-visible,
.nx-header-shell select:focus-visible {
  outline: 3px solid var(--nx-orange);
  outline-offset: 2px;
}

/* mobile toggles */
.nx-header__mobile-toggle,
.nx-header__mobile-search {
  display: none;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  border: 1.5px solid var(--nx-line);
  background: #fff;
  color: var(--nx-blue-deep);
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
}

/* ---------- mobile drawer ---------- */
.nx-header__drawer {
  position: fixed;
  inset: 0;
  z-index: 2300;
  visibility: hidden;
  transition: visibility 260ms;
}
.nx-header__drawer.is-open { visibility: visible; }
.nx-header__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 30, 64, .55);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 260ms ease;
  cursor: pointer;
}
.nx-header__drawer.is-open .nx-header__backdrop { opacity: 1; }
.nx-header__drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0B4BAF 0%, #062F70 100%);
  color: #fff;
  border-radius: 26px 0 0 26px;
  transform: translateX(102%);
  transition: transform 300ms cubic-bezier(.32, .9, .35, 1);
  overflow: hidden;
}
.nx-header__drawer.is-open .nx-header__drawer-panel { transform: translateX(0); }
.nx-header__drawer-panel::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 148, 38, .35), transparent 70%);
  pointer-events: none;
}
.nx-header__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 14px;
}
.nx-header__drawer-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.nx-header__drawer-brand img {
  width: 74px;
  height: auto;
  object-fit: contain;
  display: block;
}
.nx-header__drawer-brand strong { display: block; font-size: .95rem; line-height: 1.25; }
.nx-header__drawer-brand small { display: block; color: #B9CDEB; font-size: .72rem; }
.nx-header__drawer-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.nx-header__drawer-close:hover { background: rgba(255, 255, 255, .2); }
.nx-header__drawer-scroll { flex: 1; overflow-y: auto; padding: 6px 20px 20px; }
.nx-header__mobile-nav { display: grid; gap: 6px; }
.nx-header__mobile-group {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}
.nx-header__mobile-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
}
.nx-header__mobile-group summary::-webkit-details-marker { display: none; }
.nx-header__mobile-group summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: .7rem;
  color: var(--nx-orange-soft);
  transition: transform 200ms ease;
}
.nx-header__mobile-group[open] summary::after { transform: rotate(180deg); }
.nx-header__mobile-submenu { display: grid; padding: 2px 8px 10px; }
.nx-header__mobile-submenu a {
  padding: 10px 10px;
  border-radius: 10px;
  color: #DCE8FA;
  font-size: .88rem;
  text-decoration: none;
}
.nx-header__mobile-submenu a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nx-header__mobile-submenu a[aria-current="page"] { background: rgba(247, 148, 38, .22); color: #fff; font-weight: 700; }
.nx-header__mobile-link {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
}
.nx-header__mobile-link:hover { background: rgba(255, 255, 255, .12); }
.nx-header__mobile-link[aria-current="page"] { border-color: var(--nx-orange); background: rgba(247, 148, 38, .2); }
.nx-header__drawer-ctas { display: grid; gap: 10px; margin-top: 16px; }
.nx-header__drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  border-radius: 16px;
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
}
.nx-header__drawer-cta--primary { background: linear-gradient(135deg, var(--nx-orange), var(--nx-orange-dark)); color: #fff; box-shadow: 0 12px 26px rgba(0, 0, 0, .3); }
.nx-header__drawer-cta--ghost { border: 1.5px solid rgba(255, 255, 255, .3); color: #fff; }
.nx-header__drawer-cta--ghost:hover { background: rgba(255, 255, 255, .12); }
.nx-header__drawer-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 4px 0;
  color: #B9CDEB;
  font-size: .82rem;
}
.nx-header__drawer-lang select {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
}
.nx-header__drawer-lang select option { color: #172333; }

/* ---------- responsive ---------- */
@media (max-width: 1260px) {
  .nx-header__nav, .nx-header__actions .nx-header__icon-btn { display: none; }
  .nx-header__mobile-toggle, .nx-header__mobile-search { display: grid; }
  .nx-header__main-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .nx-header__actions { justify-content: flex-end; }
  .nx-header__cta { min-height: 44px; padding: 0 18px; font-size: .85rem; }
}
@media (max-width: 760px) {
  .nx-header__cta span { display: none; }
  .nx-header__cta { min-width: 46px; padding: 0; justify-content: center; border-radius: 50%; }
}
@media (max-width: 640px) {
  /* The utility strip cannot fit small phones; the drawer carries
     language, WhatsApp and contact actions instead. */
  .nx-header__micro { display: none; }
  .nx-header__micro-label { display: none; }
  .nx-header__brand { position: static; transform: none; justify-self: start; }
  .nx-header__brand img { width: 98px; height: auto; }
  .nx-header__main-inner { grid-template-columns: auto minmax(0, 1fr); min-height: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  .nx-header-shell *, .nx-header-shell *::before, .nx-header-shell *::after { transition: none !important; }
}
