.cursor-pointer {
    cursor: pointer;
}

.bestsellers-section {
    margin: 2rem 0;
}

.bestsellers-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.bestsellers-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.bestseller-item {
    flex: 0 0 auto;
    width: calc(16.666% - 1rem);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 350px; /* Hauteur fixe pour uniformiser */
}

.bestseller-image {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-grow: 1; /* Prend l'espace restant */
    width: 100%;
    order: 1; /* Place l'image en premier */
}

.bestseller-image img {
    width: 100%;
    height: auto;
    max-width: 220px;
    max-height: 260px;
    margin: 0 auto;
    display: block;
    object-fit: contain;
}

.no-image {
    width: 220px;
    height: 260px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin: 0 auto;
}

.bestseller-info {
    text-align: center;
    padding-top: 0;
    height: 50px; /* Hauteur fixe pour aligner tous les textes */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    order: 2; /* Place le texte en second */
}

.bestseller-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 400 !important;
    font-family: "Pontiac", Arial, sans-serif;
    max-width: 110px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}

.bestseller-title a {
    color: #333;
    text-decoration: none;
    transition: text-decoration 0.3s ease;
    font-weight: 400;
}

.bestseller-title a:hover,
.bestseller-item:hover .bestseller-title a {
    text-decoration: underline;
}

@media (max-width: 1023px) {
    .bestsellers-section {
        padding-bottom: 2rem;
        overflow: hidden; /* Empêche le scroll vertical */
    }

    .bestsellers-grid {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden; /* Empêche spécifiquement le scroll vertical */
        padding: 0 1rem 64px 1rem;
        gap: 1rem;
        scrollbar-width: thin;
        scrollbar-color: #4a7c59 #f0f0f0;
        align-items: flex-start; /* Aligne les items par le haut au lieu du centre */
    }

    .bestseller-item {
        min-width: 220px;
        width: 220px;
        flex-shrink: 0;
        height: 300px; /* Hauteur fixe pour uniformiser */
        display: flex;
        flex-direction: column;
    }

    .bestseller-image {
        margin-bottom: 0;
        flex-grow: 1; /* Prend l'espace restant */
        display: flex;
        align-items: flex-end; /* Aligne les images par le bas */
        justify-content: center;
        order: 1; /* Image en premier */
    }

    .bestseller-image img {
        max-height: 220px; /* Hauteur max fixe pour les images */
        width: auto;
        height: auto;
        max-width: 200px;
    }

    .no-image {
        height: 220px;
        max-height: 220px;
        width: 200px;
    }

    .bestseller-info {
        height: 50px; /* Hauteur fixe pour les textes */
        margin-top: 10px;
        flex-shrink: 0; /* Ne rétrécit pas */
        display: flex;
        align-items: flex-start; /* Aligne le texte par le haut */
        justify-content: center;
        order: 2; /* Texte en second */
    }

    .bestseller-title {
        margin: 0;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        text-align: center;
    }

    @media (max-width: 768px) {
        .bestseller-item {
            min-width: 200px;
            width: 200px;
            height: 280px; /* Hauteur fixe */
        }

        .bestseller-image img {
            max-height: 200px;
            max-width: 180px;
        }

        .no-image {
            height: 200px;
            width: 180px;
        }

        .bestseller-info {
            height: 45px;
        }
    }

    @media (max-width: 480px) {
        .bestseller-item {
            min-width: 180px;
            width: 180px;
            height: 260px; /* Hauteur fixe */
        }

        .bestseller-image img {
            max-height: 180px;
            max-width: 160px;
        }

        .no-image {
            height: 180px;
            width: 160px;
        }

        .bestseller-info {
            height: 40px;
        }

        .bestseller-title {
            font-size: 12px;
        }
    }
}

@media (min-width: 1024px) {
    .bestsellers-grid {
        flex-wrap: nowrap;
        justify-content: space-between;
        overflow-x: visible;
    }

    .bestseller-item {
        flex: 1 1 calc((100% - 5rem) / 6);
        min-width: 0;
        max-width: calc((100% - 5rem) / 6);
        height: 380px; /* Hauteur fixe pour desktop */
    }

    .bestseller-info {
        height: 60px; /* Hauteur plus grande pour desktop */
        margin-top: 20px;
    }

    .bestseller-image {
        margin-bottom: 0;
    }

    .bestseller-image img,
    .no-image {
        width: 100%;
        max-height: 280px;
        height: auto !important;
    }
}
