/*
 * Der Everest — Traveler Header System
 * Single source of truth for the Traveler header, dropdowns and mobile menu.
 * Keep header/navigation rules out of style.css and the Elementor plugin.
 */

/* --------------------------------------------------------------------------
 * Sticky Traveler header
 * -------------------------------------------------------------------------- */
body #header,
body header#header,
body #main-header,
body header#main-header,
body #menu2,
body header#menu2,
body #menu3,
body header#menu3,
body #menu4,
body header#menu4,
body #st_header_wrap_inner,
body .header-sticky-menu,
body .de-theme-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 10050 !important;
  background: linear-gradient(180deg, rgba(16, 31, 51, .98), rgba(7, 17, 31, .96)) !important;
  color: var(--de-cream) !important;
  border-bottom: 1px solid var(--de-cream-border) !important;
  box-shadow: 0 14px 42px rgba(0, 0, 0, .20) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
  transition: background .28s var(--de-ease), box-shadow .28s var(--de-ease), border-color .28s var(--de-ease) !important;
}

body.de-theme-has-scrolled #header,
body.de-theme-has-scrolled header#header,
body.de-theme-has-scrolled #main-header,
body.de-theme-has-scrolled header#main-header,
body.de-theme-has-scrolled #menu2,
body.de-theme-has-scrolled header#menu2,
body.de-theme-has-scrolled #menu3,
body.de-theme-has-scrolled header#menu3,
body.de-theme-has-scrolled #menu4,
body.de-theme-has-scrolled header#menu4,
body.de-theme-has-scrolled #st_header_wrap_inner,
body.de-theme-has-scrolled .header-sticky-menu,
body.de-theme-has-scrolled .de-theme-header {
  background: rgba(7, 17, 31, .985) !important;
  border-bottom-color: rgba(201, 154, 57, .34) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .34) !important;
}

body.admin-bar #header,
body.admin-bar header#header,
body.admin-bar #main-header,
body.admin-bar header#main-header,
body.admin-bar #menu2,
body.admin-bar header#menu2,
body.admin-bar #menu3,
body.admin-bar header#menu3,
body.admin-bar #menu4,
body.admin-bar header#menu4,
body.admin-bar #st_header_wrap_inner,
body.admin-bar .header-sticky-menu,
body.admin-bar .de-theme-header {
  top: 32px !important;
}

@media screen and (max-width: 782px) {
  body.admin-bar #header,
  body.admin-bar header#header,
  body.admin-bar #main-header,
  body.admin-bar header#main-header,
  body.admin-bar #menu2,
  body.admin-bar header#menu2,
  body.admin-bar #menu3,
  body.admin-bar header#menu3,
  body.admin-bar #menu4,
  body.admin-bar header#menu4,
  body.admin-bar #st_header_wrap_inner,
  body.admin-bar .header-sticky-menu,
  body.admin-bar .de-theme-header {
    top: 46px !important;
  }

  body.logged-in #header {
    margin-top: 0 !important;
  }
}

body #st_header_wrap,
body .header-wrap,
body .global-wrap.header-wrap,
body .sticky-wrapper,
body .sticky-wrapper.is-sticky {
  overflow: visible !important;
}

body #st_header_wrap,
body .header-wrap,
body .global-wrap.header-wrap {
  position: relative !important;
  z-index: 10040 !important;
}

body .sticky-wrapper,
body .sticky-wrapper.is-sticky {
  height: auto !important;
  z-index: 10040 !important;
}

body .sticky-wrapper .header-sticky-menu,
body .sticky-wrapper.is-sticky .header-sticky-menu {
  width: 100% !important;
}

html {
  scroll-padding-top: calc(var(--de-header-height, 92px) + 16px);
}

body [id] {
  scroll-margin-top: calc(var(--de-header-height, 92px) + 24px);
}

/* --------------------------------------------------------------------------
 * Brand/logo and primary navigation
 * -------------------------------------------------------------------------- */
body header#header .logo img,
body #header .logo img,
body #main-header .logo img,
body #menu2 .logo img,
body #menu3 .logo img,
body #menu4 .logo img {
  width: auto;
  max-height: 58px;
  object-fit: contain;
}

body #main-menu,
body #header #main-menu,
body #main-header #main-menu,
body #menu2 #main-menu,
body #menu3 #main-menu,
body #menu4 #main-menu,
body #st-main-menu .main-menu {
  list-style: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
}

body #main-menu > li > a,
body #st-main-menu .main-menu > li > a {
  color: rgba(245, 234, 210, .80) !important;
  font-family: var(--de-mono);
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .18em;
  text-transform: uppercase;
}

