/* Postres El Cartel · capa de animaciones. No cambia el diseño: solo le da vida.
   Los banners se reemplazan por su versión 3D filmada en Blender (mismo arte, en movimiento). */

/* ---------- banners en video (con la imagen original como respaldo) ---------- */
.hero video.vivo, .promo video.vivo { width: 100%; display: block; aspect-ratio: 1920 / 588; object-fit: cover; }
.promo video.vivo { aspect-ratio: 1131 / 147; }
.hero img.quieto, .promo img.quieto { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hero video.vivo, .promo video.vivo { display: none; }
  .hero img.quieto, .promo img.quieto { display: block; }
}

/* ---------- entrada de la página ---------- */
header { animation: bajar .7s cubic-bezier(.2, .9, .3, 1.2) both; position: relative; z-index: 5; }
header img { animation: brilloLogo 3.2s ease-in-out 1s infinite; }
@keyframes bajar { from { transform: translateY(-100%); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes brilloLogo { 0%, 100% { filter: drop-shadow(0 0 0 #ff4f9a00) } 50% { filter: drop-shadow(0 0 10px #ff4f9acc) } }
nav a { position: relative; transition: color .25s; }
nav a:not(:first-child)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: #ed1765; transform: scaleX(0); transition: transform .3s; }
nav a:not(:first-child):hover::after { transform: scaleX(1); }
nav a:first-child { box-shadow: 0 0 0 0 #ed176588; animation: latido 2.4s infinite; }

.hero { overflow: hidden; animation: aparecer 1s ease both .15s; }
@keyframes aparecer { from { opacity: 0; transform: scale(1.04) } to { opacity: 1; transform: none } }
/* botón «Ordena Ahora» del banner: aro de luz que late */
.heroLink { animation: latido 2s infinite 1.2s; }
.promo button { animation: latido 2s infinite .6s; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 #ff4f9acc } 70% { box-shadow: 0 0 0 18px #ff4f9a00 } 100% { box-shadow: 0 0 0 0 #ff4f9a00 } }

/* ---------- aparición al bajar con el dedo ---------- */
.revelar { opacity: 0; transform: translateY(34px) scale(.98); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .9, .3, 1.1); transition-delay: var(--retraso, 0s); }
.revelar.visto { opacity: 1; transform: none; }
.benefits span { transition: transform .3s; }
.benefits.visto span { animation: subir .6s cubic-bezier(.2, .9, .3, 1.3) both; }
.benefits.visto span:nth-child(2) { animation-delay: .1s } .benefits.visto span:nth-child(3) { animation-delay: .2s } .benefits.visto span:nth-child(4) { animation-delay: .3s }
.benefits span:hover { transform: translateY(-3px) scale(1.04); }
@keyframes subir { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }

/* títulos: la palabra rosada se subraya con una pincelada */
h2 em { position: relative; display: inline-block; }
h2 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: .22em; background: #ed176533; border-radius: 8px; transform: scaleX(0); transform-origin: left; transition: transform .8s .3s cubic-bezier(.2, .9, .3, 1); z-index: -1; }
h2.visto em::after { transform: scaleX(1); }

/* categorías */
#categories button { transition: transform .25s, box-shadow .25s, background .25s; }
#categories button:hover { transform: translateY(-4px); box-shadow: 0 10px 18px #7c233030; }
#categories button span { transition: transform .4s cubic-bezier(.2, .9, .3, 1.6); }
#categories button:hover span { transform: scale(1.25) rotate(-8deg); }
#categories button.active span { animation: rebote .6s; }
@keyframes rebote { 0% { transform: scale(.6) } 60% { transform: scale(1.3) } 100% { transform: scale(1) } }

/* tarjetas de producto: inclinación 3D, brillo que cruza y foto que se acerca */
#products { perspective: 900px; }
.product { transition: transform .25s ease, box-shadow .25s ease; transform-style: preserve-3d; will-change: transform; }
.product:hover { box-shadow: 0 18px 34px #5a12274a; }
.product img { transition: transform .6s ease; }
.product:hover img { transform: scale(1.08); }
.product::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, #ffffff66 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.product:hover::after { transform: translateX(120%); transition: transform .9s ease; }
.product.entra { animation: tarjeta .65s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: var(--retraso, 0s); }
@keyframes tarjeta { from { opacity: 0; transform: translateY(40px) rotateX(18deg) } to { opacity: 1; transform: none } }
.heart { transition: transform .2s; }
.heart:active { transform: scale(1.5); }
.pink { transition: transform .15s, filter .2s; }
.pink:hover { filter: brightness(1.1); transform: translateY(-1px); }
.pink:active { transform: scale(.95); }

/* carrito: el número salta cuando agregas algo */
#count { display: inline-block; }
#count.salto { animation: salto .5s cubic-bezier(.2, .9, .3, 1.6); }
@keyframes salto { 0% { transform: scale(1) } 40% { transform: scale(1.8); color: #ff6aa8 } 100% { transform: scale(1) } }

/* botones de abajo y WhatsApp */
.bottom button { transition: transform .25s, box-shadow .25s; }
.bottom button:hover { transform: translateY(-4px); box-shadow: 0 12px 22px #7c233026; }
.floating { animation: latidoVerde 2.2s infinite; }
@keyframes latidoVerde { 0% { box-shadow: 0 0 0 0 #13c653aa } 70% { box-shadow: 0 0 0 16px #13c65300 } 100% { box-shadow: 0 0 0 0 #13c65300 } }
dialog[open] { animation: ventana .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes ventana { from { opacity: 0; transform: translateY(30px) scale(.96) } to { opacity: 1; transform: none } }

/* lluvia de chispitas (decoración del fondo) */
#chispitas { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
main, footer { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revelar { opacity: 1; transform: none; }
  #chispitas { display: none; }
}
