/* Styles pour le carousel "À découvrir" */

.discover-section {
    margin-bottom: 3rem;
    padding: 2rem 0 0 0; /* Ajout de padding-top pour éviter que le titre soit masqué sur mobile */
    width: 100vw; /* Prend toute la largeur de la fenêtre */
    overflow: hidden;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    /* Suppression de toute bordure et ajout de pleine largeur */
    max-width: 100vw;
    border: none;
}

.discover-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 2rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-behavior: smooth;
    width: 100%;
    touch-action: pan-x;
    /* Assurer que le carousel prend toute la largeur disponible */
    max-width: 100%;
    margin: 0;
    /* Ajout pour la boucle infinie */
    flex-wrap: nowrap;
}

.discover-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.discover-item::after {
    pointer-events: none;
}

.discover-item {
    flex: 0 0 auto;
    width: 220px;
    height: 280px; /* Hauteur réduite pour de meilleures proportions */
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Forme de feuille avec coins coupés et arrondis */
    clip-path: polygon(
        0 0, 
        calc(100% - 70px) 0, 
        100% 70px, 
        100% 100%, 
        70px 100%, 
        0 calc(100% - 70px)
    );
    border-radius: 15px;
    cursor: pointer;
}

.discover-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(65, 105, 225, 0.8);
    z-index: 10;
}

.discover-cover {
    width: 100%;
    height: 100%;
}

.discover-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.discover-item:hover .discover-cover img {
    transform: scale(1.1);
}

.discover-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Suppression des contrôles du carousel comme demandé */
.discover-controls {
    display: none;
}

/* Animation de surbrillance au survol améliorée */
.discover-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(65, 105, 225, 0) 0%, rgba(65, 105, 225, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.discover-item:hover::after {
    opacity: 1;
}

/* Effet de lumière bleue au survol */
.discover-item::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(65, 105, 225, 0.9) 0%, rgba(65, 105, 225, 0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.discover-item:hover::before {
    opacity: 0.8;
}

/* Script pour la boucle infinie injecté via JavaScript */
.discover-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 992px) {
    .discover-item {
        width: 200px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .discover-section {
        padding-top: 3rem; /* Plus de padding sur mobile */
    }
    
    .discover-item {
        width: 180px;
        height: 240px; /* Hauteur réduite pour de meilleures proportions */
        /* Ajuster la forme pour les écrans plus petits */
        clip-path: polygon(
            0 0, 
            calc(100% - 50px) 0, 
            100% 50px, 
            100% 100%, 
            50px 100%, 
            0 calc(100% - 50px)
        );
    }
}

@media (max-width: 576px) {
    .discover-section {
        padding-top: 4rem; /* Encore plus de padding sur très petit écran */
    }
    
    .discover-item {
        width: 150px;
        height: 200px; /* Hauteur réduite pour de meilleures proportions */
        /* Ajuster la forme pour les écrans très petits */
        clip-path: polygon(
            0 0, 
            calc(100% - 30px) 0, 
            100% 30px, 
            100% 100%, 
            30px 100%, 
            0 calc(100% - 30px)
        );
    }
}
