/**
 * Mobile Menu - Slide-In Sidebar
 * Clear tap targets and simple hierarchy
 */

/* Hamburger button - visible on mobile */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  color: #1f2937;
  border-radius: 0.75rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(19, 127, 236, 0.25);
  z-index: 60;
}

.menu-toggle:active,
.menu-toggle:focus-visible {
  outline: none;
  border-color: #137fec;
  color: #137fec;
}

/* Hide hamburger on desktop (768px = Tailwind md breakpoint) */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}

/* Full-page mobile menu overlay */
.mobile-menu-overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9999;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* When menu is open */
.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Close button */
.menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.menu-close:active,
.menu-close:focus-visible {
  color: #137fec;
  border-color: #137fec;
}

/* Menu container */
.mobile-menu-content {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(88vw, 360px);
  background: #ffffff;
  padding: 4.5rem 1.5rem 2rem 1.5rem;
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

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

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

/* Menu items */
.mobile-menu-list > li {
  margin: 0;
  border-bottom: 1px solid #e5e7eb;
}

/* Menu links */
.mobile-menu-list a {
  display: block;
  padding: 0.95rem 0;
  color: #111827;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.mobile-menu-list a:active {
  color: #137fec;
}

/* Submenu parent */
.has-submenu > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

/* Submenu toggle arrow */
.submenu-toggle {
  font-size: 0.9rem;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.has-submenu.open .submenu-toggle {
  transform: rotate(180deg);
}

/* Submenu */
.submenu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.75rem 0.75rem;
  background: #f9fafb;
  border-left: 2px solid #e5e7eb;
}

.has-submenu.open .submenu {
  display: block;
}

/* Submenu links */
.submenu a {
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.65rem 0;
  color: #4b5563;
}

.submenu a:active {
  color: #137fec;
}

/* CTA link inside menu */
.mobile-menu-cta {
  display: block;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  background: #137fec;
  color: #ffffff;
  text-align: center;
  border-radius: 0.75rem;
  font-weight: 700;
}

.mobile-menu-cta:active,
.mobile-menu-cta:focus-visible {
  background: #0f6ed0;
}

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