/**
 * UWE AJAX Cart Styles
 *
 * Styles for AJAX add to cart functionality
 *
 * @package UnifiedWooCommerceExtras
 * @since 1.0.0
 */

/* AJAX Cart Button Wrapper */
.uwe-ajax-cart-wrapper {
    position: relative;
    display: inline-block;
}

.uwe-ajax-add-to-cart {
    position: relative;
    transition: all 0.3s ease;
}

.uwe-ajax-add-to-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.uwe-ajax-add-to-cart.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.uwe-ajax-cart-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-size: 14px;
}

.uwe-ajax-cart-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: uwe-spin 1s linear infinite;
}

@keyframes uwe-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Styles */
#uwe-ajax-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: uwe-slide-in 0.3s ease-out;
}

@keyframes uwe-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.uwe-notification-content {
    padding: 20px;
    position: relative;
}

.uwe-notification-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.uwe-notification-product {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-right: 40px;
}

.uwe-notification-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.uwe-notification-details {
    flex: 1;
}

.uwe-notification-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.uwe-notification-price {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.uwe-notification-message {
    margin-bottom: 15px;
    padding: 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    font-size: 14px;
    text-align: center;
}

.uwe-notification-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.uwe-notification-view-cart {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.uwe-notification-view-cart:hover {
    background: #005a87;
    color: #fff;
    text-decoration: none;
}

.uwe-notification-continue {
    flex: 1;
    padding: 10px 16px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.uwe-notification-continue:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

/* Variation Error Styles */
.variations select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #uwe-ajax-cart-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .uwe-notification-content {
        padding: 15px;
    }
    
    .uwe-notification-product {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .uwe-notification-image {
        width: 80px;
        height: 80px;
        align-self: center;
    }
    
    .uwe-notification-actions {
        flex-direction: column;
    }
    
    .uwe-notification-view-cart,
    .uwe-notification-continue {
        flex: none;
    }
}

@media (max-width: 480px) {
    .uwe-ajax-cart-wrapper {
        width: 100%;
    }
    
    .uwe-ajax-add-to-cart {
        width: 100%;
    }
    
    .uwe-ajax-cart-loading {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #uwe-ajax-cart-notification {
        border: 2px solid #000;
    }
    
    .uwe-notification-view-cart {
        border: 1px solid #000;
    }
    
    .uwe-notification-continue {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .uwe-ajax-add-to-cart,
    .uwe-notification-close,
    .uwe-notification-view-cart,
    .uwe-notification-continue {
        transition: none;
    }
    
    .uwe-ajax-add-to-cart:hover {
        transform: none;
    }
    
    @keyframes uwe-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    @keyframes uwe-slide-in {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #uwe-ajax-cart-notification {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .uwe-notification-close {
        color: #a0aec0;
    }
    
    .uwe-notification-close:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .uwe-notification-title {
        color: #e2e8f0;
    }
    
    .uwe-notification-price {
        color: #a0aec0;
    }
    
    .uwe-notification-message {
        background: #2f855a;
        border-color: #38a169;
        color: #c6f6d5;
    }
    
    .uwe-notification-continue {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .uwe-notification-continue:hover {
        background: #2d3748;
        border-color: #a0aec0;
    }
}
/* Inline add-to-cart error notice (replaces blocking alert()) */
.uwe-ajax-cart-error {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3232;
    border-radius: 4px;
    color: #a02622;
    font-size: 14px;
    line-height: 1.4;
}
