/* ============================================
   MOBILE MENU
   ============================================ */

/* Header must stack above everything */
.header {
  position: sticky;
  top: 0;
  z-index: 200001;
}

/* Declare header height as a variable so menu top is always in sync */
:root {
  --header-height: 84px;
}

/* Hide menu button on desktop */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 200002;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: #0f1a14;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate hamburger to X when active */
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ── Mobile-only styles ── */
@media (max-width: 768px) {

  .mobile-menu-btn {
    display: flex;
  }

  .nav-actions {
    display: none;
  }

  /* Full-screen overlay menu, hidden by default */
  .nav-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 1rem 1.5rem 2rem;
    gap: 0;
    overflow-y: auto;
    /* FIX: z-index must be below .header (2000) so the sticky header
       stays on top, but above all page content (hero, sections etc.) */
    z-index: 200000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
  }

  /* Show when JS adds .open */
  .nav-menu.open {
    display: flex;
  }

  .nav-menu > li {
    border-bottom: 1px solid #e2e8e4;
  }

  .nav-menu > li:last-child {
    border-bottom: none;
  }

  .nav-menu .nav-link {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f1a14;
    text-decoration: none;
  }

  .nav-menu .nav-link:hover {
    color: #1a6b3c;
  }

  /* ── Dropdown inside mobile menu ── */

  /* FIX: Override desktop position:absolute so dropdown
     flows inline instead of floating over the page */
  .dropdown-menu {
    position: static !important;
    display: none;
    padding: 0.25rem 0 0.5rem 1rem;
    flex-direction: column;
    gap: 0;
    list-style: none;
    box-shadow: none !important;
    background: transparent !important;
    min-width: unset !important;
    border-left: 3px solid #e2e8e4;
    margin-left: 0.5rem;
  }

  /* Show dropdown when parent has .dropdown-open (toggled by menu.js) */
  .dropdown.dropdown-open .dropdown-menu {
    display: flex;
  }

  /* Highlight the parent link when dropdown is open */
  .dropdown.dropdown-open > .nav-link {
    color: #1a6b3c;
  }

  .dropdown-menu li {
    border-bottom: none;
  }

  .dropdown-menu li a {
    display: block;
    padding: 0.65rem 0;
    font-size: 0.95rem;
    color: #4a5568;
    text-decoration: none;
  }

  .dropdown-menu li a:hover {
    color: #1a6b3c;
  }
}
