/* Logos animados de Farmacias Generales y Las Preparadas de la Curva.
   Los usan la página de la farmacia, la propuesta y los videos del logo (herramientas/logo-video.mjs).
   Todo es animación CSS: el grabador la detiene y la avanza cuadro por cuadro. */

/* ---------- Farmacias Generales (SVG de plantillas/farmacia/logo.js → ICONO_FG_VIVO) ---------- */
.fg-vivo { overflow: visible; }
.fg-vivo .fg-aro { stroke-dasharray: 100; stroke-dashoffset: 100; animation: fg-trazo .9s cubic-bezier(.6, 0, .2, 1) .15s forwards; }
.fg-vivo .fg-mano { opacity: 0; transform: translate(-8px, 8px); animation: fg-entra .7s cubic-bezier(.2, .8, .2, 1) .55s forwards; }
.fg-vivo .fg-corazon { transform-box: fill-box; transform-origin: 50% 60%; transform: scale(0); animation: fg-pop .65s cubic-bezier(.3, 1.7, .5, 1) .8s forwards, fg-latido 2.2s ease-in-out 2.6s infinite; }
.fg-vivo .fg-cruz { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: fg-pop .45s cubic-bezier(.3, 1.7, .5, 1) 1.2s forwards; }
.fg-vivo .fg-pulso { stroke-dasharray: 100; stroke-dashoffset: 100; animation: fg-trazo .8s ease-out 1.35s forwards; }
@keyframes fg-trazo { to { stroke-dashoffset: 0; } }
@keyframes fg-entra { to { opacity: 1; transform: none; } }
@keyframes fg-pop { to { transform: scale(1); } }
@keyframes fg-latido { 0%, 40%, 100% { transform: scale(1); } 8% { transform: scale(1.09); } 16% { transform: scale(1); } 24% { transform: scale(1.05); } }

/* Nombre de la farmacia que se escribe después del logo. */
.fg-nombre { font: 900 1em/1 'Red Hat Display', system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.fg-nombre b { color: #1D3FC4; } .fg-nombre i { color: #E1203A; font-style: normal; }
.fg-nombre.vivo { clip-path: inset(-10% 100% -10% 0); animation: revelar .9s cubic-bezier(.6, 0, .2, 1) 1.7s forwards; }
@keyframes revelar { to { clip-path: inset(-10% 0 -10% 0); } }

/* ---------- Las Preparadas de la Curva (imagen img/logo-curva.webp) ---------- */
.curva-vivo { position: relative; display: block; transform-origin: 50% 60%; animation: curva-rebote 1s cubic-bezier(.2, 1.6, .4, 1) .2s both, curva-flotar 5s ease-in-out 1.4s infinite; }
.curva-vivo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
/* Destello que cruza el óvalo: solo se pinta donde está el logo. */
.curva-vivo .destello {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url(img/logo-curva.webp) center / 100% 100% no-repeat; mask: url(img/logo-curva.webp) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .8) 49%, rgba(255, 244, 200, .25) 53%, transparent 62%) 130% 0 / 300% 100% no-repeat;
  animation: curva-destello 4.6s ease-in-out 1.25s infinite;
}
.curva-vivo .chispa { position: absolute; width: var(--t, 14px); aspect-ratio: 1; background: #FFF6CF; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); opacity: 0; animation: chispa 2.4s ease-in-out var(--d, 0s) infinite; filter: drop-shadow(0 0 6px rgba(251, 193, 33, .9)); }
@keyframes curva-rebote { from { transform: rotate(-14deg) scale(.4); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
@keyframes curva-flotar { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-2.5%); } }
@keyframes curva-destello { 0% { background-position: 130% 0; } 28%, 100% { background-position: -30% 0; } }
@keyframes chispa { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } }

@media (prefers-reduced-motion: reduce) {
  .fg-vivo *, .fg-nombre.vivo, .curva-vivo, .curva-vivo * { animation: none !important; }
  .fg-vivo .fg-aro, .fg-vivo .fg-pulso { stroke-dashoffset: 0; }
  .fg-vivo .fg-mano, .fg-vivo .fg-corazon, .fg-vivo .fg-cruz { opacity: 1; transform: none; }
  .fg-nombre.vivo { clip-path: none; }
  .curva-vivo { transform: rotate(-4deg); }
}
