/* ============================================================================
   Zovya Travels — FINALIZED header style file (header-style.css).
   Status: FINAL (2026-09-28). Do not extend for body/footer sections —
   those get their own dedicated stylesheets in later Phase-2 steps.
   Source: template/frontend.php §§1-4 + drawer/toggle + header media queries.
   Covers: tokens, topbar, sticky nav, buttons, dropdowns, drawer + drill-down
   sub-overlays, bottom action bar/dock, responsive 1280→380, reduced motion.
   ============================================================================ */
:root {
  color-scheme: dark light;
  --color-bg-dark: #0B0F1A;
  --color-bg-dark-raised: #111827;
  --color-bg-dark-elevated: #1A2236;
  --color-bg-light: #F3F1E3;
  --color-bg-neutral: #F6F8FC;
  --color-bg-subtle-light: #EEF2F8;
  --color-gold: #C9A84C;
  --color-gold-light: #E2C87A;
  --color-gold-muted: #8A6E2F;
  --color-gold-tint: rgba(201, 168, 76, 0.08);
  --color-gold-dark: #A88632;
  --color-gold-hover: #B3923B;
  --color-navy: #1B2A5E;
  --color-navy-muted: #6F7A9A;
  --color-text-on-dark: #F0EDE4;
  --color-text-on-dark-2: #B8B0A0;
  --color-text-on-dark-3: #6B6355;
  --color-border-dark: rgba(201, 168, 76, 0.18);
  --color-border-light: #E3E9F1;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-sm: 0 2px 8px rgba(11, 15, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(27, 42, 94, 0.08);
  --shadow-hover: 0 14px 32px rgba(27, 42, 94, 0.12);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Viewport lock (all screensizes): no horizontal overflow, hard 100vw cap.
   `clip` (not `hidden`) preserves the sticky header — it creates no scroll container. */
html, body { max-width: 100vw; overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
img, video, iframe { max-width: 100%; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* 3. Global Top Bar (.n1) */
.top-bar-n1 {
  background-color: #070A12;
  border-bottom: 1px solid var(--color-border-dark);
  padding: 8px 0;
  font-size: 13px;
  position: relative;
  z-index: 60;
}
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.top-bar-h1-box h1 {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-on-dark-2);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-bar-h1-box h1::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background-color: var(--color-gold);
}
.top-bar-meta { display: inline-flex; align-items: center; gap: 18px; }
.top-bar-item {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--color-text-on-dark-2); font-size: 13px; font-weight: 500;
}
.top-bar-item i { color: var(--color-gold); font-size: 15px; }
.top-bar-item:hover { color: var(--color-text-on-dark); }
.social-pills {
  display: inline-flex; align-items: center; gap: 10px;
  padding-left: 12px; border-left: 1px solid rgba(201, 168, 76, 0.2);
}
.social-pills a { color: var(--color-text-on-dark-2); font-size: 14px; transition: all 0.2s ease; }
.social-pills a:hover { color: var(--color-gold); transform: translateY(-1px); }

/* 4. Sticky Header Navigation (.n2) */
.header-n2 {
  position: sticky;
  top: 0;
  background: rgba(11, 15, 26, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border-dark);
  z-index: 50;
  height: 78px;
  display: flex;
  align-items: center;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; flex-wrap: nowrap; gap: 16px; }
.brand-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-logo-img { height: 44px; width: auto; object-fit: contain; display: block; }
.nav-container { display: flex; align-items: center; flex-shrink: 1; }
.nav-links { display: flex; align-items: center; gap: 18px; list-style: none; white-space: nowrap; flex-wrap: nowrap; margin: 0; padding: 0; }
.nav-links a { font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--color-text-on-dark); white-space: nowrap; transition: color 0.2s ease; }
.nav-links a:hover { color: var(--color-gold); }
.nav-links a .fa-chevron-down { font-size: 12px; vertical-align: baseline; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; white-space: nowrap; }
.btn-gold {
  background: linear-gradient(135deg, #D4AF37 0%, #C9A84C 50%, #B89230 100%);
  color: #0B0F1A;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  padding: 10px 22px;
  height: 42px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.35);
  white-space: nowrap;
}
.btn-gold:hover { background: linear-gradient(135deg, #E2C87A 0%, #D4AF37 100%); color: #0B0F1A; box-shadow: 0 6px 20px rgba(201, 168, 76, 0.5); filter: brightness(1.05); }
.btn-gold:active { transform: scale(0.98) translateY(1px); }
/* WhatsApp brand button (official #25D366) — same pill architecture as .btn-gold */
.btn-whatsapp {
  background-color: #25D366;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  padding: 10px 20px;
  height: 42px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-whatsapp:hover { background-color: #1EBE5D; color: #FFFFFF; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5); }
.btn-whatsapp:active { transform: scale(0.98); }
.btn-ghost-dark {
  background: rgba(26, 34, 54, 0.6);
  color: var(--color-text-on-dark);
  border: 1px solid rgba(201, 168, 76, 0.3);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  height: 42px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-ghost-dark:hover { border-color: var(--color-gold); color: var(--color-gold); background: rgba(26, 34, 54, 0.9); }

/* Dropdown companion (template nav is flat; MenuRenderer nests to 3 levels) */
.nav-links li { position: relative; }
.nav-links ul {
  display: none; position: absolute; top: calc(100% + 10px); left: 0;
  background: #111827; border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 10px; min-width: 220px; max-width: calc(100vw - 32px);
  padding: 8px; list-style: none; margin: 0; z-index: 60;
  /* NOTE: no overflow-x here — it would clip nested flyout submenus.
     Viewport spill is handled by the max-width cap + right-edge guard. */
}
.nav-links ul li { min-width: 0; }
/* Right-edge guard (TOP LEVEL ONLY — scoped via .nav-container so nested
   .nav-links lists can never match): trailing parents open inward so menus
   never spill past viewport */
.nav-container > ul.nav-links > li:last-child > ul, .nav-container > ul.nav-links > li:nth-last-child(2) > ul { left: auto; right: 0; }
.nav-container > ul.nav-links > li:last-child > ul ul, .nav-container > ul.nav-links > li:nth-last-child(2) > ul ul { left: auto; right: calc(100% + 8px); }
/* Invisible hover bridge so the 10px gap doesn't close the menu */
.nav-links ul::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-links ul ul { left: calc(100% + 8px); top: 0; }
.nav-links ul ul::before { top: 0; bottom: 0; left: -8px; right: auto; width: 8px; height: auto; }
.nav-container > ul.nav-links > li:last-child > ul ul::before, .nav-container > ul.nav-links > li:nth-last-child(2) > ul ul::before { left: auto; right: -8px; }
.nav-links ul a { overflow-wrap: anywhere; min-width: 0; }
.top-bar-inner, .top-bar-meta { min-width: 0; }
.nav-links li:hover > ul, .nav-links li:focus-within > ul { display: block; }
.nav-links ul a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 6px; }
.nav-links ul a .fa-chevron-right { font-size: 13px; }
.nav-links ul a:hover { background: rgba(201, 168, 76, 0.12); }

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  background: rgba(26, 34, 54, 0.7);
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: var(--color-gold);
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  align-items: center; justify-content: center;
  font-size: 24px; cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.mobile-menu-toggle:hover, .mobile-menu-toggle:focus-visible {
  border-color: var(--color-gold); background: rgba(201, 168, 76, 0.15); outline: none;
}

/* Mobile Drawer Navigation Overlay */
.mobile-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-drawer-overlay.active { opacity: 1; visibility: visible; }
.mobile-nav-drawer {
  position: fixed; top: 0; right: -100%;
  width: 100%; max-width: 100vw;
  height: 100vh; height: 100dvh;
  background: #0B0F1A;
  border-left: 1px solid var(--color-border-dark);
  z-index: 101;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px 20px;
  overflow: hidden;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-nav-drawer.active { right: 0; }
.mobile-drawer-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overflow-x: clip; display: flex; flex-direction: column; position: relative; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mobile-subpanel { -webkit-overflow-scrolling: touch; }
/* Strict clipping of inner sections: long titles ellipsis-truncate, never overflow.
   `hidden` first as fallback for iOS versions without `clip` support. */
.mobile-drawer-links, .mobile-drawer-links ul, .mobile-subpanel { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
.mobile-drawer-links li { min-width: 0; }
.mobile-drawer-links a span, .mobile-drawer-links button span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mobile-drawer-links a i, .mobile-drawer-links button i { flex-shrink: 0; }
.mobile-drawer-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid rgba(201, 168, 76, 0.2); }
.mobile-drawer-close {
  background: transparent; border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--color-text-on-dark-2);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer;
}
.mobile-drawer-links { list-style: none; margin: 24px 0; display: flex; flex-direction: column; gap: 16px; }
.mobile-drawer-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.mobile-drawer-links li { list-style: none; }
.mobile-drawer-links a {
  font-size: 16px; font-weight: 600; color: var(--color-text-on-dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--radius-md); transition: all 0.2s ease;
}
.mobile-drawer-links a:hover, .mobile-drawer-links a:active { background: rgba(201, 168, 76, 0.1); color: var(--color-gold); }
/* Drill-down: parent rows open sub-overlays; sub-overlays carry parent link + recursive children */
.mobile-drawer-links button.mobile-nav-parent {
  width: 100%;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-body);
  font-size: 16px; font-weight: 600; color: var(--color-text-on-dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--radius-md); transition: all 0.2s ease;
}
.mobile-drawer-links button.mobile-nav-parent:hover, .mobile-drawer-links button.mobile-nav-parent:active { background: rgba(201, 168, 76, 0.1); color: var(--color-gold); }
.mobile-drawer-links button.mobile-nav-parent i { color: var(--color-gold); }
.mobile-subpanel {
  position: absolute; inset: 0;
  background: #0B0F1A;
  padding: 24px 20px;
  overflow-y: auto;
  z-index: 5;
  transform: translateX(102%);
  transition: transform 0.3s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.mobile-subpanel.active { transform: none; }
.mobile-sub-back {
  align-self: flex-start;
  margin-bottom: 8px;
  background: transparent; border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--color-text-on-dark-2);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-full); cursor: pointer;
}
.mobile-sub-back:hover { border-color: var(--color-gold); color: var(--color-gold); }
.mobile-sub-parent {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 18px; font-weight: 700; color: var(--color-gold-light);
  padding: 12px; border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  background: var(--color-gold-tint);
}
.mobile-sub-parent:hover { border-color: var(--color-gold); }
.mobile-nav-drawer nav ul ul a { padding-left: 22px; font-size: 14px; opacity: 0.85; }
.mobile-nav-drawer nav ul ul ul a { padding-left: 38px; }
.mobile-drawer-footer { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(201, 168, 76, 0.15); }

/* Fixed Bottom Action Bar — visible on ALL screens (user directive).
   Desktop trend: floating centered glass dock; mobile: full-bleed bar.
   Page-relevant variant (Filter on listing) comes from footer.php markup. */
.mobile-bottom-bar {
  display: flex;
  position: fixed;
  bottom: 16px; left: 50%; right: auto;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  background: rgba(11, 15, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-full);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(201, 168, 76, 0.15);
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms ease, visibility 300ms ease;
}
.mobile-bottom-bar.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.mobile-bottom-bar > a, .mobile-bottom-bar > span {
  flex: 1;
  font-size: 12.5px;
  height: 40px;
  min-height: 40px;
  padding: 0 8px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-bottom-bar > a i, .mobile-bottom-bar > span i {
  font-size: 16px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Header responsive (template §9, header rules only) */
@media (max-width: 1280px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 13px; }
}
@media (max-width: 1150px) {
  /* Tablet landscape: 7-item menu + CTAs + logo overflow ~1050px containers,
     so shed the ghost CTA (Call lives in topbar + drawer) and tighten up. */
  .nav-actions .btn-ghost-dark { display: none; }
  .brand-logo-img { height: 38px; }
  .nav-links { gap: 10px; }
  .nav-links a { font-size: 12.5px; }
  .nav-actions .btn-gold { padding: 10px 18px; }
  .header-inner { gap: 12px; }
}
@media (max-width: 1100px) {
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 12.5px; }
}
@media (max-width: 1024px) {
  /* Tablet + below: drawer navigation (7-item menu + CTAs overflow ~976px containers) */
  .nav-container { display: none; }
  .mobile-menu-toggle { display: inline-flex; }
}
@media (max-width: 768px) {
  .top-bar-inner { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 4px 0; }
  .top-bar-h1-box h1 { font-size: 11.5px; justify-content: center; text-align: center; }
  .top-bar-meta { flex-wrap: wrap; justify-content: center; gap: 12px; }
  .top-bar-item { font-size: 12px; }
  .mobile-bottom-bar {
    left: 0; right: 0; transform: none;
    width: auto;
    bottom: 0;
    border-radius: 0;
    border-left: none; border-right: none; border-bottom: none;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 576px) {
  .container-wide { padding: 0 1rem; }
  .header-n2 { height: 62px; }
  .brand-logo-img { height: 36px; }
  .nav-actions .btn-ghost-dark { display: none; }
  .nav-actions .btn-gold { padding: 8px 14px; height: 38px; font-size: 12px; letter-spacing: 0.02em; }
  .nav-actions .btn-gold span { display: inline-block; }
}
@media (max-width: 380px) {
  .top-bar-h1-box h1 { font-size: 10.5px; }
  /* Small phones (~320px): logo + CTA + toggle must fit ~288px inner width */
  .header-inner { gap: 8px; }
  .brand-logo-img { height: 30px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-gold { font-size: 11px; padding: 7px 10px; height: 36px; }
  .mobile-menu-toggle { width: 38px; height: 38px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-nav-drawer, .mobile-drawer-overlay, .mobile-subpanel, .mobile-bottom-bar { transition: none; }
}
