/**
 * Fly to Cart Animation Styles
 */

/* Flying product element */
.flying-product {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 99999;
    will-change: transform, top, left;
}

.flying-product img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.flying-product i {
    font-size: 40px;
    color: #ff6b6b;
    display: block;
    text-align: center;
    line-height: 60px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Cart pulse animation when item lands */
@keyframes cartPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.cart-pulse {
    animation: cartPulse 0.6s ease-in-out;
}

/* Badge bounce animation */
@keyframes badgeBounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.2);
    }
}

.badge-bounce {
    animation: badgeBounce 0.6s ease-in-out;
}

/* Success ripple effect on cart */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.nfds-sidecart-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.5);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.nfds-sidecart-wrapper.cart-pulse::after {
    animation: ripple 0.6s ease-out;
}

/* Add to cart button feedback */
.add_to_cart_button.added::after,
.single_add_to_cart_button.added::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #4CAF50;
    font-weight: bold;
    pointer-events: none;
    animation: checkmarkPop 0.5s ease-out;
}

@keyframes checkmarkPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Smooth transitions for counter badge updates */
.nfds-sidecart-counter-badge {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Glow effect when item added */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), 0 0 30px rgba(76, 175, 80, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
    }
}

.nfds-sidecart-wrapper.cart-pulse .nfds-sidecart-counter-badge {
    animation: glow 0.6s ease-in-out;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .flying-product {
        width: 40px;
        height: 40px;
    }
    
    .flying-product i {
        font-size: 30px;
        line-height: 40px;
    }
}