/* ==========================================================================
   GLOBAL MASTER HEADER STYLESHEET
   Centralized styling for Desktop Navigation, Dropdowns, Mega Menus & Mobile Drawer.
   Used consistently across all pages including root and nested packages.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HEADER CONTAINER & SCROLL TRANSITIONS
   -------------------------------------------------------------------------- */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 85; /* Above hero (z-auto) and sticky booking CTA (z-80), below mobile drawer (z-100) */
  transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1),
              padding 300ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Transparent Overlay State (Over Dark Hero at top of page) */
#main-header.header-transparent {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

#main-header.header-transparent .nav-item-link {
  color: rgba(255, 255, 255, 0.90);
  border-bottom: 2px solid transparent;
}
#main-header.header-transparent .nav-item-link:hover {
  color: #FFFFFF;
}

#main-header.header-transparent .logo-default {
  display: none !important;
}
#main-header.header-transparent .logo-white {
  display: block !important;
}

/* Scrolled State (Solid White after scrolling > 40px) */
#main-header.header-scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  color: #000000;
}

#main-header.header-scrolled .nav-item-link {
  color: #1C1917;
  border-bottom: 2px solid transparent;
}
#main-header.header-scrolled .nav-item-link:hover {
  color: #8F532B; /* Warm Brown */
}

#main-header.header-scrolled .logo-default {
  display: block !important;
}
#main-header.header-scrolled .logo-white {
  display: none !important;
}

/* Active Dropdown State at scroll top: Ensure solid header background when dropdown is open */
#main-header.header-dropdown-active {
  background-color: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #000000 !important;
}

#main-header.header-dropdown-active .nav-item-link {
  color: #1C1917 !important;
}
#main-header.header-dropdown-active .nav-item-link:hover {
  color: #8F532B !important;
}

#main-header.header-dropdown-active .logo-default {
  display: block !important;
}
#main-header.header-dropdown-active .logo-white {
  display: none !important;
}

/* Default Solid State (for pages without dark hero) */
#main-header.header-solid {
  background-color: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  color: #000000;
}
#main-header.header-solid .nav-item-link {
  color: #1C1917;
  border-bottom: 2px solid transparent;
}
#main-header.header-solid .nav-item-link:hover {
  color: #8F532B;
}
#main-header.header-solid .logo-default {
  display: block !important;
}
#main-header.header-solid .logo-white {
  display: none !important;
}

/* --------------------------------------------------------------------------
   PRIMARY NAVIGATION LINKS & ACTIVE STATES
   font-weight: 500 (medium, NOT bold), uppercase, subtle #8F532B active border
   -------------------------------------------------------------------------- */
.nav-item-link {
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em;
  position: relative;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
  text-decoration: none;
  cursor: pointer;
}

/* Active State on Desktop */
#main-header.header-transparent .nav-item-link.is-active,
#main-header.header-transparent [data-nav-id].is-active > .nav-item-link {
  color: #FFFFFF !important;
  border-bottom-color: #8F532B !important;
}

#main-header.header-scrolled .nav-item-link.is-active,
#main-header.header-scrolled [data-nav-id].is-active > .nav-item-link,
#main-header.header-solid .nav-item-link.is-active,
#main-header.header-solid [data-nav-id].is-active > .nav-item-link,
#main-header.header-dropdown-active .nav-item-link.is-active,
#main-header.header-dropdown-active [data-nav-id].is-active > .nav-item-link {
  color: #8F532B !important;
  border-bottom-color: #8F532B !important;
}

/* Active Sub-Items inside Dropdowns */
.nav-sub-item.is-active {
  background-color: rgba(143, 83, 43, 0.08);
  color: #8F532B !important;
  font-weight: 700;
}
.nav-sub-item.is-active .nav-sub-item-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* --------------------------------------------------------------------------
   2. DESKTOP DROPDOWN & MEGA MENU PANELS
   Strict Rule: Hidden by default. Only ONE panel open when .is-open is present.
   -------------------------------------------------------------------------- */
.nav-dropdown-panel {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  pointer-events: none !important;
  z-index: 90;
}

.nav-dropdown-panel.is-open {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Chevron indicator rotation */
.nav-chevron {
  transition: transform 200ms ease;
}
button[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

/* Standard single-column dropdown (Safari, Trekking) */
.nav-dropdown-standard {
  position: absolute;
  top: 100%;
  padding-top: 0.75rem;
}
.nav-dropdown-standard::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 24px;
  pointer-events: auto;
}

/* Full-width mega-menu panel (Destinations, Accommodation) anchored directly to header */
.nav-dropdown-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}
.nav-dropdown-mega::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 32px;
  pointer-events: auto;
}

/* Dropdown Card Surfaces */
.dropdown-card-surface {
  background-color: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.25rem; /* rounded-2xl */
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 0.75rem 0.5rem;
  min-width: 240px;
}

.mega-menu-card-surface {
  background-color: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.5rem; /* rounded-3xl */
  box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.14), 0 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 1.75rem;
}

/* Sub-item Styling */
.nav-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem; /* rounded-xl */
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: #1C1917;
  transition: all 150ms ease;
  text-decoration: none;
}
.nav-sub-item:hover {
  background-color: rgba(143, 83, 43, 0.08); /* warm-brown/8 */
  color: #8F532B;
}
.nav-sub-item-arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: all 150ms ease;
  font-size: 0.75rem;
  color: #8F532B;
}
.nav-sub-item:hover .nav-sub-item-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* --------------------------------------------------------------------------
   3. MOBILE NAVIGATION DRAWER & ACCORDIONS
   -------------------------------------------------------------------------- */
#mobile-menu-backdrop {
  z-index: 98;
}

#mobile-menu {
  z-index: 100;
}

.mobile-accordion-content {
  display: none;
}
.mobile-accordion-content.is-open {
  display: block;
}

.mobile-chevron {
  transition: transform 200ms ease;
}
button[aria-expanded="true"] .mobile-chevron {
  transform: rotate(180deg);
}

/* Mobile Drawer Active State */
.mobile-nav-item.is-active > a,
.mobile-nav-item.is-active > .mobile-accordion-toggle {
  color: #8F532B !important;
  border-left: 3px solid #8F532B !important;
  background-color: rgba(143, 83, 43, 0.05);
}

.mobile-accordion-content a.is-active {
  color: #8F532B !important;
  font-weight: 700;
  background-color: rgba(143, 83, 43, 0.08);
}
