/* CSS Multi-column Layout pour un effet masonry */
.products-custom-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Reset Astra grid classes */
.products-custom-grid .ast-grid-common-col {
    padding: 0 !important;
}

.products-custom-grid .product,
.products-custom-grid .product a,
.products-custom-grid .product img {
    width: 100%;
    display: block;
}

/* Empêche les produits d'être coupés entre les colonnes */
.columns-5.products-custom-grid .product-item {
    break-inside: avoid;
     width: calc(100% / 6 );
}

/* Styles pour les produits avec la classe "large" */
.columns-5.products-custom-grid .product-item:nth-child(15n + 7),
.columns-5.products-custom-grid .product-item:nth-child(15n + 3),
.columns-5.products-custom-grid .product-item:nth-child(15n + 13) {
    width: calc((100% / 6) * 1.5);
}

.columns-5.products-custom-grid .product-item:nth-child(15n + 2),
.columns-5.products-custom-grid .product-item:nth-child(15n + 5),
.columns-5.products-custom-grid .product-item:nth-child(15n + 9),
.columns-5.products-custom-grid .product-item:nth-child(15n + 12),
.columns-5.products-custom-grid .product-item:nth-child(15n + 15) {
    display: flex;
    align-items: flex-end;
}

/* Columns 4 */
.columns-4.products-custom-grid .product-item {
    break-inside: avoid;
    width: calc(100% / 5);
}

.columns-4.products-custom-grid .product-item:nth-child(12n + 5),
.columns-4.products-custom-grid .product-item:nth-child(12n + 2) {
    width: calc((100% / 5) * 1.5);
}

.columns-4.products-custom-grid .product-item:nth-child(12n + 1),
.columns-4.products-custom-grid .product-item:nth-child(12n + 4),
.columns-4.products-custom-grid .product-item:nth-child(12n + 7) {
    display: flex;
    align-items: flex-end;
}

/* Columns 3 */
.columns-3.products-custom-grid .product-item {
    break-inside: avoid;
    width: calc(100% / 4);

}

.columns-3.products-custom-grid .product-item:nth-child(9n + 4),
.columns-3.products-custom-grid .product-item:nth-child(9n + 2),
.columns-3.products-custom-grid .product-item:nth-child(9n + 8) {
    width: calc((100% / 4) * 1.5);
}

.columns-3.products-custom-grid .product-item:nth-child(9n + 1),
.columns-3.products-custom-grid .product-item:nth-child(9n + 3),
.columns-3.products-custom-grid .product-item:nth-child(9n + 6),
.columns-3.products-custom-grid .product-item:nth-child(9n + 9),
.columns-3.products-custom-grid .product-item:nth-child(9n + 12) {
    display: flex;
    align-items: flex-end;
}

/* Columns 2 */
.columns-2.products-custom-grid .product-item {
    break-inside: avoid;
    width: calc(100% / 3);
}

.columns-2.products-custom-grid .product-item:nth-child(6n + 3),
.columns-2.products-custom-grid .product-item:nth-child(6n + 1) {
    width: calc((100% / 3) * 1.5);
}

.columns-2.products-custom-grid .product-item:nth-child(6n + 2),
.columns-2.products-custom-grid .product-item:nth-child(6n + 5) {
    display: flex;
    align-items: flex-end;
}

/* Columns 1 */
.columns-1.products-custom-grid .product-item {
    break-inside: avoid;
    width: 100%;
}
/* ===== RESPONSIVE LAPTOP ===== */
@media (max-width: 1440px) {
    
}

