/* Jeff Brown Yachts — Header V2 mega menu (from jby-mega-menu-v3 dark frosted) */

#jb_body .mega {
  position: fixed;
  inset: 0;
  z-index: 5000;
  visibility: hidden;
  pointer-events: none;
}

#jb_body .mega.open {
  visibility: visible;
  pointer-events: auto;
}

#jb_body .mega-veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.55s ease;
  cursor: pointer;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

#jb_body .mega.open .mega-veil {
  opacity: 1;
}

#jb_body .mega[data-theme="dark"] {
  --m-bg: #0b0b0c;
  --m-detail: transparent;
  --m-fg: #f3f4f6;
  --m-mute: rgba(255, 255, 255, 0.64);
  --m-line: rgba(255, 255, 255, 0.14);
  --m-accent: #c9bda6;
  --m-hi: rgba(255, 255, 255, 0.08);
  --m-logo: none;
}

#jb_body .mega-panel {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: min(1060px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--m-bg);
  color: var(--m-fg);
  transform: translateX(-102%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.45);
}

#jb_body .mega.open .mega-panel {
  transform: translateX(0);
}

#jb_body .mega[data-theme="dark"] .mega-panel {
  background: rgba(8, 8, 9, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

#jb_body .mega[data-theme="dark"] .mega-detail {
  background: rgba(0, 0, 0, 0.72);
}

#jb_body .mega[data-theme="dark"] .mega-feature,
#jb_body .mega[data-theme="dark"] .mega-scrim {
  display: none;
}

#jb_body .mega-feature {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.7s ease;
}

#jb_body .mega-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(8, 8, 9, 0.92) 0%,
    rgba(8, 8, 9, 0.82) 48%,
    rgba(8, 8, 9, 0.58) 100%
  );
}

#jb_body .mega[data-theme="dark"] .mega-pane {
  z-index: 2;
}

#jb_body .mega[data-theme="dark"] .mega-top,
#jb_body .mega[data-theme="dark"] .mega-rail,
#jb_body .mega[data-theme="dark"] .mega-foot {
  background: rgba(0, 0, 0, 0.95);
}

#jb_body .mega[data-theme="dark"] .mega-foot a.mf-link {
  color: rgba(255, 255, 255, 0.82);
}

#jb_body .mega[data-theme="dark"] .mega-foot a.mf-link:hover {
  color: #fff;
}

#jb_body .mega-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px 20px 40px;
  border-bottom: 0.5px solid var(--m-line);
}

#jb_body .mega-logo {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#jb_body .mega-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--m-logo);
}

#jb_body .mega-close {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--m-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: color 0.2s;
  padding: 0;
}

#jb_body .mega-close:hover {
  color: var(--m-accent);
}

#jb_body .mega-ti {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

#jb_body .mega-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
}

#jb_body .mega-rail {
  background: var(--m-bg);
  padding: 14px 0;
  overflow-y: auto;
}

#jb_body .mega-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - 32px);
  margin: 2px 16px;
  padding: 13px 22px;
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--m-fg);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  box-sizing: border-box;
}

#jb_body .mega-cat .chev {
  font-size: 20px;
  line-height: 1;
  color: var(--m-mute);
  transition: color 0.2s;
}

#jb_body .mega-cat:hover {
  background: var(--m-hi);
  color: var(--m-fg);
}

#jb_body .mega-cat.active {
  background: var(--m-hi);
  color: var(--m-accent);
}

#jb_body .mega-cat.active .chev {
  color: var(--m-accent);
}

#jb_body .mega-detail {
  position: relative;
  overflow: hidden;
  background: var(--m-detail);
}

#jb_body .mega-back {
  display: none;
}

#jb_body .mega-pane {
  position: absolute;
  inset: 0;
  padding: 44px 52px;
  overflow: hidden;
  display: none;
  flex-wrap: wrap;
  gap: 34px 60px;
  align-content: flex-start;
}

