/* Modern Skeleton Loader - 2026 Style */

.skeleton-loader {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 8px;
}

.skeleton-loader::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Product Card Skeleton */
.product-skeleton {
    display: block;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-skeleton-image {
    width: 100%;
    height: 250px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.product-skeleton-title {
    height: 20px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.product-skeleton-title.short {
    width: 70%;
}

.product-skeleton-price {
    height: 24px;
    width: 40%;
    margin-bottom: 10px;
    border-radius: 4px;
}

.product-skeleton-button {
    height: 40px;
    width: 100%;
    border-radius: 6px;
}

/* Grid Layout for Skeletons */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-skeleton-image {
        height: 180px;
    }
}

/* Loading Spinner for Load More Button */
.load-more-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* Load More Button */
.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    background: var(--primary-color, #1186d6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 30px auto;
    display: block;
}

.load-more-btn:hover {
    background: var(--secondary-color, #09880b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Page Loader Overlay */
.page-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loader-content {
    text-align: center;
}

.page-loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color, #1186d6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.page-loader-text {
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

/* Fade In Animation for Products */
.product-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays */
.product-item:nth-child(1) { animation-delay: 0.1s; }
.product-item:nth-child(2) { animation-delay: 0.2s; }
.product-item:nth-child(3) { animation-delay: 0.3s; }
.product-item:nth-child(4) { animation-delay: 0.4s; }
.product-item:nth-child(5) { animation-delay: 0.5s; }
.product-item:nth-child(6) { animation-delay: 0.6s; }

/* No More Products Message */
.no-more-products {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.no-more-products i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}


/* Enhanced Product Skeleton for Auto-Loader */
.skeleton-products-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.product-skeleton-item {
    flex: 0 0 auto;
}

/* Smooth transitions */
.skeleton-loader-container {
    transition: opacity 0.3s ease;
}

/* Better skeleton for product cards */
.product-skeleton {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
}

.product-skeleton:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Responsive skeleton grid */
@media (min-width: 1200px) {
    .skeleton-products-wrapper .product-skeleton-item {
        flex: 0 0 calc(16.666% - 15px);
        max-width: calc(16.666% - 15px);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .skeleton-products-wrapper .product-skeleton-item {
        flex: 0 0 calc(20% - 15px);
        max-width: calc(20% - 15px);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .skeleton-products-wrapper .product-skeleton-item {
        flex: 0 0 calc(25% - 15px);
        max-width: calc(25% - 15px);
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .skeleton-products-wrapper .product-skeleton-item {
        flex: 0 0 calc(33.333% - 15px);
        max-width: calc(33.333% - 15px);
    }
}

@media (max-width: 575px) {
    .skeleton-products-wrapper .product-skeleton-item {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
    
    .skeleton-products-wrapper {
        gap: 10px;
    }
}

/* Pulse animation variant */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.skeleton-loader.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}
