/* Jai Five — componentes de página: nav isla, menú móvil, chips flotantes, marquesina, FAQ,
   newsletter, pie y "saltar". Dueño: agente página. Solo tokens de tokens.css. Ver ../ARQUITECTURA.md §8 */

/* Animaciones propias de la página (prefijo pag- para no chocar con motion.css).
   Se animan las propiedades individuales translate/scale: no pisan el transform que escribe GSAP. */
@keyframes pag-flotar { from { translate: 0 0; } to { translate: 0 -12px; } }
@keyframes pag-flotar-chip { from { translate: 0 0; } to { translate: 0 -7px; } }
@keyframes pag-respirar { from { translate: 0 0; scale: 1; } to { translate: -4% 5%; scale: 1.14; } }

/* ============================================================
   Nav isla: píldora de vidrio fija, separada del borde superior
   ============================================================ */
.nav {
  --nav-alfa: .55;
  position: fixed; z-index: var(--z-nav);
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: max(var(--frame), 10px); right: max(var(--frame), 10px);
  max-width: 1120px; margin-inline: auto;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 8px 0 16px;
  color: var(--c-blanco);
  transition: height var(--d-base) var(--ease-out);
}
/* El vidrio vive en un pseudo: así ni el blur ni un transform convierten a la nav
   en bloque contenedor del menú fijo de celular. */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: var(--r-btn);
  background: rgb(var(--rgb-noche) / var(--nav-alfa));
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--sh-hair), var(--sh-top), var(--sh-soft);
  transition: background-color var(--d-base) var(--ease-out), box-shadow var(--d-base) var(--ease-out);
}
html[data-scrolled] .nav { --nav-alfa: .76; height: 56px; }
html[data-scrolled] .nav::before { box-shadow: var(--sh-hair), var(--sh-top), var(--sh-deep); }

/* Marca: jai en oro + nombre condensado */
.marca {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 6px; border-radius: var(--r-btn);
}
.marca-heb {
  font-family: var(--f-heb); font-weight: 900; font-size: 27px; line-height: 1;
  background: var(--g-oro); -webkit-background-clip: text; background-clip: text; color: transparent;
  translate: 0 -2px;
}
.marca-texto { font-weight: 800; font-size: 19px; letter-spacing: -.02em; font-variation-settings: var(--wdth-tight); }

/* Menú: en celular es un overlay de vidrio a pantalla completa (la nav no tiene transform ni filter,
   por eso este fixed sí es respecto de la ventana) */
.nav-menu {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: calc(var(--nav-h) + 40px + env(safe-area-inset-top, 0px)) var(--gutter) calc(48px + env(safe-area-inset-bottom, 0px));
  background: rgb(var(--rgb-noche) / .86);
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--d-base) var(--ease-out), visibility 0s var(--d-base);
}
.nav-menu.abierta { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity var(--d-base) var(--ease-out), visibility 0s; }
.nav-menu a {
  position: relative; display: block; min-width: 0;
  padding: 10px 0;
  font-size: clamp(44px, 12vw, 76px); font-weight: 800; line-height: 1.02; letter-spacing: -.02em;
  font-variation-settings: var(--wdth-tight); color: var(--c-blanco);
  opacity: 0; translate: 0 12px;
  transition: opacity var(--d-slow) var(--ease-out), translate var(--d-slow) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.nav-menu.abierta a { opacity: 1; translate: 0 0; }
.nav-menu.abierta a:nth-child(1) { transition-delay: 80ms; }
.nav-menu.abierta a:nth-child(2) { transition-delay: 140ms; }
.nav-menu.abierta a:nth-child(3) { transition-delay: 200ms; }
.nav-menu.abierta a:nth-child(4) { transition-delay: 260ms; }
.nav-menu a[aria-current="true"] { color: var(--c-oro); }
html[data-menu-abierto] { overflow: hidden; }

/* Acciones: carrito blanco con contador en oro + hamburguesa */
.nav-acciones { position: relative; z-index: 2; display: flex; align-items: center; gap: 4px; }
.nav-carrito {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 6px 0 16px; border-radius: var(--r-btn);
  background: var(--c-blanco); color: var(--c-noche);
  font-weight: 700; font-size: 15px; line-height: 1;
  box-shadow: var(--sh-soft);
  transition: transform var(--d-base) var(--ease-out), box-shadow var(--d-base) var(--ease-out);
}
.nav-carrito:hover { box-shadow: var(--sh-oro); }
.nav-carrito:active { transform: scale(.97); }
.nav-contador {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-btn);
  display: grid; place-items: center;
  background: var(--g-oro); color: var(--c-noche);
  font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: 0;
}
.nav-burger {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  transition: background-color var(--d-fast) var(--ease-out);
}
.nav-burger:hover { background: var(--surface-2); }
.nav-burger span {
  position: absolute; left: 50%; top: 50%;
  width: 18px; height: 2px; border-radius: 2px; background: currentColor;
  transition: translate var(--d-base) var(--ease-spring), rotate var(--d-base) var(--ease-spring);
}
.nav-burger span:first-child { translate: -50% calc(-50% - 3.5px); }
.nav-burger span:last-child { translate: -50% calc(-50% + 3.5px); }
.nav-burger[aria-expanded="true"] span:first-child { translate: -50% -50%; rotate: 45deg; }
.nav-burger[aria-expanded="true"] span:last-child { translate: -50% -50%; rotate: -45deg; }

