/* =========================================================
   Mobile navigation
   - Hamburger sits at the top right on small screens
   - Menu slides in from the right at full viewport height
   - Dark overlay covers the page while the menu is open
   Works with the markup in mobile-nav-header.html
   ========================================================= */

/* Hamburger button (hidden on desktop) */
.wrap .header-inner{
    display: flex;
    justify-content: center;
    align-items: center;
}
.menu-toggle {
  display: none;
  position: relative;
  width: 46px;
  height: 46px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  z-index: 70;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--brand, #1d4e5f);
  transition: transform 0.35s ease, opacity 0.2s ease, top 0.35s ease;
}
.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 22px; }
.menu-toggle span:nth-child(3) { top: 30px; }

/* Turn the three lines into an X when open */
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

.menu-toggle:focus-visible {
  outline: 3px solid var(--brand-soft, #e8f1f3);
  outline-offset: 2px;
}

/* Dark overlay behind the open menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 30, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 55;
}
.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Slide-in drawer from the right */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;               /* full viewport height */
  height: 100dvh;              /* keeps the full height on mobile browsers with moving address bars */
  width: min(86vw, 360px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0.4s ease;
  z-index: 60;
}
.mobile-menu.is-open {
  transform: translateX(0);
  visibility: visible;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #dfe6e9);
}
.mobile-menu-title {
  font-weight: 800;
  color: var(--brand, #1d4e5f);
  font-size: 1rem;
}
.menu-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-soft, #e8f1f3);
  color: var(--brand, #1d4e5f);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.menu-close:focus-visible {
  outline: 3px solid var(--brand, #1d4e5f);
  outline-offset: 2px;
}

.mobile-menu-links {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.mobile-menu-links a::after {
  content: "\203A";
  color: var(--brand, #1d4e5f);
  font-size: 1.4rem;
  line-height: 1;
}
.mobile-menu-links a[aria-current="page"] {
  color: var(--brand, #1d4e5f);
  background: var(--brand-soft, #e8f1f3);
}

.mobile-menu-cta {
  display: grid;
  gap: 12px;
  padding: 20px;
  margin-top: auto;
}
.mobile-menu-cta .btn {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}
.mobile-menu-cta .btn-brand {
  background: var(--brand, #1d4e5f);
  color: #ffffff;
}
.mobile-menu-cta .btn-wa {
  background: #25D366;
  color: #0b3d1f;
}
.mobile-menu-cta .btn-ghost {
  background: #ffffff;
  color: var(--brand, #1d4e5f);
  border: 2px solid var(--brand, #1d4e5f);
}

.mobile-menu-foot {
  padding: 14px 20px 22px;
  font-size: 0.88rem;
  color: var(--muted, #5b6b73);
  border-top: 1px solid var(--border, #dfe6e9);
}

/* Lock page scroll while the menu is open */
body.menu-open {
  overflow: hidden;
}

/* Desktop: show the normal nav, hide the mobile menu parts */
@media (min-width: 821px) {
  .menu-toggle,
  .nav-overlay,
  .mobile-menu {
    display: none;
  }
}

/* Mobile: hide the desktop nav links and show the hamburger */
@media (max-width: 820px) {
  .desktop-nav {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle span,
  .nav-overlay,
  .mobile-menu {
    transition: none;
  }
}