/* =====================================================================
   DESKTOP MEGA MENUS — Tour Packages / Hotels / Places To Visit / Events
   =====================================================================
   Desktop-only by design: these panels live inside the same ".desktopNav"
   block that is already hidden below 1200px via the theme's ".xl:d-none"
   utility (see header.php), so there is nothing extra to gate here on the
   CSS side — below 1200px this markup simply isn't rendered as "desktop
   nav" at all, the mobile accordion menu (".menuNav"/".submenu") takes
   over instead and is completely untouched by this file.

   Positioning: each panel is "position:fixed" and given its left/top/
   width inline by js/mega-menu JS (see footer.php), clamped to the
   header's own ".container" so it can never overflow the viewport at
   any width. The CSS below only handles appearance + the open/closed
   transition; it intentionally sets no left/top of its own.
   ===================================================================== */

/* The base theme's ".desktopNav__item > a" rule sets "display:flex",
   which makes the link a block-level flex container — fine when the
   link is the item's only child, but it then pushes our new sibling
   ".desktopNav__megaToggle" button onto its own line underneath,
   taking the whole nav bar with it. Making the item itself the flex
   row (sized to its content, not the full width) keeps the link and
   the chevron button side by side at their original single-line
   height, exactly like every other nav item. */
.header .desktopNav__item.-has-mega {
  display: inline-flex;
  align-items: center;
}

.header .desktopNav__item.-has-mega > a {
  cursor: pointer;
  text-wrap: nowrap;
}

.header .desktopNav__item.-has-mega .icon-chevron-down {
  transition: transform .2s ease;
}

.header .desktopNav__item.-has-mega.-is-open .icon-chevron-down {
  transform: rotate(180deg);
}

/* The chevron is its own focusable toggle button (keyboard + touch),
   layered on top of the link text without changing the link's own
   click-through-to-the-page behaviour. */
.desktopNav__megaToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 2px;
  margin-left: 6px;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
}

.desktopNav__megaToggle:focus-visible {
  outline: 2px solid var(--brand-accent, #F0891A);
  outline-offset: 2px;
}

.megaMenu {
  position: fixed;
  z-index: 1100;
  background: var(--brand-background, #fff);
  border: 1px solid var(--brand-border, #E8E2D8);
  border-radius: var(--radius-lg, 22px);
  box-shadow: var(--shadow-lg, 0 16px 48px rgba(0, 32, 58, 0.14));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.megaMenu.js-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.megaMenu__inner {
  display: grid;
  grid-template-columns: minmax(170px, 0.85fr) minmax(170px, 0.85fr) minmax(230px, 1.3fr) minmax(220px, 1fr);
  gap: var(--space-6, 32px);
  padding: var(--space-6, 32px);
}

.megaMenu__col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-muted, #6B7280);
  margin: 0 0 var(--space-3, 12px);
}

.megaMenu__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.megaMenu__links a {
  display: block;
  padding: 7px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-sm, 8px);
  color: var(--brand-text, #1C1C1C);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.megaMenu__links a:hover,
.megaMenu__links a:focus-visible {
  background: var(--brand-primary-light, #E7EFF5);
  color: var(--brand-primary, #004376);
}

.megaMenu__links a.-muted {
  color: var(--brand-muted, #6B7280);
}

/* Featured record cards (packages / hotels / places / events) */

.megaMenu__cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
}

.megaMenu__card {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  padding: var(--space-2, 8px);
  margin: 0 calc(var(--space-2, 8px) * -1);
  border-radius: var(--radius-md, 14px);
  text-decoration: none;
  color: inherit;
  transition: background-color .15s ease;
}

.megaMenu__card:hover,
.megaMenu__card:focus-visible {
  background: var(--brand-surface, #FBF8F3);
}

.megaMenu__card-img {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  background: var(--brand-primary-light, #E7EFF5);
}

.megaMenu__card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.megaMenu__card-body {
  min-width: 0;
}

.megaMenu__card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-text, #1C1C1C);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.megaMenu__card-meta {
  font-size: 12.5px;
  color: var(--brand-muted, #6B7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.megaMenu__card-price {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-accent-dark, #D97400);
}

/* CTA column */

.megaMenu__cta {
  position: relative;
  border-radius: var(--radius-md, 14px);
  overflow: hidden;
  min-height: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--brand-primary, #004376);
  color: #fff;
  text-decoration: none;
  padding: var(--space-5, 24px) var(--space-4, 16px) var(--space-4, 16px);
}

.megaMenu__cta-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.megaMenu__cta-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.megaMenu__cta-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 67, 118, 0) 30%, rgba(0, 32, 58, 0.88) 100%);
}

.megaMenu__cta-text {
  position: relative;
  z-index: 1;
}

.megaMenu__cta-title {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 var(--space-3, 12px);
}

.megaMenu__cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-accent, #F0891A);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-pill, 999px);
  transition: background-color .15s ease;
}

.megaMenu__cta:hover .megaMenu__cta-btn,
.megaMenu__cta:focus-visible .megaMenu__cta-btn {
  background: var(--brand-accent-dark, #D97400);
}

.megaMenu__empty {
  font-size: 13.5px;
  color: var(--brand-muted, #6B7280);
  line-height: 1.5;
}

/* Below the mega-menu breakpoint there is no ".desktopNav" rendered at
   all (see header.php), but this belt-and-braces rule keeps any mega
   panel fully inert if it were ever left in the DOM on a narrower
   viewport (e.g. resizing a desktop window down mid-session). */
@media (max-width: 1199px) {
  .megaMenu {
    display: none !important;
  }
}