@media (min-width: 760px) {
  .nav { padding: 0 8px 0 18px; }
  .nav-burger { display: none; }
  /* El menú vuelve a ser una fila dentro de la isla */
  .nav-menu, .nav-menu.abierta {
    position: static; inset: auto; z-index: auto;
    flex-direction: row; justify-content: center; gap: 2px; margin-inline: auto; padding: 0;
    background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    opacity: 1; visibility: visible; pointer-events: auto; transition: none;
  }
  .nav-menu a, .nav-menu.abierta a:nth-child(n) {
    padding: 9px 14px; border-radius: var(--r-btn);
    font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: 0; font-variation-settings: normal;
    color: var(--c-niebla); opacity: 1; translate: 0 0; transition-delay: 0s;
    transition: color var(--d-fast) var(--ease-out), background-color var(--d-fast) var(--ease-out);
  }
  .nav-menu a:hover, .nav-menu a[aria-current="true"] { color: var(--c-blanco); background: var(--surface-2); }
  .nav-menu a[aria-current="true"]::after {
    content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; border-radius: 50%;
    background: var(--c-oro); box-shadow: 0 0 8px var(--c-oro); translate: -50% 0;
  }
}

/* ============================================================
   Chips flotantes de la portada: vidrio, sombra suave, flotación escalonada
   ============================================================ */
.chip-flotante {
  position: relative; z-index: 2;
  padding: 10px 14px 10px 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--c-blanco);
  background: rgb(var(--rgb-noche) / .62);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--sh-hair), var(--sh-top), var(--sh-soft);
}
.chip-flotante::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--c-oro); box-shadow: 0 0 10px var(--c-oro);
}
@media (min-width: 1024px) {
  .chip-flotante { position: absolute; animation: pag-flotar-chip 5.2s var(--ease-in-out) infinite alternate; }
  .chip-1 { top: 9%;  left: -4%;  animation-delay: -1.1s; }
  .chip-2 { top: 50%; right: -9%; animation-delay: -2.7s; animation-duration: 6.1s; }
  .chip-3 { bottom: 9%; left: 4%; animation-delay: -4.2s; animation-duration: 5.7s; }
}

/* ============================================================
   Marquesina: franja azul eléctrico enmarcada, dos filas (relleno / contorno)
   La animación la pone motion.css (fallback) o motion.js (GSAP); aquí solo layout.
   ============================================================ */
.marquesina {
  position: relative; overflow: hidden;
  margin: var(--frame) var(--frame) 0;
  padding-block: clamp(18px, 2.4vw, 30px);
  border-radius: var(--r-panel);
  background: var(--c-azul); color: var(--c-talit);
  box-shadow: var(--sh-top);
  display: grid; gap: clamp(2px, .6vw, 8px);
}
.marq-fila {
  display: flex; align-items: center; width: max-content; white-space: nowrap;
  font-size: clamp(38px, 6.2vw, 84px); font-weight: 800; line-height: 1; letter-spacing: -.02em;
  font-variation-settings: var(--wdth-tight); text-transform: uppercase;
}
.marq-fila > span { padding-inline: clamp(14px, 2vw, 28px); }
.marq-fila .sep { padding-inline: 0; font-size: .38em; color: var(--c-oro); translate: 0 -.08em; -webkit-text-stroke: 0; }
.marq-2 > span { color: transparent; -webkit-text-stroke: 1.5px var(--c-talit); }
.marq-2 .sep { color: var(--c-oro); }

