/* ============================================================
   MEGA MENU STYLES – Global Expeditions
   Add this to main.css (or load as a separate stylesheet)
   ============================================================ */

/* --- Mega Menu Container --- */

@media (min-width: 992px) {
  .megamenu-parent.position-static {
    position: static !important;
  }
  .megamenu-dropdown {
    left: 0;
    right: 0;
    width: 100% !important;
    border-radius: 0;
    margin-top: 0 !important;
    border-top: 3px solid #C19A43;
    background: #fff;
    animation: megamenuFadeIn 0.25s ease-out;
  }
}

@keyframes megamenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile: stack the mega menu naturally */
@media (max-width: 991.98px) {
  .megamenu-dropdown {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent;
    padding: 0 !important;
  }
  .megamenu-dropdown .container-fluid {
    padding: 0;
  }
  .megamenu-dropdown .row.g-3 {
    margin: 0;
  }
}

/* --- Trip Cards --- */

.megamenu-card {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9fa;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none !important;
  height: 100%;
}
.megamenu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card Image */
.megamenu-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Region Tag */
.megamenu-card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 47, 95, 0.85);
  color: #fff;
  font-family: "Titillium Web", sans-serif;
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 3px;
  line-height: 1.4;
}

/* Card Body */
.megamenu-card-body {
  padding: 10px 12px 12px;
}
.megamenu-card-title {
  display: block;
  font-family: "Titillium Web", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #002F5F !important;
  line-height: 1.3;
}
.megamenu-card-subtitle {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
  line-height: 1.4;
}

/* Hover state for text */
.megamenu-card:hover .megamenu-card-title {
  color: #3bbbe6 !important;
}

/* --- VIEW ALL Button --- */

.megamenu-dropdown .btn-outline-primary {
  font-family: "Titillium Web", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  padding: 0.5rem 1.6rem;
  transition: all 0.25s ease;
}

/* --- Mobile adjustments --- */

@media (max-width: 991.98px) {
  .megamenu-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    border-radius: 6px;
    background: #f4f6f8;
  }
  .megamenu-card-img {
    width: 80px;
    min-width: 80px;
    aspect-ratio: 1 / 1;
    border-radius: 6px 0 0 6px;
  }
  .megamenu-card-body {
    padding: 8px 12px;
  }
  .megamenu-card-tag {
    display: none;
  }
  .megamenu-card-title {
    font-size: 0.9rem;
  }
  .megamenu-card-subtitle {
    font-size: 0.7rem;
  }
}

/* ============================================================
   MULTI-LEVEL DROPDOWN (3rd level) – e.g. Expeditions > South America > Ecuador
   Markup from BBE_Bootstrap5_Nav_Walker, toggle script in footer.php
   ============================================================ */

.dropdown-submenu {
  position: relative;
}
.dropdown-submenu > .dropdown-menu {
  display: none;
}
.dropdown-submenu.show > .dropdown-menu {
  display: block;
}
.dropdown-submenu > .dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dropdown-submenu > .dropdown-toggle::after {
  margin-left: .75em;
  transition: transform .2s ease;
}

/* Desktop: fly out to the right, open on hover too */
@media (min-width: 992px) {
  .navbar-expand-lg .navbar-nav .dropdown-submenu > .dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-top: calc(-1 * var(--bs-dropdown-padding-y, .5rem) - 1px);
    margin-left: 0;
  }
  .dropdown-submenu > .dropdown-toggle::after {
    transform: rotate(-90deg);
  }
}
@media (min-width: 992px) and (hover: hover) {
  .dropdown-submenu:hover > .dropdown-menu {
    display: block;
  }
}

/* Mobile: expand inline, indented */
@media (max-width: 991.98px) {
  .dropdown-submenu > .dropdown-menu {
    position: static;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0 0 0 1rem;
  }
  .dropdown-submenu.show > .dropdown-toggle::after {
    transform: rotate(180deg);
  }
}

/* ============================================================
   DROPDOWN STYLE OVERRIDES (regular dropdowns, not the mega menu)
   ============================================================ */

