/* ── BURGER BUTTON ── */
.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-left: 12px;
  /* Critical: isolate from nav stacking context */
  position: relative;
  z-index: 1100;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.burger-menu span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: #1D2B4A;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.burger-menu.active span:nth-child(1) {
  transform: translateY(9.5px) rotate(45deg);
}
.burger-menu.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.burger-menu.active span:nth-child(3) {
  transform: translateY(-9.5px) rotate(-45deg);
}

/* ── DRAWER OVERLAY ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ── MOBILE DRAWER ── */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100dvh;
  height: 100vh; /* fallback */
  background: #ffffff;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 32px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

/* ── CLOSE BUTTON ── */
.drawer-close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 20px 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: #4A5568;
  cursor: pointer;
  align-self: flex-end;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  min-width: 44px;
}

/* ── NAV LIST ── */
.mobile-nav-list {
  list-style: none;
  padding: 0 20px;
  margin: 0 0 24px;
  flex: 1;
}

.mobile-nav-list > li {
  border-bottom: 1px solid #E2D9D0;
}

.mobile-nav-list > li > a,
.mobile-drop-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-size: 17px;
  font-weight: 600;
  color: #1D2B4A;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.mobile-drop-trigger .arrow {
  font-size: 13px;
  transition: transform 0.2s ease;
  color: #718096;
}

.mobile-drop-trigger.open .arrow {
  transform: rotate(180deg);
}

/* ── SUB DROPDOWNS ── */
.mobile-dropdown {
  display: none;
  flex-direction: column;
  padding: 4px 0 12px 16px;
  border-left: 3px solid #C8282A;
  margin-left: 4px;
  margin-bottom: 8px;
}

.mobile-dropdown.open {
  display: flex;
}

.mobile-dropdown a {
  font-size: 14px;
  font-weight: 500;
  color: #4A5568;
  padding: 10px 0;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-dropdown a:hover {
  color: #C8282A;
}

/* ── CTA BUTTONS ── */
.mobile-nav-actions {
  padding: 20px 20px 0;
  border-top: 1px solid #E2D9D0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav-actions .btn-nav-ghost,
.mobile-nav-actions .btn-nav-red {
  display: block;
  text-align: center;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  min-height: 44px;
  touch-action: manipulation;
}

/* ── RESPONSIVE: show burger only on mobile ── */
@media (max-width: 900px) {
  .burger-menu {
    display: flex;
  }

  /* Remove backdrop-filter on mobile — it creates stacking context
     that traps the burger button on Safari/iOS */
  nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(247, 243, 236, 0.99) !important;
  }

  .nav-right .btn-nav-ghost,
  .nav-right .btn-nav-red {
    display: none;
  }
}

@media (min-width: 901px) {
  .mobile-nav-drawer,
  .drawer-overlay,
  .drawer-close {
    display: none !important;
  }
}