/**
 * Quick View - Loading States & Animations
 * Adaugă acest CSS în fișierul tău principal de stiluri
 */

/* ============================================
   LOADING DOTS ANIMATION
============================================ */
.loading-dots {
    display: inline-block;
    position: relative;
}

.loading-dots:after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
        opacity: 0.4;
    }
    40% {
        content: '..';
        opacity: 0.7;
    }
    60% {
        content: '...';
        opacity: 1;
    }
    80%, 100% {
        content: '';
        opacity: 0;
    }
}

/* ============================================
   LOADING SPINNER
============================================ */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #181818;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* ============================================
   QUICK VIEW MODAL ENHANCEMENTS
============================================ */

/* Smooth transition pentru imagini */
.modal-quick-view .quickView-item img {
    transition: opacity 0.3s ease-in-out;
}

.modal-quick-view .quickView-item img.lazyloading {
    opacity: 0.3;
}

.modal-quick-view .quickView-item img.lazyloaded {
    opacity: 1;
}

/* Loading state pentru modal */
.modal-quick-view.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Disable buttons during loading */
.modal-quick-view.loading .btn-main-product,
.modal-quick-view.loading .box-icon {
    pointer-events: none;
    opacity: 0.6;
}

/* ============================================
   COLOR SWATCHES HOVER EFFECTS
============================================ */
.variant-picker-values .color-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.variant-picker-values .color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.variant-picker-values .color-btn.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #181818;
}

/* ============================================
   SIZE BUTTONS ENHANCEMENTS
============================================ */
.variant-picker-values .size-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.variant-picker-values .size-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ============================================
   PRICE ANIMATIONS
============================================ */
.tf-product-info-price {
    transition: all 0.3s ease;
}

.tf-product-info-price.updating {
    opacity: 0.5;
}

/* Fade in pentru preț actualizat */
@keyframes priceUpdate {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.tf-product-info-price.updated {
    animation: priceUpdate 0.3s ease;
}

/* ============================================
   QUANTITY SELECTOR ENHANCEMENTS
============================================ */
.wg-quantity {
    position: relative;
    transition: all 0.3s ease;
}

.wg-quantity:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wg-quantity .btn-quantity {
    transition: all 0.2s ease;
    user-select: none;
}

.wg-quantity .btn-quantity:hover {
    background-color: #f5f5f5;
}

.wg-quantity .btn-quantity:active {
    transform: scale(0.95);
}

/* Disabled state */
.wg-quantity.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   OUT OF STOCK STATE
============================================ */
.out-of-stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    z-index: 10;
    letter-spacing: 1px;
}

.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9;
}

/* ============================================
   TOAST NOTIFICATIONS (Optional)
============================================ */
.quickview-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #181818;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.quickview-toast.success {
    background-color: #28a745;
}

.quickview-toast.error {
    background-color: #dc3545;
}

.quickview-toast.warning {
    background-color: #ffc107;
    color: #181818;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
============================================ */
@media (max-width: 768px) {
    .loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
    
    .quickview-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
============================================ */
.variant-picker-values input[type="radio"]:focus + label {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

.btn-quantity:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .loading-spinner {
        border-color: #000;
        border-top-color: #fff;
    }
    
    .variant-picker-values .color-btn.active {
        box-shadow: 0 0 0 3px #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-dots:after,
    .loading-spinner,
    .variant-picker-values .color-btn,
    .variant-picker-values .size-btn,
    .tf-product-info-price {
        animation: none;
        transition: none;
    }
}

/* ============================================
   PRINT STYLES (hide modal in print)
============================================ */
@media print {
    .modal-quick-view {
        display: none !important;
    }
}