.navbar .dropdown-menu:not(.megamenu-dropdown) {
  --bs-dropdown-bg: #0b2b40;
  --bs-dropdown-color: #fff;
  --bs-dropdown-border-width: 0;
  --bs-dropdown-border-radius: 0;
  --bs-dropdown-min-width: 14rem;
  --bs-dropdown-padding-y: .5rem;
  --bs-dropdown-item-padding-x: 1.25rem;
  --bs-dropdown-item-padding-y: .6rem;
  --bs-dropdown-link-color: #fff;
  --bs-dropdown-link-hover-color: #C19A43;
  --bs-dropdown-link-hover-bg: transparent;
  --bs-dropdown-link-active-color: #C19A43;
  --bs-dropdown-link-active-bg: transparent;
  border-radius: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .15);
}

.navbar .dropdown-menu:not(.megamenu-dropdown) .dropdown-item {
  font-family: "Titillium Web", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  transition: background-color .2s ease, color .2s ease;
}

/* main.css sets a { color: #002F5F !important } – override it for dropdown links */
.navbar .dropdown-menu:not(.megamenu-dropdown) .dropdown-item {
  color: #fff !important;
}
.navbar .dropdown-menu:not(.megamenu-dropdown) .dropdown-item:hover,
.navbar .dropdown-menu:not(.megamenu-dropdown) .dropdown-item:focus,
.navbar .dropdown-menu:not(.megamenu-dropdown) .dropdown-item.active,
.navbar .dropdown-menu:not(.megamenu-dropdown) .dropdown-submenu.show > .dropdown-item {
  color: #C19A43 !important;
  background-color: transparent;
}

/* Submenus (3rd level panels) – lighter navy to set them apart from the first dropdown */
.navbar .dropdown-menu.dropdown-submenu-menu {
  --bs-dropdown-bg: #133d59;
  background-color: #133d59;
}

/* 4th level panels – one step lighter again */
.navbar .dropdown-menu.dropdown-submenu-menu .dropdown-menu.dropdown-submenu-menu {
  --bs-dropdown-bg: #1b4c6d;
  background-color: #1b4c6d;
}

/* Desktop: drop the menu flush with the bottom edge of the fixed navbar.
   The <li> is made static so the menu is positioned against the navbar (top: 100%),
   while left: auto keeps it horizontally under its own menu item. */
@media (min-width: 992px) {
  .navbar-expand-lg .navbar-nav > .nav-item.dropdown:not(.megamenu-parent) {
    position: static;
  }
  .navbar-expand-lg .navbar-nav > .nav-item.dropdown:not(.megamenu-parent) > .dropdown-menu,
  .navbar-expand-lg .navbar-nav > .nav-item.dropdown:not(.megamenu-parent) > .dropdown-menu[data-bs-popper] {
    top: 100%;
    left: auto;
    margin-top: 0;
  }
  /* 3rd level flyout: align with the first item of its parent panel */
  .navbar-expand-lg .navbar-nav .dropdown-submenu > .dropdown-menu {
    margin-top: calc(-1 * var(--bs-dropdown-padding-y, .5rem));
  }
}

/* Mobile: no shadow inside the collapsed menu */
@media (max-width: 991.98px) {
  .navbar .dropdown-menu:not(.megamenu-dropdown) {
    box-shadow: none;
  }
}

/* ============================================================
   SEPARATORS + TITLES INSIDE DROPDOWNS
   Custom Links with CSS class "menu-divider" / "menu-heading"
   ============================================================ */
.navbar .dropdown-menu:not(.megamenu-dropdown) {
  --bs-dropdown-divider-bg: rgba(255, 255, 255, .15);
  --bs-dropdown-divider-margin-y: .5rem;
  --bs-dropdown-header-color: #C19A43;
  --bs-dropdown-header-padding-x: 1.25rem;
  --bs-dropdown-header-padding-y: .25rem;
}
.navbar .dropdown-menu .dropdown-divider {
  margin-left: 1.25rem;
  margin-right: 1.25rem;
  opacity: 1;
}
.navbar .dropdown-menu .dropdown-header {
  font-family: "Titillium Web", sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding-top: .75rem;
}
