/* MOBILE SIDEBAR MENU */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
  overscroll-behavior: contain;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, rgba(0,26,77,0.98) 0%, rgba(0,48,135,0.98) 50%, rgba(26,58,143,0.98) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 100000;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.mobile-menu-nav {
  padding: 1rem 0;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: all .3s ease;
  border-left: 3px solid transparent;
  opacity: 0;
  transform: translateX(-20px);
}

.mobile-menu-overlay.active .mobile-menu-link {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu-link i:first-child {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  color: #93c5fd;
}

.mobile-menu-link span {
  flex: 1;
  font-size: .9rem;
}

.mobile-menu-link i:last-child {
  font-size: .7rem;
  opacity: .5;
  transition: all .3s ease;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
  background: rgba(255,255,255,.1);
  border-left-color: #C8102E;
}

.mobile-menu-link:hover i:last-child {
  opacity: 1;
  transform: translateX(3px);
}

.mobile-menu-link.active {
  background: rgba(200,16,46,.2);
  border-left-color: #C8102E;
}

.mobile-menu-link.active i:first-child {
  color: #ff6b7a;
}

.mobile-menu-cta {
  margin: 1rem 1.5rem;
  background: linear-gradient(135deg, #C8102E, #a50d24);
  border-radius: 8px;
  border-left: none;
  box-shadow: 0 4px 15px rgba(200,16,46,.4);
}

.mobile-menu-cta:hover {
  background: linear-gradient(135deg, #a50d24, #C8102E);
  box-shadow: 0 6px 20px rgba(200,16,46,.6);
}

.mobile-menu-cta i:first-child {
  color: #fff;
}

/* Hamburger Icon Styling */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  position: relative;
  z-index: 100001;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.hamburger-icon.active span:nth-child(1) {
  transform: translateY(7.75px) rotate(45deg);
}

.hamburger-icon.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-icon.active span:nth-child(3) {
  transform: translateY(-7.75px) rotate(-45deg);
}

/* Navbar Toggler Button */
.navbar-toggler {
  padding: 0.5rem;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  position: relative;
  z-index: 100001;
}

.navbar-toggler:focus,
.navbar-toggler:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Hide on desktop */
@media (min-width: 992px) {
  .mobile-menu-overlay,
  .hamburger-icon {
    display: none !important;
  }
  .navbar-toggler {
    display: none !important;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100vh;
}


/* ========== MOBILE MENU CRITICAL FIXES ========== */

/* Ensure navbar toggler is always visible on mobile */
@media (max-width: 991.98px) {
  .navbar-toggler {
    display: block !important;
    position: relative;
    z-index: 100001;
    background: transparent;
    border: none;
    padding: 0.5rem;
    margin: 0;
  }
  
  .navbar-collapse {
    display: none !important;
  }
  
  /* Ensure hamburger is clickable */
  #hamburgerToggle {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  /* Mobile menu must be above everything */
  .mobile-menu-overlay {
    z-index: 99999 !important;
  }
  
  .mobile-menu-content {
    z-index: 100000 !important;
  }
  
  .hamburger-icon {
    z-index: 100001 !important;
  }
}

/* Prevent scroll issues on iOS */
.mobile-menu-content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Smooth animations */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu-overlay,
  .mobile-menu-content,
  .hamburger-icon span {
    transition: none !important;
  }
}
