/* Cart Count Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

.cart-count.pulse-animation,
.header-cart-count.pulse-animation,
.cart-counter.pulse-animation {
    animation: pulse 0.6s ease-out;
}

/* Cart Icon Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.cart-icon-shake {
    animation: shake 0.3s ease-in-out;
}

/* Success Message Animation */
@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.success-message {
    animation: slideDown 0.3s ease-out forwards;
}

/* Add to Cart Button States */
.single_add_to_cart_button.loading {
    position: relative;
    color: transparent;
}

.single_add_to_cart_button.loading i {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.single_add_to_cart_button.added {
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .success-message {
        top: 60px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
        min-width: auto;
        font-size: 14px;
        padding: 15px 20px;
    }
}

/* Fix duplicate cart titles */
.woocommerce-cart .entry-title {
    display: none; /* Hide the page title */
}

.woocommerce-cart .entry-content > h2:first-child {
    display: none; /* Hide the H2 CARRELLO */
}

.woocommerce-cart .entry-content > h2:first-child + p:empty {
    display: none; /* Hide empty paragraph after H2 */
}