/* =========================================================
   AZKA — ANIMACIONES PREMIUM (FASE 9)
   ---------------------------------------------------------
   Sistema global de aparición progresiva y microinteracciones.
   Principios: sutil, fluido, acelerado por GPU (transform +
   opacity), sin librerías externas.
   Respeto total de prefers-reduced-motion al final del archivo.
   ========================================================= */

/* ---------- Aparición progresiva (reveal) ---------- */
.azk-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.azk-reveal.azk-in {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Defensa FASE 9.6 ----------
   Elementos centrados por transform propio (p. ej. .hero-content usa
   translate(-50%,-50%)) NUNCA deben recibir el transform genérico del
   reveal: lo sobrescribiría y desplazaría el layout. Si algo los
   etiquetara dinámicamente, estas reglas preservan su centrado y solo
   añaden el desplazamiento vertical de la entrada. */
.hero-content.azk-reveal {
    transform: translate(-50%, -50%) translateY(26px);
}

.hero-content.azk-reveal.azk-in {
    transform: translate(-50%, -50%);
}

/* ---------- Hover elegante en tarjetas de catálogo ---------- */
.products .card {
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.products .card:hover {
    transform: translateY(-6px);
}

.products .card .img-front,
.products .card .card-img-container img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.6s ease;
}

.products .card:hover .img-front,
.products .card:hover .card-img-container img {
    transform: scale(1.04);
}

/* ---------- Microinteracción de botones ---------- */
.pay,
.checkout-btn,
.btn-action,
.add-cart,
.buy-now {
    transition: transform 0.18s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.pay:active,
.checkout-btn:active,
.btn-action:active,
.add-cart:active,
.buy-now:active {
    transform: scale(0.97);
}

/* ---------- Checkout: pulso al actualizar totales ---------- */
@keyframes azkFlash {
    0%   { opacity: 0.35; transform: translateY(4px); }
    100% { opacity: 1;    transform: translateY(0); }
}

.azk-flash {
    animation: azkFlash 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Envío gratis destacado (checkout) */
.azk-envio-gratis {
    font-style: normal;
    color: #7ddba3;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.azk-envio-motivo {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #9a9a9a;
    margin-top: 2px;
}

/* ---------- Carrito: entrada suave de ítems ----------
   FASE 9.6: se usa translateY en lugar de translateX para que la
   animación nunca pueda generar overflow horizontal dentro del drawer. */
@keyframes azkSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cart-drawer .cart-body > * {
    animation: azkSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ---------- Selección de talla (producto) ---------- */
.size-option,
.talla-btn,
.sizes label {
    transition: transform 0.2s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.size-option:active,
.talla-btn:active,
.sizes label:active {
    transform: scale(0.94);
}

/* =========================================================
   ACCESIBILIDAD — reducción de movimiento
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .azk-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* El hero conserva su centrado por transform incluso con movimiento reducido. */
    .hero-content.azk-reveal {
        transform: translate(-50%, -50%) !important;
    }

    .azk-flash,
    .cart-drawer .cart-body > * {
        animation: none !important;
    }

    .products .card,
    .products .card .img-front,
    .products .card .card-img-container img,
    .pay,
    .checkout-btn,
    .btn-action,
    .size-option,
    .talla-btn,
    .sizes label {
        transition: none !important;
    }

    .products .card:hover,
    .pay:active,
    .checkout-btn:active,
    .btn-action:active {
        transform: none !important;
    }
}