body #main-menu > li:hover > a,
body #main-menu > li:focus-within > a,
body #main-menu > li.current-menu-item > a,
body #main-menu > li.current-menu-ancestor > a,
body #st-main-menu .main-menu > li:hover > a,
body #st-main-menu .main-menu > li:focus-within > a,
body #st-main-menu .main-menu > li.current-menu-item > a,
body #st-main-menu .main-menu > li.current-menu-ancestor > a {
  color: var(--de-gold-soft) !important;
}

/* Traveler may render its own actual caret icon. Do not add another pseudo icon. */
body #main-menu > li.menu-item-has-children > a::after,
body #main-menu > li.menu-item-mega-parent > a::after,
body #st-main-menu .main-menu > li.menu-item-has-children > a::after,
body #st-main-menu .main-menu > li.has-mega-menu > a::after {
  content: none !important;
  display: none !important;
}

body #main-menu .fa,
body #st-main-menu .main-menu .fa {
  color: var(--de-gold-soft) !important;
}

body #main-menu li.menu-item-has-children,
body #st-main-menu .main-menu li.menu-item-has-children {
  position: relative;
}

body #main-menu > li.menu-item-mega-parent,
body #st-main-menu .main-menu > li.menu-item-mega-parent,
body #st-main-menu .main-menu > li.has-mega-menu {
  position: static;
}

/* --------------------------------------------------------------------------
 * Desktop dropdown and mega menu
 * -------------------------------------------------------------------------- */
@media screen and (min-width: 992px) {
  body #main-menu li.menu-item-has-children > .menu-dropdown,
  body #st-main-menu .main-menu li.menu-item-has-children > .menu-dropdown,
  body #st-main-menu .main-menu li.has-mega-menu > ul.sub-menu.mega-menu {
    position: absolute !important;
    left: 0;
    top: calc(100% + 10px);
    z-index: 10060;
    width: min(286px, calc(100vw - 32px));
    min-width: 238px;
    margin: 0 !important;
    padding: 10px !important;
    list-style: none !important;
    background: linear-gradient(180deg, rgba(224, 185, 90, .08), rgba(224, 185, 90, 0) 46%), var(--de-navy-deep) !important;
    border: 1px solid rgba(201, 154, 57, .26) !important;
    border-top-color: var(--de-gold-border) !important;
    box-shadow: var(--de-shadow) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, 10px, 0);
    transition: opacity .22s ease, visibility .22s ease, transform .22s var(--de-ease);
  }

  body #main-menu li.menu-item-has-children:hover > .menu-dropdown,
  body #main-menu li.menu-item-has-children:focus-within > .menu-dropdown,
  body #st-main-menu .main-menu li.menu-item-has-children:hover > .menu-dropdown,
  body #st-main-menu .main-menu li.menu-item-has-children:focus-within > .menu-dropdown,
  body #st-main-menu .main-menu li.has-mega-menu:hover > ul.sub-menu.mega-menu,
  body #st-main-menu .main-menu li.has-mega-menu:focus-within > ul.sub-menu.mega-menu {
    top: calc(100% + 6px) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translate3d(0, 0, 0);
  }

  body #main-menu > li.menu-item-mega-parent > .menu-dropdown,
  body #st-main-menu .main-menu > li.menu-item-mega-parent > .menu-dropdown,
  body #st-main-menu .main-menu > li.has-mega-menu > ul.sub-menu.mega-menu {
    left: 50% !important;
    width: min(1400px, calc(100vw - 48px)) !important;
    min-width: 0 !important;
    padding: clamp(22px, 3vw, 34px) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch;
    gap: 0;
    transform: translate3d(-50%, 10px, 0);
  }

  body #main-menu > li.menu-item-mega-parent:hover > .menu-dropdown,
  body #main-menu > li.menu-item-mega-parent:focus-within > .menu-dropdown,
  body #st-main-menu .main-menu > li.menu-item-mega-parent:hover > .menu-dropdown,
  body #st-main-menu .main-menu > li.menu-item-mega-parent:focus-within > .menu-dropdown,
  body #st-main-menu .main-menu > li.has-mega-menu:hover > ul.sub-menu.mega-menu,
  body #st-main-menu .main-menu > li.has-mega-menu:focus-within > ul.sub-menu.mega-menu {
    transform: translate3d(-50%, 0, 0) !important;
  }

  body #main-menu > li.menu-item-mega-parent > .menu-dropdown > li,
  body #st-main-menu .main-menu > li.menu-item-mega-parent > .menu-dropdown > li,
  body #st-main-menu .main-menu > li.has-mega-menu > ul.sub-menu.mega-menu > li {
    flex: 1 1 230px;
    min-width: 220px;
    border-right: 1px solid var(--de-cream-border);
  }

  body #main-menu > li.menu-item-mega-parent > .menu-dropdown > li:last-child,
  body #st-main-menu .main-menu > li.menu-item-mega-parent > .menu-dropdown > li:last-child,
  body #st-main-menu .main-menu > li.has-mega-menu > ul.sub-menu.mega-menu > li:last-child {
    border-right: 0;
  }
}

