/* ===== Microanimaciones (nov-2026). Ver docs/diseno.md, «Microanimaciones», y public/assets/js/micro.js. =====
   La web le responde a quien la usa: solo se mueve lo que contesta a algo que hizo la persona o a un dato que cambió,
   y nada dura más de un segundo. Con «reducir movimiento» no se anima nada. SITIO_MICRO=false en el .env lo apaga entero. */

/* Con «reducir movimiento», ni animaciones ni transiciones en toda la web (antes solo se apagaban las transiciones) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Encabezado ---------- */
/* menú del celular: las opciones entran en cascada (el botón ya se vuelve X) */
@keyframes mi-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.menu-abierto #menu.mi-cascada > *, .menu-abierto #menu.mi-cascada > .nav-util > * { animation: mi-entra .32s var(--ease, cubic-bezier(.2, .8, .2, 1)) both; animation-delay: calc(var(--mi-i, 0) * 32ms); }
/* modo oscuro: un círculo que crece desde el botón (donde no hay View Transitions, cambia como antes) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: mi-circulo .55s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes mi-circulo { from { clip-path: circle(0 at var(--mi-x, 50%) var(--mi-y, 0)); } to { clip-path: circle(var(--mi-r, 150vmax) at var(--mi-x, 50%) var(--mi-y, 0)); } }
.tema-btn svg { transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.tema-btn.mi-gira svg { transform: rotate(180deg) scale(.85); }
/* idioma: la bandera se voltea */
@keyframes mi-voltea { 50% { transform: perspective(200px) rotateY(90deg); } }
@media (hover: hover) { .idioma:hover .idi-bandera, .idioma:focus-visible .idi-bandera { animation: mi-voltea .42s ease-in-out; } }

/* ---------- Puertas de la portada: cada ícono hace su gesto al pasar el mouse (clase propia mi-gesto: .pp-ico es el ícono de la póliza) ---------- */
.portal-puertas .mi-gesto { transform-origin: 50% 70%; }
@keyframes mi-sube { 45% { transform: translateY(-6px) scale(1.06); } }
@keyframes mi-lanza { 40% { transform: translateY(-9px) rotate(-14deg); } 70% { transform: translateY(-4px) rotate(6deg); } }
@keyframes mi-rebota { 30% { transform: translateY(-8px); } 55% { transform: translateY(0) scale(1.08, .9); } 75% { transform: translateY(-3px); } }
@keyframes mi-mece { 25% { transform: rotate(14deg); } 55% { transform: rotate(-9deg); } 80% { transform: rotate(4deg); } }
@keyframes mi-salta { 35% { transform: translateY(-5px) rotate(-6deg); } 65% { transform: rotate(4deg); } }
@keyframes mi-abre { 45% { transform: perspective(160px) rotateY(-38deg); } }
@media (hover: hover) {
  .portal-puertas a:hover .mi-gesto, .portal-puertas a:focus-visible .mi-gesto { animation: mi-sube .5s cubic-bezier(.3, 1.3, .5, 1); }
  .portal-puertas a:hover .mi-gesto-birrete, .portal-puertas a:focus-visible .mi-gesto-birrete { animation-name: mi-lanza; animation-duration: .6s; }
  .portal-puertas a:hover .mi-gesto-voleibol, .portal-puertas a:focus-visible .mi-gesto-voleibol { animation-name: mi-rebota; animation-duration: .55s; }
  .portal-puertas a:hover .mi-gesto-medalla, .portal-puertas a:focus-visible .mi-gesto-medalla { transform-origin: 50% 0; animation-name: mi-mece; animation-duration: .7s; }
  .portal-puertas a:hover .mi-gesto-bolsa, .portal-puertas a:focus-visible .mi-gesto-bolsa { animation-name: mi-salta; animation-duration: .45s; }
  .portal-puertas a:hover .mi-gesto-pasaporte, .portal-puertas a:focus-visible .mi-gesto-pasaporte { transform-origin: 0 50%; animation-name: mi-abre; animation-duration: .55s; }
}

/* ---------- Letras y cifras que giran, como un tablero de aeropuerto ---------- */
@keyframes mi-flap { from { transform: perspective(320px) rotateX(75deg); filter: brightness(1.6); } to { transform: none; filter: none; } }
.mi-flap { display: inline-block; animation: mi-flap .12s ease-out; }

