/* PERFORMANCE: AJAX Cart Animations */

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Cart icon animation */
.cart-icon {
    transition: transform 0.2s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.scale-110 {
    transform: scale(1.1);
}

/* Button loading states */
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Toast notification styles */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    background-color: #10B981;
}

.toast-notification.error {
    background-color: #EF4444;
}

.toast-notification.info {
    background-color: #3B82F6;
}

/* Cart badge animation */
.cart-bounce {
    animation: cartBounce 0.3s ease;
}

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

/* Quantity controls */
.quantity-controls {
    gap: 0;
}

.quantity-controls .btn {
    border-radius: 0;
    border-color: #dee2e6;
}

.quantity-controls .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.quantity-controls .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.quantity-controls input {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

/* Hover effects for add to cart buttons */
.ajax-add-to-cart,
.ajax-add-to-cart-custom {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.ajax-add-to-cart:hover,
.ajax-add-to-cart-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ajax-add-to-cart:active,
.ajax-add-to-cart-custom:active {
    transform: translateY(0);
}

/* Menu item card hover effects */
.menu-item-card {
    transition: all 0.3s ease;
}

.menu-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.success-checkmark {
    stroke-dasharray: 100;
    animation: checkmark 0.3s ease-in-out;
}

/* Cart preview hover effect */
.cart-preview {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.cart-btn:hover .cart-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive animations */
@media (max-width: 768px) {
    .toast-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .menu-item-card:hover {
        transform: none;
    }
    
    .ajax-add-to-cart:hover,
    .ajax-add-to-cart-custom:hover {
        transform: none;
    }
}

/* Smooth color transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}