/* ===== RESPONSIVE TABLET ===== */
@media (max-width: 1024px) {
        /* Empêche les produits d'être coupés entre les colonnes */
        .columns-tablet-extra-5.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 6 );
        }

        /* Styles pour les produits avec la classe "large" */
        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 7),
        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 3),
        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 13) {
            width: calc((100% / 6) * 1.5);
        }

        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 2),
        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 5),
        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 9),
        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 12),
        .columns-tablet-extra-5.products-custom-grid .product-item:nth-child(15n + 15) {
            display: flex;
            align-items: flex-end;
        }

        /* Columns 4 */
        .columns-tablet-extra-4.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 5);
        }

        .columns-tablet-extra-4.products-custom-grid .product-item:nth-child(12n + 5),
        .columns-tablet-extra-4.products-custom-grid .product-item:nth-child(12n + 2) {
            width: calc((100% / 5) * 1.5);
        }

        .columns-tablet-extra-4.products-custom-grid .product-item:nth-child(12n + 1),
        .columns-tablet-extra-4.products-custom-grid .product-item:nth-child(12n + 4),
        .columns-tablet-extra-4.products-custom-grid .product-item:nth-child(12n + 7) {
            display: flex;
            align-items: flex-end;
        }

        /* Columns 3 */
        .columns-tablet-extra-3.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 4);

        }

        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 4),
        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 2),
        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 8) {
            width: calc((100% / 4) * 1.5);
        }

        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 1),
        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 3),
        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 6),
        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 9),
        .columns-tablet-extra-3.products-custom-grid .product-item:nth-child(9n + 12) {
            display: flex;
            align-items: flex-end;
        }

        /* Columns 2 */
        .columns-tablet-extra-2.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 3);
        }

        .columns-tablet-extra-2.products-custom-grid .product-item:nth-child(6n + 3),
        .columns-tablet-extra-2.products-custom-grid .product-item:nth-child(6n + 1) {
            width: calc((100% / 3) * 1.5);
        }

        .columns-tablet-extra-2.products-custom-grid .product-item:nth-child(6n + 2),
        .columns-tablet-extra-2.products-custom-grid .product-item:nth-child(6n + 5) {
            display: flex;
            align-items: flex-end;
        }

        /* Columns 1 */
        .columns-tablet-extra-1.products-custom-grid .product-item {
            break-inside: avoid;
            width: 100% !important;
        }
}