/* ---------- Formulario y pase de abordar ---------- */
@keyframes mi-sacude { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.mi-sacude { animation: mi-sacude .38s ease-in-out; }
form[data-form] button[type="submit"]:disabled { position: relative; overflow: hidden; }   /* solo mientras envía: el botón normal no cambia */
form[data-form] button[type="submit"]:disabled::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 40%; background: currentColor; opacity: .55; animation: mi-progreso 1s ease-in-out infinite alternate; }
@keyframes mi-progreso { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes mi-imprime { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.pa-codigo.mi-imprime { animation: mi-imprime .55s steps(16) both; }
/* el sello «Check-in» cae en su propia fila del talón: nunca tapa el código, el vuelo ni el texto */
.mi-sello { grid-column: 1 / -1; justify-self: start; flex: none; display: inline-grid; justify-items: center; gap: 1px; margin: .2rem .4rem .1rem; padding: 6px 12px 5px; border: 3px solid currentColor; border-radius: 12px; outline: 1.5px solid currentColor; outline-offset: 3px; color: var(--c-acento-texto); text-transform: uppercase; white-space: nowrap; transform: rotate(-6deg); }
html[data-tema="oscuro"] .mi-sello { color: var(--c-naranja-osc); }
/* en el pase corto (talón en fila) el sello va a la derecha del vuelo y el «listo» baja a su propia línea */
.pa-talon:has(> .mi-sello) { flex-wrap: wrap; }
.pa-talon > .mi-sello + .pa-listo { flex: 1 1 100%; }
.mi-sello b { font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: .06em; }
.mi-sello span { font-family: var(--f-mono, "OCR-B", monospace); font-size: 10px; line-height: 1; letter-spacing: .08em; }
@keyframes mi-cae { 0% { opacity: 0; transform: rotate(-6deg) scale(1.9); } 60% { opacity: 1; transform: rotate(-6deg) scale(.94); } 100% { opacity: 1; transform: rotate(-6deg) scale(1); } }
.mi-sello.mi-cae { animation: mi-cae .42s cubic-bezier(.3, 1.2, .5, 1) both; }
@keyframes mi-sube-c { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mi-sube { animation: mi-sube-c .35s var(--ease, cubic-bezier(.2, .8, .2, 1)) both; }
@keyframes mi-gira-b { from { transform: perspective(300px) rotateY(90deg); } to { transform: none; } }
[data-origen-bandera].mi-gira { display: inline-block; animation: mi-gira-b .32s cubic-bezier(.3, 1.4, .5, 1); }

/* ---------- Compartir: confirma sin cambiar lo que hace (WhatsApp en computador, menú del teléfono en el celular) ---------- */
@keyframes mi-ok { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
[data-compartir].mi-ok { animation: mi-ok .35s cubic-bezier(.3, 1.4, .5, 1); }
[data-compartir] .mi-check { display: none; }
[data-compartir].mi-ok .mi-check { display: inline-block; }
[data-compartir].mi-ok .mi-check + svg, [data-compartir].mi-ok > svg:not(.mi-check) { display: none; }

/* ---------- Arma tu temporada ---------- */
.mi-fantasma { position: absolute; z-index: 5; margin: 0; pointer-events: none; overflow: hidden; list-style: none; }
@keyframes mi-estampa { 0% { opacity: 0; transform: scale(1.07) rotate(-2.5deg); } 55% { opacity: 1; transform: scale(.985) rotate(.4deg); } 100% { opacity: 1; transform: none; } }
.ts-visados > .visa.mi-estampa { animation: mi-estampa .42s cubic-bezier(.2, .8, .2, 1) both; transform-origin: 50% 40%; }
@keyframes mi-anillo { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-naranja) 55%, transparent); } to { box-shadow: 0 0 0 14px color-mix(in srgb, var(--c-naranja) 0%, transparent); } }
.ts-punto.mi-anillo { animation: mi-anillo .5s ease-out; }

/* ---------- Tu rol en la página del viaje: la tarjeta elegida se vuelve una etiqueta que acompaña ---------- */
.mi-rolchip { position: sticky; top: calc(var(--pq-arriba, 140px) - .4rem); z-index: 35; display: flex; justify-content: center; height: 0; overflow: visible; pointer-events: none; }
.mi-rolchip > span { pointer-events: auto; display: inline-flex; align-items: center; gap: .55rem; height: 44px; padding: 0 .45rem 0 1rem; border-radius: var(--r-pill, 999px); background: var(--c-navy); color: var(--c-blanco); box-shadow: 0 8px 22px color-mix(in srgb, var(--c-navy) 30%, transparent); font-size: var(--t-sm); font-weight: 700; line-height: 1; white-space: nowrap; }
html[data-tema="oscuro"] .mi-rolchip > span { box-shadow: 0 0 0 1px var(--c-o-lin), 0 8px 22px rgba(0, 0, 0, .4); }
.mi-rolchip b { color: var(--c-naranja); font-weight: 900; }
.mi-rolchip button { height: 32px; padding: 0 .8rem; border: 0; border-radius: var(--r-pill, 999px); background: color-mix(in srgb, var(--c-blanco) 14%, transparent); color: inherit; font: inherit; font-size: var(--t-xs); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.mi-rolchip[hidden], .mi-rolchip.mi-fuera { visibility: hidden; }
@keyframes mi-para { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.pq-para.mi-entra { animation: mi-para .35s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--mi-i, 0) * 45ms); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--c-naranja) 28%, transparent) 0) no-repeat 0 0 / 0 100%; }
.pq-para.mi-subraya { transition: background-size .5s ease .25s; background-size: 100% 100%; }

/* ---------- Carrito ---------- */
.mi-vuela { position: fixed; z-index: 9999; left: 0; top: 0; pointer-events: none; border-radius: 50%; object-fit: contain; will-change: transform, opacity; }
@keyframes mi-pop { 40% { transform: scale(1.35); } }
.mi-pop { animation: mi-pop .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes mi-cant { from { transform: translateY(var(--mi-d, 8px)); opacity: 0; } to { transform: none; opacity: 1; } }
.cantidad input.mi-cant { animation: mi-cant .22s ease-out; }
