/* Loading Overlay for Search Page - In Container */
.products-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 400px;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.products-loading-overlay.active {
    display: flex;
}

.list-products-5 {
    position: relative;
    min-height: 200px;
}

/* Set minimum height when loading to prevent layout shift */
.list-products-5.loading {
    min-height: 600px;
}

/* Hide products when loading is active */
.list-products-5.loading .card-grid-style-3,
.list-products-5.loading .text-center {
    display: none;
}

/* Responsive minimum heights */
@media (max-width: 768px) {
    .list-products-5.loading {
        min-height: 400px;
    }
}

.search-loading-content {
    text-align: center;
    padding: 40px;
}

.search-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.search-loading-spinner svg {
    width: 100%;
    height: 100%;
}

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

.search-loading-text {
    font-size: 16px;
    color: #333;
    margin: 0;
}

/* Alternative spinner styles */
.search-loading-spinner.style-2 {
    border: 4px solid transparent;
    border-top: 4px solid #3498db;
    border-right: 4px solid #3498db;
}

.search-loading-spinner.style-3 {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-right: 4px solid #f39c12;
    border-bottom: 4px solid #2ecc71;
    border-left: 4px solid #3498db;
}

/* Dots loading animation */
.search-loading-dots {
    display: inline-flex;
    gap: 8px;
    margin-left: 5px;
}

.search-loading-dots span {
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.search-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.search-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Skeleton loading for products */
.products-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.skeleton-product-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skeleton-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-text.title {
    width: 80%;
    height: 20px;
}

.skeleton-text.price {
    width: 40%;
    height: 24px;
}

.skeleton-button {
    width: 100%;
    height: 40px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-top: 15px;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .search-loading-content {
        padding: 30px;
    }

    .search-loading-spinner {
        width: 50px;
        height: 50px;
    }

    .search-loading-text {
        font-size: 14px;
    }

    .products-skeleton {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}