/* ============================================================
   FAQ: acordeón con signo + que rota a ×, altura animada con grid-template-rows
   ============================================================ */
.faq { display: grid; border-top: 1px solid var(--hair); min-width: 0; }
.faq-item { border-bottom: 1px solid var(--hair); min-width: 0; }
.faq-item > h3 {
  margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; letter-spacing: normal;
  font-variation-settings: normal; text-wrap: initial;
}
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 0; text-align: left;
  font-size: clamp(18px, 1.7vw, 22px); font-weight: 700; line-height: 1.2; letter-spacing: -.01em;
  font-variation-settings: var(--wdth-mid); color: var(--fg);
  transition: color var(--d-fast) var(--ease-out);
}
.faq-q:hover { color: var(--c-oro); }
.banda-clara .faq-q:hover { color: var(--c-azul-israel); }
/* El "+" se dibuja con dos degradados dentro de un círculo; rota 45° y queda en × */
.faq-q::after {
  content: ""; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat,
    var(--surface-2);
  box-shadow: var(--sh-hair);
  transition: rotate var(--d-base) var(--ease-spring), background-color var(--d-fast) var(--ease-out);
}
.faq-item.abierto .faq-q::after { rotate: 45deg; }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d-base) var(--ease-out); }
.faq-a > div { overflow: hidden; min-height: 0; }
.faq-a p { color: var(--fg-2); max-width: 60ch; padding-bottom: 24px; font-size: 16px; text-wrap: pretty; }
.faq-item.abierto .faq-a { grid-template-rows: 1fr; }

/* ============================================================
   Newsletter: píldora grande con el botón adentro
   ============================================================ */
