/**
 * Animations pour le compteur panier
 * Pulse, bounce, +1 animation lors de l'ajout au panier
 */

/* Animation du compteur */
.cart-count {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cart-count.updated {
    animation: cartBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Animation de rebond pour le compteur */
@keyframes cartBounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1);
    }
}

/* Animation de l'icône panier */
.cart-icon.updated {
    animation: cartPulse 0.5s ease;
}

@keyframes cartPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Animation +1 qui apparaît et disparaît */
.cart-add-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-dark, #B71C1C);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.2;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transform: translateY(-10px) scale(0.5);
    animation: cartAddIndicator 0.8s ease forwards;
}

@keyframes cartAddIndicator {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-15px) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
}

/* Position relative pour l'icône panier afin de positionner le +1 */
.cart-icon {
    position: relative;
}

/* Respecter prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .cart-count,
    .cart-icon {
        animation: none !important;
        transition: none !important;
    }
    
    .cart-add-indicator {
        animation: none !important;
        opacity: 0;
    }
}





