/* ============================================================
   Infinite Scroll - Front CSS
   ============================================================ */

:root {
    --is-loader-color: #3498db;
    --is-accent: #2c3e50;
    --is-text-light: #7f8c8d;
    --is-transition: 0.3s ease;
}

/* ============================================================
   LOADER - Mode Automatique
   ============================================================ */

.is-loader {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--is-transition), visibility var(--is-transition);
}

.is-loader.is-active {
    opacity: 1;
    visibility: visible;
}

.is-loader-content {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
}

/* Spinner */
.is-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 0.5rem;
    position: relative;
}

.is-spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 15%;
    left: 15%;
    border: 3px solid transparent;
    border-top-color: var(--is-loader-color);
    border-right-color: var(--is-loader-color);
    border-radius: 50%;
    animation: is-spin 1.2s linear infinite;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}
/* 
.is-spinner::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border: 2px solid transparent;
    border-top-color: rgba(52, 152, 219, 0.5);
    border-radius: 50%;
    animation: is-spin 2s linear infinite reverse;
}
 */
@keyframes is-spin {
    to { transform: rotate(360deg); }
}

.is-loader-text {
    font-size: 0.85rem;
    color: var(--is-text-light);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ============================================================
   LOAD MORE BUTTON
   ============================================================ */

.is-load-more-wrapper {
    text-align: center;
    padding: 2rem 1rem;
}

.is-load-more-btn {
    background: var(--is-accent);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--is-transition);
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.2);
}

.is-load-more-btn:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.is-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

/* ============================================================
   MESSAGE FIN DE PAGE
   ============================================================ */

.is-end-message {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--is-text-light);
    animation: is-fade-in 0.5s ease forwards;
}

.is-end-message::before {
    content: '✓';
    display: block;
    font-size: 2rem;
    color: var(--is-loader-color);
    margin-bottom: 0.5rem;
}

@keyframes is-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */

.is-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--is-accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--is-transition);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.is-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.is-back-to-top:hover {
    background: #1a252f;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(44, 62, 80, 0.3);
}

/* ============================================================
   ANIMATIONS D'APPARITION
   ============================================================ */

.product.is-new-product {
    animation: is-product-appear 0.5s ease forwards;
}

@keyframes is-product-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .is-loader {
        bottom: 1.5rem;
    }

    .is-loader-content {
        padding: 1rem 1.5rem;
    }

    .is-back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .is-loader-content {
        padding: 0.8rem 1rem;
    }

    .is-spinner {
        width: 40px;
        height: 40px;
    }

    .is-loader-text {
        font-size: 0.75rem;
    }

    .is-load-more-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ============================================================
   PRÉFÉRENCES D'ACCESSIBILITÉ
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .is-spinner::before,
    .is-spinner::after,
    .is-loader,
    .is-back-to-top,
    .is-end-message,
    .product.is-new-product {
        animation: none;
        transition: none;
    }
}
body.is-infinitescroll-active .pagination-container,
body.is-infinitescroll-active nav[aria-label="Pagination des produits"],
body.is-infinitescroll-active .pagination-list-container {
  display: none !important;
}