/* ================================================
   FANCY MOBILE MENU STYLES
   Animated hamburger icon with full-screen overlay
   ================================================ */

/* Animated Hamburger Button */
.mobile-menu-toggle {
  display: none; /* Hidden by default, shown on mobile */
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 10001;
  position: relative;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

/* Show only on mobile (below xl breakpoint) */
@media (max-width: 1199px) {
  .mobile-menu-toggle {
    display: flex;
    /* Push hamburger inward to align with X close button (38px - 24px container padding = 14px) */
    margin-right: 14px;
  }

  /* Hide default Bootstrap toggler */
  .navbar-toggler {
    display: none !important;
  }
}

/* Hamburger Lines */
.hamburger-line {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--brand);
  border-radius: 3px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

/* Animated state when menu is open */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Full-Screen Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 5px;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #3B7DC4 0%, #2E6DB0 35%, #2563A8 65%, #1C5499 100%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* Allow clicks through when hidden */
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbar but keep scroll functionality */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari, Opera */
.mobile-menu-overlay::-webkit-scrollbar {
  display: none;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Enable clicks when visible */
}

/* Mobile Menu Header - aligns with menu content */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
  /* Left matches content (34px), right aligns X with chevrons (nav-link has 50px right padding) */
  padding: 8px 38px 8px 24px;
}

.mobile-menu-logo img {
  height: 50px;
  width: 119px; /* Match navbar logo exactly */
}

/* Close Button - match hamburger button size (44px) exactly */
.mobile-menu-close {
  background: transparent;
  border: none;
  color: var(--brand);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  padding: 8px; /* Match hamburger padding */
}

.mobile-menu-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Mobile Menu Content */
.mobile-menu-content {
  flex: 1;
  padding: 15px 0 30px;
  overflow-y: auto;
  /* Hide scrollbar but keep scroll functionality */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.mobile-menu-content::-webkit-scrollbar {
  display: none;
}

/* Mobile Menu Navigation */
.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateX(-30px);
  animation: slideInLeft 0.5s ease forwards;
}

.mobile-nav-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-nav-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 50px 18px 34px;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: background 0.3s ease;
}

.mobile-nav-link:hover {
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-link i {
  font-size: 20px;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.mobile-nav-link:hover i {
  opacity: 1;
}

/* Expandable Submenus */
.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.mobile-submenu.expanded {
  max-height: 2000px; /* Large enough for content */
}

.mobile-submenu-list {
  list-style: none;
  padding: 10px 34px;
  margin: 0;
}

.mobile-submenu-item {
  margin: 0;
}

.mobile-submenu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Reduced left padding so text aligns with submenu headers (icon extends left) */
  padding: 12px 30px 12px 20px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.3s ease;
}

.mobile-submenu-link:hover {
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-submenu-link i {
  font-size: 18px;
  opacity: 0.7;
}

/* Submenu Headings (for megamenu sections) */
.mobile-submenu-heading {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 10px 0;
  padding-left: 50px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Chevron Arrow for Expandable Items */
.mobile-nav-chevron {
  transition: transform 0.3s ease;
  transform-origin: center center;
  /* Fixed width prevents position shift when rotating */
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-nav-item.expanded .mobile-nav-chevron {
  transform: rotate(180deg);
}

/* First submenu item needs margin compensation for Bootstrap icon asymmetry */
.mobile-nav-item:first-child.expanded .mobile-nav-chevron {
  margin-right: -14px;
}

/* CTA Button in Mobile Menu */
.mobile-menu-cta {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  position: sticky;
  bottom: 0;
  backdrop-filter: blur(10px);
}

.mobile-menu-cta .btn {
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 600;
  background: white;
  color: var(--brand);
  border: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.mobile-menu-cta .btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
  overflow: hidden;
  /* Hide any residual scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body.mobile-menu-open::-webkit-scrollbar {
  display: none;
}


/* Hide mobile menu on desktop */
@media (min-width: 1200px) {
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* Mobile Menu on Small Phones */
@media (max-width: 480px) {
  .mobile-nav-link {
    font-size: 1rem;
  }

  .mobile-submenu-link {
    font-size: 0.9rem;
  }
}
