/* ============================================================
   RELEVANTE.IA — P01 · NAVEGACIÓN
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur-base) ease;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 72px;
  transition: height var(--dur-base) ease-out;
}
.nav.esta-contraida { background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nav.esta-contraida .nav__inner { height: 56px; }

/* Wordmark */
.marca {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.marca__flecha { width: 23px; height: 20px; color: var(--accent); }
.marca__nombre {
  font-family: var(--font-brand);
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* Menú desktop */
.nav__menu { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav__item { position: relative; }
.nav__enlace {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  padding-block: 8px;
  position: relative;
}
.nav__enlace::after {
  content: "";
  position: absolute;
  left: 0; bottom: 2px;
  height: 1px; width: 0;
  background: var(--ink);
  transition: width 200ms var(--ease-out);
}
.nav__enlace:hover::after,
.nav__item[data-abierto="true"] > .nav__enlace::after,
.nav__enlace[aria-current="page"]::after { width: 100%; }

.nav__chevron { width: 10px; height: 10px; transition: transform 200ms var(--ease-out); }
.nav__item[data-abierto="true"] .nav__chevron { transform: rotate(180deg); }

/* Desplegable */
.nav__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms var(--ease-out), visibility 150ms;
}
.nav__item[data-abierto="true"] .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav__panel a {
  display: block;
  font-size: 14px;
  padding: 10px 16px;
  white-space: nowrap;
}
.nav__panel a:hover { background: #F5F5F5; }

.nav__cta { flex-shrink: 0; }

/* Hamburguesa */
.nav__burger {
  display: none;
  width: 40px; height: 40px;
  position: relative;
  flex-shrink: 0;
}
.nav__burger span {
  position: absolute;
  left: 10px;
  width: 20px; height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-base) var(--ease-out), top var(--dur-base) var(--ease-out);
}
.nav__burger span:nth-child(1) { top: 16px; }
.nav__burger span:nth-child(2) { top: 23px; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

/* Overlay móvil */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 56px;
  background: var(--bg);
  z-index: var(--z-overlay);
  overflow-y: auto;
  padding: 32px var(--gutter) 24px;
  flex-direction: column;
}
.nav__overlay.esta-abierto { display: flex; }
.nav__overlay-lista { flex: 1; }
.nav__overlay-lista > li { border-bottom: 1px solid var(--rule); }
.nav__overlay-lista a.nivel-1,
.nav__overlay-lista button.nivel-1 {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-h3);
  font-weight: 500;
  padding-block: 18px;
  text-align: left;
}
.nav__overlay-sub { overflow: hidden; height: 0; transition: height var(--dur-base) var(--ease-out); }
.nav__overlay-sub a { display: block; font-size: 16px; color: var(--muted); padding: 10px 0 10px 16px; }
.nav__overlay-cta { padding-top: 24px; }
.nav__overlay-cta .boton { width: 100%; justify-content: center; }

@media (max-width: 1023px) {
  .nav__menu, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .nav__inner { height: 56px; gap: 14px; }
  .nav__idiomas { margin-left: auto; }
}

body.overlay-abierto { overflow: hidden; }
/* el backdrop-filter de la nav contraída convierte al header en contenedor
   del overlay fijo y lo atrapa dentro de la barra: con el menú abierto, fuera filtro */
body.overlay-abierto .nav,
body.overlay-abierto .nav.esta-contraida {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--bg);
}

/* Selector de idioma */
.nav__item--idioma { order: 99; }
.nav__idiomas { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; }
.nav__idioma-actual { font-size: 13px; letter-spacing: 0.08em; font-weight: 600; }
.nav__idioma-sep { font-size: 13px; opacity: 0.35; }
.nav__idioma { font-size: 13px; letter-spacing: 0.08em; opacity: 0.55; }
.nav__idioma:hover { opacity: 1; }
.nav__idioma:hover { opacity: 1; }

/* Banner de consentimiento de cookies */
.cookies { position: fixed; left: 20px; bottom: 20px; z-index: 90; max-width: 420px; background: #0A0A0A; color: #FFFFFF; padding: 18px 20px; box-shadow: 0 12px 40px rgba(10, 10, 10, 0.25); }
.cookies__texto { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.cookies__enlace { color: #DDF50A; text-decoration: underline; }
.cookies__botones { display: flex; gap: 10px; justify-content: flex-end; }
.cookies__boton { font: inherit; font-size: 14px; padding: 9px 18px; cursor: pointer; border: 1px solid #FFFFFF; background: transparent; color: #FFFFFF; }
.cookies__boton--si { background: #DDF50A; border-color: #DDF50A; color: #0A0A0A; font-weight: 600; }
.cookies__boton--si:hover { filter: brightness(0.94); }
.cookies__boton--no:hover { background: rgba(255, 255, 255, 0.1); }
