/* Site-wide header dropdown. This replaces the old floating side menu. */
:root {
  --site-header-height: 74px;
}

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

body.site-fixed-header {
  padding-top: var(--site-header-height);
}

body.site-fixed-header header.bar {
  position: fixed !important;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

[id] {
  scroll-margin-top: calc(var(--site-header-height) + 16px);
}

header .wrap {
  position: relative;
}

header .bar-cta,
.bar-cta.site-generated-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

header .nav-menu {
  position: relative;
  display: block !important;
  flex: 0 0 auto;
}

header .nav-menu summary {
  position: relative;
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  min-width: 86px;
  height: 52px;
  padding: 0 18px;
  overflow: visible;
  border: 1px solid rgba(224, 166, 87, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(33, 21, 14, 0.98), rgba(16, 10, 6, 0.98));
  color: #fff8ea;
  box-shadow:
    0 10px 30px -18px rgba(224, 166, 87, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}

header .nav-menu summary::-webkit-details-marker {
  display: none;
}

header .nav-menu summary::before {
  display: none;
}

header .nav-menu summary::after {
  display: none !important;
}

header .nav-menu[open] summary {
  border-color: rgba(224, 166, 87, 0.72);
  background: linear-gradient(135deg, rgba(45, 29, 18, 1), rgba(16, 10, 6, 1));
  color: #fff8ea;
}

header .nav-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 120;
  display: grid;
  width: min(330px, calc(100vw - 32px));
  max-height: min(72vh, 620px);
  overflow: auto;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(224, 166, 87, 0.28);
  border-radius: 14px;
  background: rgba(18, 11, 6, 0.98);
  box-shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.7);
}

header .nav-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #fffaf0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
}

header .nav-panel a span {
  color: rgba(255, 250, 240, 0.58);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

header .nav-panel a:hover,
header .nav-panel a:focus-visible {
  background: rgba(224, 166, 87, 0.12);
  color: #fff;
  outline: none;
}

header .nav-panel .nav-divider,
header .nav-panel .site-nav-divider {
  height: 1px;
  margin: 5px 2px;
  background: rgba(255, 255, 255, 0.1);
}

header .site-generated-cta {
  margin-left: auto;
}

header .back-home + .site-generated-cta {
  margin-left: 12px;
}

@media (max-width: 760px) {
  header .bar-phone {
    display: none !important;
  }

  header .bar-cta,
  .bar-cta.site-generated-cta {
    gap: 8px;
  }

  header .nav-menu,
  header.bar .nav-menu {
    position: absolute;
    top: calc(50% - 22px);
    left: 64px;
    z-index: 4;
    /* A transformed ancestor would trap the fixed dropdown inside the button. */
    transform: none;
  }

  header .nav-menu summary {
    width: 82px;
    min-width: 82px;
    height: 44px;
    padding: 0 16px;
    border-color: rgba(224, 166, 87, 0.5);
    background: linear-gradient(135deg, rgba(33, 21, 14, 0.98), rgba(16, 10, 6, 0.98));
    color: #fff8ea;
    box-shadow:
      0 10px 24px -18px rgba(224, 166, 87, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
    letter-spacing: 0.075em;
  }

  header .nav-menu summary::before {
    display: none;
  }

  header .nav-menu[open] summary {
    border-color: rgba(224, 166, 87, 0.7);
    background: linear-gradient(135deg, rgba(45, 29, 18, 1), rgba(16, 10, 6, 1));
    box-shadow:
      0 10px 24px -18px rgba(224, 166, 87, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  header .nav-panel,
  header.bar .nav-panel {
    position: fixed;
    top: calc(var(--site-header-height, 74px) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    box-sizing: border-box;
    max-height: calc(100vh - var(--site-header-height, 74px) - 28px);
    max-height: calc(100dvh - var(--site-header-height, 74px) - 28px - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    border-radius: 14px;
  }
}

@media (max-width: 420px) {
  header .nav-menu summary {
    width: 78px;
    min-width: 78px;
    height: 44px;
  }

  header .bar-cta > .btn-gold {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 0.78rem;
  }
}

@media (max-width: 350px) {
  header .nav-menu,
  header.bar .nav-menu {
    top: calc(50% - 20px);
  }

  header .nav-menu summary {
    width: 72px;
    min-width: 72px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.68rem;
  }

  header .nav-menu summary::before {
    display: none;
  }

  header .bar-cta > .btn-gold {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 0.72rem;
  }
}

@media print {
  header .nav-menu {
    display: none !important;
  }
}