#jb_body .mega-pane.on {
  display: flex;
  animation: headerV2MegaFade 0.55s ease both;
}

@keyframes headerV2MegaFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#jb_body .mega-col {
  min-width: 0;
}

#jb_body .mega-col h4 {
  font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--m-mute);
  margin: 0 0 20px;
}

#jb_body .mega-col a {
  display: block;
  width: fit-content;
  font-family: "Myriad Pro", "Myriad-Pro-Regular", sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  color: var(--m-fg);
  text-decoration: none;
  padding: 11px 0;
  transition: color 0.2s, transform 0.2s;
}

#jb_body .mega-col a:hover {
  color: var(--m-accent);
  transform: translateX(6px);
}

#jb_body .mega-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 40px;
  border-top: 0.5px solid var(--m-line);
  background: var(--m-bg);
}

#jb_body .mega-foot .mf-l {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

#jb_body .mega-foot a.mf-link {
  font-family: "Myriad Pro", "Myriad-Pro-Regular", sans-serif;
  font-size: 18px;
  color: #575760;
  text-decoration: none;
  transition: color 0.2s;
}

#jb_body .mega-foot a.mf-link:hover {
  color: var(--m-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

#jb_body .mega-foot-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  align-items: center;
  column-gap: 0;
  padding: 14px 0;
}

#jb_body .mega-foot-split .mf-social {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 34px;
}

#jb_body .mega-foot-split .mf-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--m-fg);
  opacity: 0.72;
  transition: opacity 0.2s, color 0.2s;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  width: 28px;
  height: 28px;
}

#jb_body .mega-foot-split .mf-social a:hover {
  opacity: 1;
  color: #fff;
}

#jb_body .mega-foot-split .mf-l {
  padding: 0 40px 0 52px;
}

#jb_body .mega[data-theme="dark"] .mega-panel::after {
  content: "";
  position: absolute;
  top: 96.5px;
  bottom: 0;
  left: 320px;
  width: 0.5px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 3;
  pointer-events: none;
}

@media (max-width: 880px) {
  #jb_body .mega-panel {
    width: 100%;
  }

  #jb_body .mega[data-theme="dark"] .mega-panel::after {
    display: none;
  }

  #jb_body .mega-body {
    display: block;
    position: relative;
    overflow: hidden;
  }

  #jb_body .mega-rail {
    width: 100%;
    height: 100%;
    border-right: 0;
    overflow-y: auto;
    padding: 14px 0;
  }

  #jb_body .mega-cat {
    width: calc(100% - 24px);
    margin: 2px 12px;
    padding: 16px 20px;
    font-size: 19px;
  }

  #jb_body .mega-detail {
    position: absolute;
    inset: 0;
    z-index: 6;
    transform: translateX(100%);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  }

  #jb_body .mega-body.drill .mega-detail {
    transform: translateX(0);
  }

  #jb_body .mega[data-theme="dark"] .mega-detail {
    background: rgba(0, 0, 0, 0.95);
  }

  #jb_body .mega-pane {
    padding: 64px 24px 30px;
    gap: 28px 40px;
    overflow-y: auto;
  }

  #jb_body .mega-back {
    display: inline-flex;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 4;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--m-mute);
    font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif;
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0;
  }

  #jb_body .mega-top,
  #jb_body .mega-foot {
    padding: 16px 24px;
  }

  #jb_body .mega-foot-split {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 24px;
  }

  #jb_body .mega-foot-split .mf-social,
  #jb_body .mega-foot-split .mf-l {
    padding: 0;
  }
}

/* Open state: keep site header chrome out of the way; mega owns the overlay */
#jb_body header.header-v2.header-v2--menu-open,
#jb_body header.header-v2.header-v2--overlay.header-v2--menu-open,
#jb_body header.header-v2.header-v2--flow.header-v2--menu-open,
#jb_body header.header-v2.header-v2--menu-open.header-v2--sticky,
#jb_body header.header-v2.header-v2--menu-open.scrolled {
  z-index: 4000 !important;
  pointer-events: auto;
  background: transparent !important;
}