.nl { display: grid; gap: 12px; width: 100%; max-width: 560px; min-width: 0; }
.nl-aviso { color: var(--c-oro); }
/* En pantallas angostas el campo y el botón se apilan; desde 480 px el botón entra en la píldora */
.nl-campo { display: grid; gap: 10px; min-width: 0; }
.nl-input {
  width: 100%; min-width: 0; padding: 17px 22px; border: 0; border-radius: var(--r-btn);
  background: var(--surface-2); color: var(--fg); font-size: 17px; line-height: 1.2;
  box-shadow: var(--sh-hair), var(--sh-top);
  transition: box-shadow var(--d-base) var(--ease-out);
}
.nl-input::placeholder { color: var(--fg-2); opacity: .8; }
.nl-input:focus { outline: none; }
.nl-input:focus-visible { outline: none; box-shadow: inset 0 0 0 1px rgb(var(--rgb-oro) / .7), 0 0 0 4px rgb(var(--rgb-oro) / .14); }
.nl-campo .btn { justify-content: space-between; }
@media (min-width: 480px) {
  .nl-campo {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 6px 6px 22px; border-radius: var(--r-btn);
    background: var(--surface-2); box-shadow: var(--sh-hair), var(--sh-top);
    transition: box-shadow var(--d-base) var(--ease-out);
  }
  .nl-campo:focus-within { box-shadow: inset 0 0 0 1px rgb(var(--rgb-oro) / .7), 0 0 0 4px rgb(var(--rgb-oro) / .14); }
  .nl-input, .nl-input:focus-visible { flex: 1; padding: 12px 0; background: none; box-shadow: none; border-radius: 0; }
  .nl-campo .btn { flex: none; justify-content: flex-start; }
}
/* Estados: el anillo va en el campo apilado (celular) o en la píldora (desde 480 px), nunca en los dos */
.nl.error .nl-input { box-shadow: inset 0 0 0 1px rgb(229 72 77 / .8), 0 0 0 4px rgb(229 72 77 / .14); }
.nl.ok .nl-input { box-shadow: inset 0 0 0 1px rgb(var(--rgb-oro) / .8), 0 0 0 4px rgb(var(--rgb-oro) / .14); }
@media (min-width: 480px) {
  .nl.error .nl-input, .nl.ok .nl-input { box-shadow: none; }
  .nl.error .nl-campo { box-shadow: inset 0 0 0 1px rgb(229 72 77 / .8), 0 0 0 4px rgb(229 72 77 / .14); }
  .nl.ok .nl-campo { box-shadow: inset 0 0 0 1px rgb(var(--rgb-oro) / .8), 0 0 0 4px rgb(var(--rgb-oro) / .14); }
}
.nl-error, .nl-ok { font-size: 15px; font-weight: 600; line-height: 1.4; }
.nl-error { color: var(--c-granada); }
.nl-ok { color: var(--c-oro); }
.nl-contacto { color: var(--fg-2); font-size: 15px; }
.nl-contacto a {
  color: var(--fg); font-weight: 600;
  background: linear-gradient(var(--c-oro), var(--c-oro)) 0 100% / 100% 1px no-repeat;
  transition: background-size var(--d-base) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.nl-contacto a:hover { color: var(--c-oro); background-size: 100% 2px; }

/* ============================================================
   Pie: jai gigante en contorno dorado sangrando por la esquina, frase grande, columnas, legal mono
   ============================================================ */
.pie {
  position: relative; overflow: hidden; isolation: isolate;
  padding: var(--s-8) 0 calc(var(--s-5) + 150px);  /* aire abajo para la januquiá fija (celular, centrada) */
  color: var(--c-blanco);
}
.pie-jai {
  position: absolute; z-index: -1; right: -.06em; bottom: -.3em;
  font-size: clamp(260px, 44vw, 640px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgb(var(--rgb-oro) / .5);
  pointer-events: none; user-select: none;
}
.pie-inner { display: grid; gap: var(--s-6); min-width: 0; }
.pie-inner > * { min-width: 0; }
.pie-frase {
  font-size: clamp(38px, 5.8vw, 80px); font-weight: 800; line-height: .95; letter-spacing: -.02em;
  font-variation-settings: var(--wdth-tight); max-width: 13ch; text-wrap: balance;
}
.pie-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-4); }
.pie-cols > div { display: grid; gap: 10px; justify-items: start; align-content: start; }
.pie-cols h4 { color: var(--fg-2); font-weight: 600; margin-bottom: 4px; }
.pie-cols a {
  font-weight: 600; font-size: 16px; line-height: 1.3;
  background: linear-gradient(var(--c-oro), var(--c-oro)) 0 100% / 0 1px no-repeat;
  transition: background-size var(--d-base) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.pie-cols a:hover { color: var(--c-oro); background-size: 100% 1px; }
.pie-legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  padding-top: var(--s-4); border-top: 1px solid var(--hair);
  color: var(--fg-2); font-size: 11px; letter-spacing: .1em;
}
@media (min-width: 760px) {
  .pie { padding-bottom: calc(var(--s-5) + 130px); }  /* januquiá fija abajo a la izquierda */
  .pie-cols { grid-template-columns: repeat(3, max-content); gap: var(--s-7); }
}
@media (min-width: 1024px) {
  .pie-inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: start; column-gap: var(--s-7); }
  .pie-cols { grid-template-columns: repeat(3, max-content); gap: var(--s-6); justify-content: end; }
  .pie-legal { grid-column: 1 / -1; }
}

/* ============================================================
   Saltar al contenido: solo se ve al enfocar
   ============================================================ */
.saltar:focus {
  position: fixed; z-index: calc(var(--z-nav) + 1);
  top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; translate: -50% 0;
  width: auto; height: auto; clip: auto; overflow: visible; white-space: nowrap;
  padding: 12px 20px; border-radius: var(--r-btn);
  background: var(--g-oro); color: var(--c-noche); font-weight: 700;
  box-shadow: var(--sh-oro);
}

/* ============================================================
   Reducir movimiento: sin flotaciones ni retardos escalonados
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .chip-flotante { animation: none; }
  .nav, .nav::before, .nav-menu, .nav-menu a, .nav-burger span, .faq-q::after, .faq-a, .nl-campo, .nl-input, .nav-carrito { transition-duration: 1ms; transition-delay: 0s; }
}
