/* Enhanced mobile menu with improved styling and animations */

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1300;
  padding: 0;
  gap: 0;
}

.menu-toggle.menu-toggle-white .hamburger-line, .menu-toggle.menu-toggle-white .hamburger-pulse {
  background: #fff !important;
}

.hamburger-line {
  position: absolute;
  width: 28px;
  height: 2.5px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: center;
}

.hamburger-line.line-1 {
  transform: translateY(-8px);
}

.hamburger-line.line-2 {
  opacity: 1;
}

.hamburger-line.line-3 {
  transform: translateY(8px);
}

.hamburger-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(26, 77, 46, 0);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.menu-toggle:hover .hamburger-pulse {
  border-color: rgba(26, 77, 46, 0.3);
}

/* Active state */
.menu-toggle.active .hamburger-line.line-1 {
  transform: rotate(45deg) translateY(0);
  background: var(--color-white);
}

.menu-toggle.active .hamburger-line.line-2 {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active .hamburger-line.line-3 {
  transform: rotate(-45deg) translateY(0);
  background: var(--color-white);
}

.menu-toggle.active .hamburger-pulse {
  animation: menuPulse 0.6s ease forwards;
}

@keyframes menuPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 77, 46, 0.7);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(26, 77, 46, 0);
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a4d2e 0%, #0f3620 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 0;
    transition: opacity 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), visibility 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    visibility: hidden;
    z-index: 1200;
    box-shadow: none;
    overflow-y: auto;
  }

  .menu-toggle {
    position: fixed;
    top: 30px;
    right: 18px;
    z-index: 1301;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .menu-toggle .close-icon {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    width: 26px;
    height: 26px;
    pointer-events: none;
  }
  .menu-toggle.active .close-icon {
    display: block;
    pointer-events: auto;
  }
  .menu-toggle.active .hamburger-line,
  .menu-toggle.active .hamburger-pulse {
    display: none;
  }

  .nav-menu.active {
    opacity: 1;
    visibility: visible;
  }

  .nav-menu li {
    border-bottom: none;
    margin: 0.5rem 0;
    padding: 0;
    width: 100%;
    text-align: center;
  }

  .nav-link {
    display: block;
    padding: 1.5rem 0;
    font-size: 1.25rem;
    color: var(--color-white);
    font-weight: 600;
    letter-spacing: 1px;
    transition: background 0.3s, color 0.3s, border-radius 0.3s;
    border-radius: 32px;
    margin: 0 auto;
    width: 80vw;
    max-width: 320px;
    background: rgba(255,255,255,0.04);
  }

  .nav-link:hover {
    background: var(--color-accent);
    color: var(--color-dark, #0f3620);
    border-radius: 32px;
  }

  .nav-link::after {
    display: none;
  }

  @keyframes slideInMenuItem {
    from {
      opacity: 0;
      transform: translateX(-20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .nav-menu.active li {
    animation: slideInMenuItem 0.4s ease forwards;
  }

  .nav-menu.active li:nth-child(1) {
    animation-delay: 0.05s;
  }
  .nav-menu.active li:nth-child(2) {
    animation-delay: 0.1s;
  }
  .nav-menu.active li:nth-child(3) {
    animation-delay: 0.15s;
  }
  .nav-menu.active li:nth-child(4) {
    animation-delay: 0.2s;
  }
  .nav-menu.active li:nth-child(5) {
    animation-delay: 0.25s;
  }
  .nav-menu.active li:nth-child(6) {
    animation-delay: 0.3s;
  }
  .nav-menu.active li:nth-child(7) {
    animation-delay: 0.35s;
  }
}

@media (max-width: 480px) {
  .menu-toggle {
    width: 45px;
    height: 45px;
  }

  .hamburger-line {
    width: 24px;
    height: 2px;
  }

  .hamburger-line.line-1 {
    transform: translateY(-6px);
  }

  .hamburger-line.line-3 {
    transform: translateY(6px);
  }

  .nav-menu {
    top: 0;
    height: calc(100vh);
  }

  .nav-link {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }
}
