/* botones-vivos.css — MÓDULO GLOBAL de animación de botones (23-11-2026)
 * Origen: botón con luz de Tecno-AR (acciones-comerciales.css) y `.boton-luz` del proyecto de alumbrado.
 * Se COPIA a `compartido/` de cada proyecto y se enlaza; si se mejora, se mejora AQUÍ y se vuelve a copiar.
 *
 * Qué hace (todo con CSS nativo, sin librerías):
 *   1. Brillo que barre el botón al pasar el cursor o enfocarlo con teclado.
 *   2. Pulsación: el botón se hunde un instante al tocarlo (también en el teléfono, ver botones-vivos.js).
 *   3. Botón principal (`.primary`, `.dark`, `.b1`, `.boton-vivo`): línea de luz que recorre el borde inferior
 *      y respiración suave. La flecha `<span>` dentro del botón se desplaza.
 *   4. «Reducir movimiento» lo apaga todo; sin este archivo los botones siguen funcionando igual.
 *
 * Colores: se ajustan por variable en el contenedor o en el botón.
 *   --vivo-brillo : color del barrido            (por defecto blanco translúcido)
 *   --vivo-luz    : color de la línea y el halo  (por defecto blanco)
 *   --vivo-aura   : color del halo en reposo     (por defecto azul translúcido)
 * Especificidad 0 (:where): nunca pisa los estilos del proyecto; usa `scale`, que se suma a `transform`.
 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes bv-barrido { from { transform: translateX(-130%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }
  @keyframes bv-linea { 0%, 12% { transform: translateX(-110%); opacity: 0; } 25%, 68% { opacity: 1; } 88%, 100% { transform: translateX(295%); opacity: 0; } }
  @keyframes bv-flecha { 0%, 55%, 100% { transform: translate(0, 0); } 68% { transform: translate(4px, -3px); } 79% { transform: translate(0, 0); } 88% { transform: translate(3px, -2px); } }
  @keyframes bv-respira { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
  @keyframes bv-halo { 0%, 100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px var(--vivo-aura, rgba(37, 99, 235, 0.16)), 0 0 18px 2px var(--vivo-aura, rgba(37, 99, 235, 0.22)); } }
  @keyframes bv-pulsa { 40% { scale: 0.93; } }

  :where(.btn, .button, .boton-vivo) { position: relative; overflow: hidden; isolation: isolate; }
  :where(.btn, .button, .boton-vivo)::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 42%; pointer-events: none; z-index: -1; opacity: 0;
    background: linear-gradient(100deg, transparent, var(--vivo-brillo, rgba(255, 255, 255, 0.55)), transparent);
  }
  :where(.btn, .button, .boton-vivo):is(:hover, :focus-visible):not(:disabled)::before { opacity: 1; animation: bv-barrido 0.7s ease-out 1; }

  :where(.btn, .button, .boton-vivo):active:not(:disabled), :where(.btn, .button, .boton-vivo).bv-tocado { animation: bv-pulsa 0.26s ease-out 1; }

  :where(.btn.primary, .btn.dark, .btn.b1, .button.primary, .boton-vivo):not(:disabled) { animation: bv-respira 4.2s ease-in-out infinite, bv-halo 4.2s ease-in-out infinite; }
  :where(.btn.primary, .btn.dark, .btn.b1, .button.primary, .boton-vivo):not(:disabled)::after {
    content: ""; position: absolute; left: 0; bottom: 0; width: 35%; height: 3px; pointer-events: none;
    background: var(--vivo-luz, #fff); box-shadow: 0 0 10px var(--vivo-luz, #fff); animation: bv-linea 3.4s ease-in-out infinite;
  }
  :where(.btn.primary, .btn.dark, .btn.b1, .button.primary, .boton-vivo) > span { display: inline-block; animation: bv-flecha 3.4s ease-in-out infinite; }
  :where(.btn.primary, .btn.dark, .btn.b1, .button.primary, .boton-vivo):active:not(:disabled), :where(.btn.primary, .btn.dark, .btn.b1, .button.primary, .boton-vivo).bv-tocado { animation: bv-pulsa 0.26s ease-out 1; }
}