/* ===== RESPONSIVE MOBILE EXTRA ===== */
@media (max-width: 767px) {
            /* Empêche les produits d'être coupés entre les colonnes */
        .columns-mobile-extra-5.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 5);
        }

        /* Styles pour les produits avec la classe "large" */
        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 7),
        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 3),
        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 13) {
            width: calc(100% / 5);
        }

        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 2),
        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 5),
        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 9),
        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 12),
        .columns-mobile-extra-5.products-custom-grid .product-item:nth-child(15n + 15) {
            display: flex;
            align-items: flex-start;
            width: calc(100% / 5);
        }

        /* Columns 4 */
        .columns-mobile-extra-4.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 4);
        }

        .columns-mobile-extra-4.products-custom-grid .product-item:nth-child(12n + 5),
        .columns-mobile-extra-4.products-custom-grid .product-item:nth-child(12n + 2) {
            width: calc(100% / 4);
        }

        .columns-mobile-extra-4.products-custom-grid .product-item:nth-child(12n + 1),
        .columns-mobile-extra-4.products-custom-grid .product-item:nth-child(12n + 4),
        .columns-mobile-extra-4.products-custom-grid .product-item:nth-child(12n + 7) {
             width: calc(100% / 4);
            display: flex;
            align-items: flex-start;
        }

        /* Columns 3 */
        .columns-mobile-extra-3.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 3);

        }

        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 4),
        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 2),
        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 8) {
            width: calc(100% / 3);
        }

        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 1),
        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 3),
        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 6),
        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 9),
        .columns-mobile-extra-3.products-custom-grid .product-item:nth-child(9n + 12) {
            width: calc(100% / 3);
            display: flex;
            align-items: flex-start;
        }

        /* Columns 2 */
        .columns-mobile-extra-2.products-custom-grid .product-item {
            break-inside: avoid;
            width: calc(100% / 2);
            display: flex;
            align-items: flex-start;
        }

        .columns-mobile-extra-2.products-custom-grid .product-item:nth-child(6n + 3),
        .columns-mobile-extra-2.products-custom-grid .product-item:nth-child(6n + 1),
        .columns-mobile-extra-2.products-custom-grid .product-item:nth-child(9n + 1),
        .columns-mobile-extra-2.products-custom-grid .product-item:nth-child(9n + 9) {
            width: calc(100% / 2);
            display: flex;
            align-items: flex-start;
        }

        .columns-mobile-extra-2.products-custom-grid .product-item:nth-child(6n + 2),
        .columns-mobile-extra-2.products-custom-grid .product-item:nth-child(6n + 5),
        .columns-mobile-extra-2.products-custom-grid .product-item:nth-child(9n + 4) {
            display: flex;
            align-items: flex-start;
            width: calc(100% / 2);
        }

        /* Columns 1 */
        .columns-mobile-extra-1.products-custom-grid .product-item {
            break-inside: avoid;
            width: 100% !important;
        }
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 480px) {
    /* Empêche les produits d'être coupés entre les colonnes */
    .columns-mobile-5.products-custom-grid .product-item {
        break-inside: avoid;
        width: calc(100% / 6 );
    }

    /* Styles pour les produits avec la classe "large" */
    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 7),
    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 3),
    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 13) {
        width: calc((100% / 5) );
        display: flex;
            align-items: flex-start;
    }

    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 2),
    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 5),
    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 9),
    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 12),
    .columns-mobile-5.products-custom-grid .product-item:nth-child(15n + 15) {
        display: flex;
        align-items: flex-start;
        width: calc(100% / 5);
    }

    /* Columns 4 */
    .columns-mobile-4.products-custom-grid .product-item {
        break-inside: avoid;
        width: calc(100% / 4);
    }

    .columns-mobile-4.products-custom-grid .product-item:nth-child(12n + 5),
    .columns-mobile-4.products-custom-grid .product-item:nth-child(12n + 2) {
        width: calc(100% / 4);
    }

    .columns-mobile-4.products-custom-grid .product-item:nth-child(12n + 1),
    .columns-mobile-4.products-custom-grid .product-item:nth-child(12n + 4),
    .columns-mobile-4.products-custom-grid .product-item:nth-child(12n + 7) {
        display: flex;
        align-items: flex-start;
        width: calc(100% / 4);
    }

    /* Columns 3 */
    .columns-mobile-3.products-custom-grid .product-item {
        break-inside: avoid;
        width: calc(100% / 3);

    }

    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 4),
    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 2),
    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 8) {
        width: calc(100% / 3);
    }

    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 1),
    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 3),
    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 6),
    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 9),
    .columns-mobile-3.products-custom-grid .product-item:nth-child(9n + 12) {
        display: flex;
        align-items: flex-start;
        width: calc(100% / 3);
    }

    /* Columns 2 */
    .columns-mobile-2.products-custom-grid .product-item {
        break-inside: avoid;
        width: calc(100% / 2);
    }

    .columns-mobile-2.products-custom-grid .product-item:nth-child(6n + 3),
    .columns-mobile-2.products-custom-grid .product-item:nth-child(6n + 1) {
        width: calc(100% / 2);
    }

    .columns-mobile-2.products-custom-grid .product-item:nth-child(6n + 2),
    .columns-mobile-2.products-custom-grid .product-item:nth-child(6n + 5) {
        display: flex;
        align-items: flex-start;
        width: calc(100% / 2);
    }

    /* Columns 1 */
    .columns-mobile-1.products-custom-grid .product-item {
        break-inside: avoid;
        width: 100% !important;
    }
}


/* Pagination */
.products-pagination {
    margin-top: 3rem;
    text-align: center;
}

.products-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.products-pagination li {
    margin: 0;
}

.products-pagination a,
.products-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #000;
    background: transparent;
    color: #000;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 400;
}

.products-pagination a:hover {
    background-color: #000;
    color: #fff;
}

.products-pagination .current {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.products-pagination .dots {
    border: none;
    pointer-events: none;
}

.pagination-prev,
.pagination-next {
    font-size: 18px;
}
