/**
 * PPServis Catalog Filters - REST API Loading States
 */

/* Loading overlay for filters */
.ppservis-filters.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.ppservis-filters.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

/* Loading spinner for product grid */
#product-grid.loading {
    position: relative;
    min-height: 400px;
}

#product-grid.loading .products-grid {
    opacity: 0.4;
    pointer-events: none;
}

#product-grid.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

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

/* Skeleton loader for products (optional) */
.product-card.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Smooth transitions */
.products-grid {
    transition: opacity 0.3s ease;
}

.filter-section label {
    transition: opacity 0.2s ease;
}

/* Performance optimizations */
.products-grid {
    will-change: contents;
}

#product-grid.loading .products-grid {
    will-change: opacity;
}