#jb_body header.header-v2.header-v2--menu-open .header-v2__bar,
#jb_body header.header-v2.header-v2--menu-open.header-v2--sticky .header-v2__bar,
#jb_body header.header-v2.header-v2--menu-open.scrolled .header-v2__bar,
#jb_body.layout-v2:not(.home-page-v2) .header-v2--menu-open .header-v2__bar,
#jb_body.home-page-v2 .header-v2--menu-open .header-v2__bar {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Close lives inside mega panel — keep burger as open affordance */
#jb_body header.header-v2.header-v2--menu-open .header-v2__menu-icon--open {
  display: inline-flex !important;
}

#jb_body header.header-v2.header-v2--menu-open .header-v2__menu-icon--close {
  display: none !important;
}

/* Lock mega type/spacing so page CSS (home button/a resets, etc.) cannot restyle it */
#jb_body .mega .mega-top {
  padding: 20px 32px 20px 40px;
}

#jb_body .mega .mega-logo {
  width: 56px;
  height: 56px;
}

#jb_body .mega .mega-close {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 24px;
}

#jb_body .mega .mega-body {
  grid-template-columns: 320px 1fr;
}

#jb_body .mega .mega-rail {
  padding: 14px 0;
}

#jb_body .mega .mega-cat {
  font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif !important;
  font-weight: 300 !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  color: var(--m-fg) !important;
  width: calc(100% - 32px);
  margin: 2px 16px;
  padding: 13px 22px !important;
  background: transparent;
  border: 0;
  border-radius: 2px;
}

#jb_body .mega .mega-cat.active {
  background: var(--m-hi);
  color: var(--m-accent) !important;
}

#jb_body .mega .mega-pane {
  padding: 44px 52px;
  gap: 34px 60px;
}

#jb_body .mega .mega-col h4 {
  font-family: "Mesmerize", "Mesmerize-ex-lt", sans-serif !important;
  font-weight: 300 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: var(--m-mute) !important;
  margin: 0 0 20px;
}

#jb_body .mega .mega-col a {
  font-family: "Myriad Pro", "Myriad-Pro-Regular", sans-serif !important;
  font-weight: 400 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  color: var(--m-fg) !important;
  padding: 11px 0 !important;
  text-decoration: none !important;
}

#jb_body .mega .mega-col a:hover {
  color: var(--m-accent) !important;
}

#jb_body .mega .mega-foot {
  padding: 18px 40px;
}

#jb_body .mega .mega-foot-split {
  grid-template-columns: 320px 1fr;
  padding: 14px 0;
}

#jb_body .mega .mega-foot-split .mf-social {
  gap: 20px;
  padding: 0 34px;
}

#jb_body .mega .mega-foot-split .mf-social a {
  width: 28px;
  height: 28px;
  font-size: 22px;
  color: var(--m-fg) !important;
}

#jb_body .mega .mega-foot a.mf-link {
  font-family: "Myriad Pro", "Myriad-Pro-Regular", sans-serif !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  color: rgba(255, 255, 255, 0.82) !important;
}

#jb_body .mega .mega-foot-split .mf-l {
  padding: 0 40px 0 52px;
}

@media (max-width: 880px) {
  #jb_body .mega .mega-cat {
    width: calc(100% - 24px);
    margin: 2px 12px;
    padding: 16px 20px !important;
    font-size: 19px !important;
  }

  #jb_body .mega .mega-pane {
    padding: 64px 24px 30px;
    gap: 28px 40px;
  }

  #jb_body .mega .mega-top,
  #jb_body .mega .mega-foot {
    padding: 16px 24px;
  }

  #jb_body .mega .mega-foot-split {
    grid-template-columns: 1fr;
    padding: 16px 24px;
  }

  #jb_body .mega .mega-foot-split .mf-social,
  #jb_body .mega .mega-foot-split .mf-l {
    padding: 0;
  }
}
