/**
 * Loading Overlay & Animations - Filtri Beta
 * Animazioni smooth per caricamento prodotti
 */

/* ========================================
   LOADING OVERLAY
   ======================================== */

.filtri-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.filtri-loading-spinner {
    text-align: center;
    color: #fff;
}

/* ========================================
   SPINNER RING
   ======================================== */

.spinner-ring {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #f3bb27;
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

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

/* ========================================
   SPINNER TEXT
   ======================================== */

.spinner-text {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========================================
   PRODUCT CARD ANIMATIONS
   ======================================== */

.product-card-beta {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* State durante fade out */
.product-card-beta.fading-out {
    opacity: 0;
    transform: translateY(20px);
}

/* ========================================
   FADE IN GENERAL
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   RESULTS COUNTER
   ======================================== */

.filtri-results-counter {
    display: inline-block;
    padding: 3px 10px;
    background: #f3bb27;
    color: #000;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 10px;
    font-size: 13px;
    animation: fadeInSlide 0.4s ease;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   SKELETON LOADER (opzionale)
   ======================================== */

.skeleton-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    height: 400px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    .spinner-ring {
        width: 50px;
        height: 50px;
    }

    .spinner-text {
        font-size: 14px;
    }

    .filtri-results-counter {
        font-size: 11px;
        padding: 2px 8px;
    }
}

/* ========================================
   SMOOTH SCROLL BEHAVIOR
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* Disabilita smooth scroll durante animazioni */
html.filtering {
    scroll-behavior: auto;
}
