/*
  NOA Tecnología — Menú Móvil Custom
  Completamente independiente de Bootstrap collapse.
  Funciona en cualquier celular/tablet.
*/

/* =============================================
   NAVBAR BASE (desktop + mobile)
   ============================================= */
.noa-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* =============================================
   BOTONES DEL LADO DERECHO (WA + hamburger)
   ============================================= */
.noa-nav-right {
  display: none; /* oculto en desktop */
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* =============================================
   BOTÓN HAMBURGUESA — 44×44px tap target
   ============================================= */
.noa-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: rgba(232, 168, 74, 0.1);
  border: 1.5px solid rgba(232, 168, 74, 0.45);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.noa-hamburger:hover,
.noa-hamburger:focus {
  background: rgba(232, 168, 74, 0.2);
  border-color: rgba(232, 168, 74, 0.7);
  outline: none;
}

.noa-hamburger:focus-visible {
  outline: 2px solid #e8a84a;
  outline-offset: 3px;
}

.noa-ham-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #e8a84a;
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Estado activo (X) */
.noa-hamburger.is-active .noa-ham-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.noa-hamburger.is-active .noa-ham-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.noa-hamburger.is-active .noa-ham-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   OVERLAY OSCURO
   ============================================= */
.noa-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}

.noa-menu-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* =============================================
   PANEL DEL MENÚ MÓVIL
   FIX CRÍTICO: fondo oscuro para que el texto
   blanco sea visible (antes era #f5f0e8 = crema)
   ============================================= */
.noa-mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(88vw, 340px);
  height: 100%;
  height: 100dvh;
  /* FONDO OSCURO: contraste correcto con texto blanco */
  background: #0f2319;
  border-left: 1px solid rgba(232, 168, 74, 0.25);
  z-index: 2100;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.noa-mobile-panel.is-open {
  transform: translateX(0);
}

/* ─── Cabecera del panel ──────────────────── */
.noa-mobile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(232, 168, 74, 0.15);
  flex-shrink: 0;
}

.noa-mobile-panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.noa-mobile-panel-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.noa-mobile-panel-brand span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.noa-mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(232, 168, 74, 0.1);
  border: 1px solid rgba(232, 168, 74, 0.25);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.noa-mobile-close:hover {
  background: rgba(232, 168, 74, 0.2);
  color: #e8a84a;
}

/* ─── Scroll area ─────────────────────────── */
.noa-mobile-panel-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0 24px;
  display: flex;
  flex-direction: column;
}

/* Scrollbar estilizado */
.noa-mobile-panel-inner::-webkit-scrollbar { width: 4px; }
.noa-mobile-panel-inner::-webkit-scrollbar-track { background: transparent; }
.noa-mobile-panel-inner::-webkit-scrollbar-thumb {
  background: rgba(232, 168, 74, 0.3);
  border-radius: 4px;
}

/* =============================================
   LISTA DE NAVEGACIÓN MÓVIL
   ============================================= */
.noa-mobile-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

/* Links principales */
.noa-mobile-nav > li > a {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.90);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent;
}

.noa-mobile-nav > li > a:hover,
.noa-mobile-nav > li > a:active {
  background: rgba(232, 168, 74, 0.10);
  color: #e8a84a;
  border-left-color: #e8a84a;
}

.noa-mobile-nav > li > a.active-link {
  color: #e8a84a;
  border-left-color: #e8a84a;
  background: rgba(232, 168, 74, 0.08);
}

/* Etiqueta de sección (no es link) */
.noa-mobile-section-label {
  padding: 14px 20px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(232, 168, 74, 0.55);
  pointer-events: none;
  user-select: none;
}

/* Sub-items (cursos) — texto más claro, no blanco invisible */
.noa-mobile-sub > a {
  padding: 10px 20px 10px 36px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.70) !important;
  border-left: 3px solid transparent;
}

.noa-mobile-sub > a:hover,
.noa-mobile-sub > a:active {
  color: #e8a84a !important;
  background: rgba(232, 168, 74, 0.08) !important;
  border-left-color: rgba(232, 168, 74, 0.4) !important;
}

/* =============================================
   BOTÓN CTA WHATSAPP AL PIE DEL MENÚ
   ============================================= */
.noa-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 16px 0;
  padding: 14px 20px;
  background: linear-gradient(135deg, #e8a84a, #10b981);
  color: #fff !important;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  letter-spacing: 0.3px;
  border: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.noa-mobile-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #fff !important;
}

.noa-mobile-cta:active {
  transform: scale(0.98);
}

/* =============================================
   DIVISOR en el menú
   ============================================= */
.noa-mobile-divider {
  height: 1px;
  background: rgba(232, 168, 74, 0.12);
  margin: 6px 20px;
}

/* =============================================
   MÓVIL: mostrar hamburger, ocultar links desktop
   ============================================= */
@media (max-width: 991px) {
  .noa-nav-right {
    display: flex;
  }

  /* En mobile: el bloque de links desktop se oculta */
  #navbarNav {
    display: none !important;
  }
}

/* En desktop: ocultar hamburger y panel móvil */
@media (min-width: 992px) {
  .noa-hamburger {
    display: none !important;
  }

  .noa-mobile-panel,
  .noa-menu-overlay {
    display: none !important;
  }

  #navbarNav {
    display: flex !important;
    align-items: center;
  }
}

/* =============================================
   SAFE AREA para iPhone X+ (muesca/barra inferior)
   ============================================= */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .noa-mobile-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
