/**
 * RAPIWEB by Niarux — assets/css/menu_estilo.css v3.0
 * Sesión 25
 *
 * Extiende el nav de web.css con:
 *   - 3 modos de nav: flotante | fija | hamburger
 *   - 5 comportamientos de scroll: siempre | ocultar | transparente | fade | relativo
 *   - Posición del burger: izquierda | derecha | centro
 *   - Apertura móvil: dropdown | fullscreen | lateral-izquierda | lateral-derecha
 *   - Efecto hover: subrayado | fondo | punto | ninguno
 *   - Altura: compacto | normal | grande
 *   - Megamenú con submenús dropdown
 *
 * REGLA: NO modifica web.css. Actúa con data-* en <nav id="rwNav">.
 * REGLA: Los !important de fija/hamburger DEBEN ser anulados por
 *        data-nav-scroll="transparente" y data-nav-scroll="relativo".
 */

/* ============================================================
   MODO: FLOTANTE (default)
   web.css cubre la base. Aquí solo overrides específicos.
   ============================================================ */
[data-nav-estilo="flotante"] {
  /* Hereda todo de web.css */
}

/* ============================================================
   MODO: FIJA — barra sólida siempre visible
   ============================================================ */
[data-nav-estilo="fija"].rw-nav {
  background: rgba(var(--rw-fondo-rgb, 11,13,20), 0.97) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.07);
}
[data-tema="claro"] [data-nav-estilo="fija"].rw-nav,
[data-tema="claro"][data-nav-estilo="fija"].rw-nav {
  background: rgba(255,255,255,0.97) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

/* ============================================================
   MODO: HAMBURGER — drawer lateral (desktop)
   ============================================================ */
@media (min-width: 769px) {
  [data-nav-estilo="hamburger"] .rw-nav-links {
    display: none !important;
  }
  [data-nav-estilo="hamburger"] .rw-burger {
    display: flex !important;
  }
  [data-nav-estilo="hamburger"].rw-nav {
    background: rgba(var(--rw-fondo-rgb, 11,13,20), 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.07);
  }
  [data-tema="claro"] [data-nav-estilo="hamburger"].rw-nav {
    background: rgba(255,255,255,0.97) !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
  }
}

/* ============================================================
   COMPORTAMIENTO SCROLL — FIX BUG 1 + BUG 2
   Estas reglas tienen mayor especificidad que los modos fija/hamburger.
   "transparente" y "relativo" deben anular el !important de arriba.
   ============================================================ */

/* ── TRANSPARENTE: arranca sin fondo, aunque sea modo fija ── */
[data-nav-scroll="transparente"].rw-nav {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}
/* Cuando ya scrolleó → .scrolled toma el control (M08 quita el override inline) */

/* ── RELATIVO: nav no es fixed, va con el flujo de la página ─ */
[data-nav-scroll="relativo"].rw-nav {
  position: relative !important;
  top: auto !important;
  /* Sin fondo especial — hereda lo que tenga */
}
/* En relativo el scroll nunca aplica — no tiene sentido visualmente */
[data-nav-scroll="relativo"].rw-nav.scrolled {
  background: transparent;
  box-shadow: none;
}

/* ── FADE: empieza semitransparente, sólido al scrollear ──── */
/* El JS maneja la opacidad inline — aquí solo aseguramos transición suave */
[data-nav-scroll="fade"].rw-nav {
  transition: background 0.35s ease, box-shadow 0.35s ease,
              opacity 0.35s ease, transform 0.3s ease !important;
}

/* ── MODO CLARO + TRANSPARENTE ───────────────────────────── */
[data-tema="claro"] [data-nav-scroll="transparente"].rw-nav,
[data-tema="claro"][data-nav-scroll="transparente"].rw-nav {
  background: transparent !important;
  box-shadow: none !important;
}

/* ============================================================
   DRAWER LATERAL (hamburger desktop)
   ============================================================ */
.rw-drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100dvh;
  background: rgba(var(--rw-fondo-rgb, 11,13,20), 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
  will-change: left;
}
.rw-drawer.open {
  left: 0;
  box-shadow: 4px 0 32px rgba(0,0,0,0.4);
}
.rw-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--nav-h, 64px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.rw-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.rw-drawer-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.rw-drawer-nombre {
  font-family: var(--fuente-titulo);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--rw-texto);
  letter-spacing: -0.3px;
}
.rw-drawer-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  font-size: 1.1rem;
  transition: all 0.2s;
  line-height: 1;
}
.rw-drawer-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--rw-texto);
}
.rw-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rw-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  transition: all 0.18s;
}
.rw-drawer-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
}
.rw-drawer-link:hover,
.rw-drawer-link.active {
  background: rgba(255,255,255,0.07);
  color: var(--rw-texto);
  padding-left: 20px;
}
.rw-drawer-link.active {
  background: color-mix(in srgb, var(--rw-primario) 15%, transparent);
  color: var(--rw-primario);
}
/* Subitems en drawer */
.rw-drawer-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0 4px 28px;
}
.rw-drawer-sublink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: all 0.15s;
}
.rw-drawer-sublink:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
}
.rw-drawer-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 0.75rem;
  transition: transform 0.2s ease, color 0.2s;
  line-height: 1;
}
.rw-drawer-toggle.open {
  transform: rotate(180deg);
  color: var(--rw-primario);
}
.rw-drawer-sub-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}
.rw-drawer-sub-wrap.open {
  max-height: 400px;
}
.rw-drawer-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.rw-drawer-footer .rw-btn-wa,
.rw-drawer-footer .rw-btn {
  width: 100%;
  justify-content: center;
}
.rw-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.rw-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Modo claro — drawer */
[data-tema="claro"] .rw-drawer {
  background: rgba(255,255,255,0.98);
  border-right-color: rgba(0,0,0,0.08);
}
[data-tema="claro"] .rw-drawer-nombre { color: #111827; }
[data-tema="claro"] .rw-drawer-close  { color: #6b7280; }
[data-tema="claro"] .rw-drawer-close:hover { background: rgba(0,0,0,0.06); color: #111; }
[data-tema="claro"] .rw-drawer-link   { color: #374151; }
[data-tema="claro"] .rw-drawer-link:hover,
[data-tema="claro"] .rw-drawer-link.active { background: rgba(0,0,0,0.05); color: #111827; }
[data-tema="claro"] .rw-drawer-link.active {
  background: color-mix(in srgb, var(--rw-primario) 10%, transparent);
  color: var(--rw-primario);
}
[data-tema="claro"] .rw-drawer-sublink { color: #6b7280; }
[data-tema="claro"] .rw-drawer-sublink:hover { background: rgba(0,0,0,0.04); color: #374151; }
[data-tema="claro"] .rw-drawer-toggle  { color: #9ca3af; }
[data-tema="claro"] .rw-drawer-header,
[data-tema="claro"] .rw-drawer-footer { border-color: rgba(0,0,0,0.08); }

/* ── Lateral derecha ───────────────────────────────────────── */
.rw-drawer.desde-derecha {
  left: auto;
  right: -300px;
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  transition: right 0.28s cubic-bezier(0.4,0,0.2,1);
}
.rw-drawer.desde-derecha.open {
  right: 0;
  left: auto;
  box-shadow: -4px 0 32px rgba(0,0,0,0.4);
}
[data-tema="claro"] .rw-drawer.desde-derecha {
  border-left-color: rgba(0,0,0,0.08);
  border-right: none;
}

/* ── Drawer responsive — ancho adaptado en móvil ─────────── */
@media (max-width: 480px) {
  .rw-drawer {
    width: min(320px, 88vw);
    left: calc(-1 * min(320px, 88vw));
  }
  .rw-drawer.open { left: 0; }
  .rw-drawer.desde-derecha {
    width: min(320px, 88vw);
    right: calc(-1 * min(320px, 88vw));
    left: auto;
  }
  .rw-drawer.desde-derecha.open { right: 0; left: auto; }
  /* Links del drawer más grandes en móvil para mejor toque */
  .rw-drawer-link {
    padding: 13px 18px;
    font-size: 1rem;
  }
  .rw-drawer-sublink {
    padding: 10px 16px;
    font-size: 0.92rem;
  }
}

/* ============================================================
   POSICIÓN DEL BURGER — nav_burger_posicion
   Aplica en móvil (≤768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Derecha (default) */
  [data-burger-pos="derecha"] .rw-nav-brand { margin-right: auto; }
  [data-burger-pos="derecha"] .rw-burger    { margin-left: auto; }

  /* Izquierda */
  [data-burger-pos="izquierda"] { flex-direction: row-reverse; }
  [data-burger-pos="izquierda"] .rw-nav-brand { margin-left: auto; }
  [data-burger-pos="izquierda"] .rw-burger    { margin-right: auto; margin-left: 0; }

  /* Centro */
  [data-burger-pos="centro"] {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  [data-burger-pos="centro"] .rw-nav-brand { justify-self: start; }
  [data-burger-pos="centro"] .rw-burger    { justify-self: center; }
  [data-burger-pos="centro"] .rw-nav-links,
  [data-burger-pos="centro"] .rw-nav-cta,
  [data-burger-pos="centro"] .rw-btn-wa,
  [data-burger-pos="centro"] .rw-nav-tema  { display: none !important; }
}

/* ============================================================
   ESTILO DE APERTURA MÓVIL — nav_mobile_estilo
   ============================================================ */

/* ── FULLSCREEN ──────────────────────────────────────────── */
.rw-mobile-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(var(--rw-fondo-rgb, 11,13,20), 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.rw-mobile-fullscreen.open {
  opacity: 1;
  pointer-events: all;
}
.rw-mobile-fullscreen .rw-fs-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all .2s;
  line-height: 1;
}
.rw-mobile-fullscreen .rw-fs-close:hover {
  color: var(--rw-texto);
  background: rgba(255,255,255,0.08);
}
.rw-mobile-fullscreen .rw-fs-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 340px;
  padding: 0 24px;
}
.rw-mobile-fullscreen .rw-fs-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.18s;
  letter-spacing: -0.2px;
}
.rw-mobile-fullscreen .rw-fs-link:hover,
.rw-mobile-fullscreen .rw-fs-link.active {
  background: rgba(255,255,255,0.07);
  color: var(--rw-texto);
}
.rw-mobile-fullscreen .rw-fs-link.active {
  color: var(--rw-primario);
  background: color-mix(in srgb, var(--rw-primario) 12%, transparent);
}
/* Subitems fullscreen */
.rw-mobile-fullscreen .rw-fs-sub {
  width: 100%;
  display: none;
  flex-direction: column;
  padding: 4px 0 4px 16px;
  gap: 2px;
}
.rw-mobile-fullscreen .rw-fs-sub.open { display: flex; }
.rw-mobile-fullscreen .rw-fs-sublink {
  display: block;
  padding: 9px 16px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  border-radius: 9px;
  text-align: center;
  transition: all 0.15s;
}
.rw-mobile-fullscreen .rw-fs-sublink:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
}
.rw-mobile-fullscreen .rw-fs-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 20px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 12px;
}
.rw-mobile-fullscreen .rw-fs-footer .rw-btn-wa,
.rw-mobile-fullscreen .rw-fs-footer .rw-btn { width: 100%; justify-content: center; }

/* Modo claro fullscreen */
[data-tema="claro"] .rw-mobile-fullscreen { background: rgba(255,255,255,0.98); }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-link { color: #374151; }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-link:hover,
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-link.active { background: rgba(0,0,0,0.05); color: #111827; }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-link.active { color: var(--rw-primario); }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-sublink { color: #9ca3af; }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-sublink:hover { color: #374151; background: rgba(0,0,0,0.04); }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-footer { border-top-color: rgba(0,0,0,0.08); }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-close { color: #6b7280; }
[data-tema="claro"] .rw-mobile-fullscreen .rw-fs-close:hover { color: #111; background: rgba(0,0,0,0.06); }

/* ============================================================
   EFECTO HOVER EN LINKS — nav_hover_efecto
   ============================================================ */

/* Base: transición suave */
.rw-nav-link {
  position: relative;
  transition: color 0.18s ease;
}

/* ── SUBRAYADO ──────────────────────────────────────────── */
[data-hover-efecto="subrayado"] .rw-nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--rw-primario);
  border-radius: 2px;
  transition: left 0.22s ease, right 0.22s ease;
}
[data-hover-efecto="subrayado"] .rw-nav-link:hover::after,
[data-hover-efecto="subrayado"] .rw-nav-link.active::after {
  left: 0; right: 0;
}
[data-hover-efecto="subrayado"] .rw-nav-link:hover,
[data-hover-efecto="subrayado"] .rw-nav-link.active { color: var(--rw-primario); }

/* ── FONDO ──────────────────────────────────────────────── */
[data-hover-efecto="fondo"] .rw-nav-link {
  padding: 5px 12px;
  border-radius: 7px;
  transition: background 0.18s ease, color 0.18s ease;
}
[data-hover-efecto="fondo"] .rw-nav-link:hover {
  background: rgba(var(--rw-primario-rgb, 99,102,241), 0.12);
  color: var(--rw-primario);
}
[data-hover-efecto="fondo"] .rw-nav-link.active {
  background: var(--rw-primario);
  color: #fff !important;
}

/* ── PUNTO ──────────────────────────────────────────────── */
[data-hover-efecto="punto"] .rw-nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 5px;
  height: 5px;
  background: var(--rw-primario);
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
[data-hover-efecto="punto"] .rw-nav-link:hover::after,
[data-hover-efecto="punto"] .rw-nav-link.active::after {
  transform: translateX(-50%) scale(1);
}
[data-hover-efecto="punto"] .rw-nav-link:hover,
[data-hover-efecto="punto"] .rw-nav-link.active { color: var(--rw-primario); }

/* ── NINGUNO ────────────────────────────────────────────── */
[data-hover-efecto="ninguno"] .rw-nav-link:hover  { color: var(--rw-texto); opacity: 0.75; }
[data-hover-efecto="ninguno"] .rw-nav-link.active { color: var(--rw-texto); opacity: 1; }

/* No aplicar hover effects en botones CTA / botón WA */
[data-hover-efecto] .rw-nav-btn::after,
[data-hover-efecto] .rw-nav-dest::after { display: none !important; }
[data-hover-efecto] .rw-nav-btn { padding: 5px 14px !important; }

/* No aplicar en chevrons de megamenú */
[data-hover-efecto] .rw-nav-has-sub > .rw-nav-link::after {
  /* El ::after del hover no debe aparecer debajo del padre del megamenú */
  /* Solo aplica si no hay submenú: se gestiona con clase .rw-nav-has-sub */
}

/* Modo claro — hover */
[data-tema="claro"][data-hover-efecto="fondo"] .rw-nav-link:hover {
  background: rgba(var(--rw-primario-rgb, 99,102,241), 0.1);
}
[data-tema="claro"][data-hover-efecto="fondo"] .rw-nav-link.active {
  background: var(--rw-primario);
  color: #fff !important;
}
[data-tema="claro"][data-hover-efecto="ninguno"] .rw-nav-link:hover { opacity: 0.65; }

/* ============================================================
   ALTURA DEL NAV — nav_altura
   ============================================================ */
[data-nav-altura="compacto"].rw-nav { --nav-h: 52px; min-height: 52px; }
[data-nav-altura="normal"].rw-nav   { --nav-h: 64px; min-height: 64px; }
[data-nav-altura="grande"].rw-nav   { --nav-h: 80px; min-height: 80px; }

/* ============================================================
   MODO CLARO — ajustes generales del nav
   ============================================================ */