/**
 * AJAX Add to Cart Animation Styles
 */

/* Fly to cart icon */
.fly-to-cart-icon {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    transition: none;
}

/* Spinner animation */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error messages - old styles for backward compatibility */
.add-to-cart-success,
.add-to-cart-error {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.add-to-cart-success {
    background: #4caf50;
    color: white;
}

.add-to-cart-error {
    background: #f44336;
    color: white;
}

/* Centered success/error messages */
.add-to-cart-success-centered,
.add-to-cart-error-centered {
    padding: 20px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    text-align: center;
    animation: fadeInScale 0.3s ease;
}

.add-to-cart-success-centered {
    background: #4caf50;
    color: white;
}

.add-to-cart-error-centered {
    background: #f44336;
    color: white;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cart icon highlight animation */
.cart-updated {
    animation: cartPulse 0.5s ease;
}

@keyframes cartPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Elementor cart icon specific */
.elementor-menu-cart__toggle.cart-updated .elementor-button-icon {
    color: #FD8311 !important;
}

/* Button disabled state */
#add-to-cart-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Hide WooCommerce default add to cart messages on single product pages */
.single-product .woocommerce-message {
    display: none !important;
}

/* Hide the "View Cart" button specifically */
.single-product a.button.wc-forward {
    display: none !important;
}