/* ========================================
   MODERN MOBILE HAMBURGER MENU
   ======================================== */

/* Modern Hamburger Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  width: 48px;
  height: 48px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.mobile-menu-btn:hover {
  background: rgba(46, 125, 50, 0.1);
}

.mobile-menu-btn:active {
  background: rgba(46, 125, 50, 0.2);
}

/* Animated Hamburger Icon */
.hamburger {
  display: block;
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  bottom: -8px;
}

/* Active State - Transform to X */
.mobile-menu-btn.active .hamburger {
  background: transparent;
}

.mobile-menu-btn.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
  background: var(--color-accent);
}

.mobile-menu-btn.active .hamburger::after {
  bottom: 0;
  transform: rotate(-45deg);
  background: var(--color-accent);
}

/* Mobile Navigation Overlay */
@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 3000; /* Ensure it's above everything */
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 80px 0 30px;
  }

  .nav.active {
    right: 0;
  }

  /* Mobile Menu Backdrop */
  .nav::before {
    content: '';
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.4s ease, left 0s 0.4s;
    z-index: -1;
  }

  .nav.active::before {
    left: -100vw;
    opacity: 1;
    transition: opacity 0.4s ease, left 0s;
  }

  /* Mobile Navigation List */
  .nav-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 20px;
    margin: 0;
  }

  .nav-list > li {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column; /* Stack link and dropdown vertically */
    align-items: flex-start;
    width: 100%;
    height: auto; /* Reset fixed height from desktop */
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0,0,0,0.03); /* Separator */
  }

  .nav.active .nav-list > li {
    opacity: 1;
    transform: translateX(0);
  }

  /* Stagger animation for menu items */
  .nav.active .nav-list > li:nth-child(1) { transition-delay: 0.1s; }
  .nav.active .nav-list > li:nth-child(2) { transition-delay: 0.15s; }
  .nav.active .nav-list > li:nth-child(3) { transition-delay: 0.2s; }
  .nav.active .nav-list > li:nth-child(4) { transition-delay: 0.25s; }
  .nav.active .nav-list > li:nth-child(5) { transition-delay: 0.3s; }
  .nav.active .nav-list > li:nth-child(6) { transition-delay: 0.35s; }

  /* Mobile Menu Links */
  .nav-list > li > a {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-main);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 4px;
    width: 100%; /* Ensure full width for click target */
  }

  .nav-list > li > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--color-accent);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
  }

  .nav-list > li > a:hover,
  .nav-list > li > a.active {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1) 0%, rgba(46, 125, 50, 0.05) 100%);
    color: var(--color-accent);
    padding-left: 28px;
  }

  .nav-list > li > a:hover::before,
  .nav-list > li > a.active::before {
    height: 60%;
  }

  /* Mobile Dropdown Styling */
  .dropdown {
    position: relative;
  }

  .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .dropdown-toggle::after {
    content: '›';
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
    margin-left: auto;
  }

  .dropdown.active .dropdown-toggle::after {
    transform: rotate(90deg);
  }

  .dropdown-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    margin: 0;
    background: rgba(46, 125, 50, 0.03);
    border-radius: 8px;
    position: static;
    box-shadow: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
    margin-top: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--color-accent);
    opacity: 0;
    width: 100%;
  }

  .dropdown.active .dropdown-menu {
    display: flex;
    max-height: 600px;
    padding: 8px 0;
    opacity: 1;
  }

  .dropdown-menu li {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    list-style: none;
    width: 100%;
  }

  .dropdown.active .dropdown-menu li {
    opacity: 1;
    transform: translateX(0);
  }

  .dropdown.active .dropdown-menu li:nth-child(1) { transition-delay: 0.1s; }
  .dropdown.active .dropdown-menu li:nth-child(2) { transition-delay: 0.15s; }
  .dropdown.active .dropdown-menu li:nth-child(3) { transition-delay: 0.2s; }
  .dropdown.active .dropdown-menu li:nth-child(4) { transition-delay: 0.25s; }
  .dropdown.active .dropdown-menu li:nth-child(5) { transition-delay: 0.3s; }

  .dropdown-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: var(--color-text-main);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 36px;
    margin: 2px 8px;
    text-decoration: none;
  }

  .dropdown-menu li a::before {
    content: '→';
    position: absolute;
    left: 16px;
    opacity: 0.6;
    transition: all 0.3s ease;
    color: var(--color-accent);
    font-size: 1.1rem;
  }

  .dropdown-menu li a:hover {
    background: rgba(46, 125, 50, 0.12);
    color: var(--color-accent);
    padding-left: 40px;
  }

  .dropdown-menu li a:hover::before {
    opacity: 1;
    left: 18px;
  }

  /* Mobile Header Actions */
  .header-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 20px;
    margin-top: 24px;
    border-top: 2px solid #e9ecef;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease 0.4s;
  }

  .nav.active .header-actions {
    opacity: 1;
    transform: translateY(0);
  }

  .header-actions .action-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #1b5e20 100%);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
  }

  .header-actions .action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
  }

  .header-actions .action-item .action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }

  .header-actions .action-item .action-icon svg {
    width: 20px;
    height: 20px;
  }

  .header-actions .action-item .action-label {
    font-size: 1rem;
  }

  /* WhatsApp specific styling */
  .header-actions .action-item:nth-child(2) {
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  }

  .header-actions .action-item:nth-child(2):hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  }

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 80px 0 30px;
  }

  .nav.active {
    right: 0;
  }
}
