/* Mobile Menu Fixes */

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1000; /* Increased z-index to stay above other elements */
    position: relative;
  }
  
  .menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
  }
  
  /* Menu Overlay */
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
  }
  
  .menu-overlay.active {
    visibility: visible;
    opacity: 1;
  }
  
  /* Add a close button to the mobile menu */
  .menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    z-index: 1001;
    display: none;
  }
  
  /* Mobile Navigation Styles */
  @media (max-width: 991px) {
    .menu-toggle {
      display: flex;
    }
    
    .menu-close {
      display: block;
    }
    
    .nav-menu {
      position: fixed;
      top: 0;
      right: -100%; /* Start off-screen */
      width: 270px; /* Slightly wider for better readability */
      height: 100vh;
      background-color: white;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 70px 30px 40px;
      box-shadow: -2px 0 10px rgba(0,0,0,0.1);
      transition: right 0.3s ease;
      z-index: 99;
      overflow-y: auto; /* Enable scrolling if needed */
    }
    
    .nav-menu.active {
      right: 0;
    }
    
    .nav-menu li {
      margin: 15px 0;
      width: 100%;
      text-align: center;
    }
    
    .nav-link {
      padding: 12px 0;
      margin: 10px 0;
      font-size: 22px;
      display: block;
    }
    
    .nav-link.active::after {
      bottom: 2px; /* Adjust the underline position */
    }
    
    .contact-btn {
      margin: 25px 0 0 0;
      width: 80%;
      text-align: center;
      padding: 15px 20px;
    }
    
    /* Hamburger to X animation */
    .menu-toggle.active span:first-child {
      transform: translateY(9px) rotate(45deg);
    }
    
    .menu-toggle.active span:nth-child(2) {
      opacity: 0;
    }
    
    .menu-toggle.active span:last-child {
      transform: translateY(-9px) rotate(-45deg);
    }
  }
  
  @media (max-width: 576px) {
    .nav-menu {
      width: 85%; /* Wider menu on very small screens */
    }
    
    .nav-link {
      font-size: 20px;
      padding: 10px 0;
    }
  }