/**
 * Cart Popup and Notification Styles
 */

/* Cart Added Popup */
#cart-added-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#cart-added-popup.show {
    opacity: 1;
    visibility: visible;
}

.cart-popup-content {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

#cart-added-popup.show .cart-popup-content {
    transform: translateY(0);
}

.popup-success-icon {
    width: 60px;
    height: 60px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.cart-popup-content h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.cart-popup-content p {
    color: #666;
    margin-bottom: 20px;
}

.cart-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary span {
    font-weight: 600;
    color: #333;
}

.cart-popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.cart-popup-actions .btn-continue {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.cart-popup-actions .btn-continue:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.cart-popup-actions .btn-view-cart {
    background: #e60023;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.cart-popup-actions .btn-view-cart:hover {
    background: #c8001f;
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

/* Cart Notifications */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
    border-left: 4px solid #007cba;
}

.cart-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.cart-notification-success {
    border-left-color: #28a745;
}

.cart-notification-error {
    border-left-color: #dc3545;
}

.cart-notification-info {
    border-left-color: #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.notification-message {
    color: #333;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.notification-close:hover {
    color: #333;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* Button Loading States */
.single_add_to_cart_button.loading,
.buy-now-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cart-popup-content {
        padding: 20px;
        margin: 20px;
    }
    
    .cart-popup-actions {
        flex-direction: column;
    }
    
    .cart-popup-actions .btn-continue,
    .cart-popup-actions .btn-view-cart {
        width: 100%;
        text-align: center;
    }
    
    .cart-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .cart-notification.show {
        transform: translateY(0);
    }
    
    .cart-summary {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Animation for cart count update */
.cart-count.animate {
    animation: bounce 0.3s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Sticky cart enhancements */
.sticky-add-to-cart {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sticky-add-to-cart.show {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