body #main-menu .menu-dropdown li,
body #st-main-menu .main-menu .menu-dropdown li,
body #st-main-menu .main-menu .sub-menu li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body #main-menu .menu-dropdown a,
body #st-main-menu .main-menu .menu-dropdown a,
body #st-main-menu .main-menu .sub-menu a {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 12px 14px !important;
  color: var(--de-cream-muted) !important;
  background: transparent !important;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--de-mono);
  font-size: 11px !important;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none !important;
}

body #main-menu .menu-dropdown a:hover,
body #main-menu .menu-dropdown a:focus-visible,
body #st-main-menu .main-menu .menu-dropdown a:hover,
body #st-main-menu .main-menu .menu-dropdown a:focus-visible,
body #st-main-menu .main-menu .sub-menu a:hover,
body #st-main-menu .main-menu .sub-menu a:focus-visible {
  color: var(--de-gold-soft) !important;
  background: rgba(201, 154, 57, .095) !important;
  border-color: rgba(201, 154, 57, .22);
  outline: none;
}

/* --------------------------------------------------------------------------
 * Mobile/tablet: preserve Traveler's native menu behavior.
 *
 * IMPORTANT: We only widen Traveler's native 300px off-canvas panel to the
 * viewport. Traveler continues to own opening/closing, overlay, body scroll
 * lock, back-menu animation, submenu toggles and the hamburger control.
 * -------------------------------------------------------------------------- */
@media screen and (max-width: 991px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body #header,
  body header#header,
  body #main-header,
  body header#main-header,
  body #menu2,
  body header#menu2,
  body #menu3,
  body header#menu3,
  body #menu4,
  body header#menu4,
  body #st_header_wrap_inner,
  body .header-sticky-menu,
  body .de-theme-header {
    background: rgba(7, 17, 31, .99) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .28) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body header#header .logo img,
  body #header .logo img,
  body #main-header .logo img,
  body #menu2 .logo img,
  body #menu3 .logo img,
  body #menu4 .logo img {
    max-height: 48px;
  }

  /*
   * Width-only override.
   * Native Traveler values remain untouched for position, top, left,
   * height, visibility, opacity, z-index and transition behavior.
   */
  body header .header .header-left #st-main-menu .back-menu,
  body header .header .header-left #st-main-menu.open .back-menu,
  body header .header .header-left #st-main-menu .main-menu,
  body header .header .header-left #st-main-menu.open .main-menu {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Der Everest visual treatment only; no behavior changes. */
  body header .header .header-left #st-main-menu .back-menu {
    background: var(--de-navy-soft) !important;
    color: var(--de-cream) !important;
    border-bottom-color: var(--de-cream-border) !important;
  }

  body header .header .header-left #st-main-menu .main-menu {
    background: var(--de-navy-deep) !important;
  }

  body header .header .header-left #st-main-menu .main-menu > li > a {
    color: var(--de-cream) !important;
  }

  /* Submenu contrast only. Traveler still owns open/close and transitions. */
  body header .header .header-left #st-main-menu .main-menu .menu-dropdown,
  body header .header .header-left #st-main-menu .main-menu .sub-menu {
    background: var(--de-navy) !important;
  }

  body header .header .header-left #st-main-menu .main-menu .menu-dropdown a,
  body header .header .header-left #st-main-menu .main-menu .sub-menu a {
    color: var(--de-cream) !important;
    background: var(--de-navy) !important;
    font-size: 13px !important;
    letter-spacing: .04em !important;
    text-transform: none !important;
  }

  body header .header .header-left #st-main-menu .main-menu a:hover,
  body header .header .header-left #st-main-menu .main-menu a:focus {
    color: var(--de-gold-soft) !important;
  }

  /* 48px touch target; Traveler's native toggle behavior is untouched. */
  body header .toggle-menu {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    margin-top: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    line-height: 1 !important;
  }

  body header .toggle-menu svg {
    width: 32px !important;
    height: 32px !important;
    color: #FFFFFF !important;
    fill: #FFFFFF !important;
    vertical-align: middle !important;
  }

  body header .toggle-menu svg path,
  body header .toggle-menu svg line,
  body header .toggle-menu svg polyline {
    color: #FFFFFF !important;
    fill: currentColor !important;
    stroke: currentColor !important;
  }
}
