/* Container principal */
.flip-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Carousel avec overflow visible pour l'effet flip */
.flip-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    padding: 20px 0;
    scrollbar-width: thin;
}

/* Cache la scrollbar mais garde la fonctionnalité */
.flip-carousel::-webkit-scrollbar {
    height: 5px;
}

.flip-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.flip-carousel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

/* Slides */
.carousel-slide {
    flex: 0 0 300px; /* Largeur fixe de chaque slide */
    scroll-snap-align: start;
    perspective: 1000px; /* Essentiel pour l'effet 3D */
}

/* Flip card */
.flip-card {
    position: relative;
    width: 100%;
    height: 350px; /* Hauteur fixe */
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

/* Effet flip au survol */
.flip-card:hover {
    transform: rotateY(180deg);
}

/* Style commun pour face avant/arrière */
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Face avant */
.flip-card-front {
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flip-card-front img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.flip-card-front h3 {
    margin: 10px 0;
    color: #333;
}

/* Face arrière */
.flip-card-back {
    background: #f5eb12;
    color: black;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.flip-card-back h3 {
    margin-bottom: 10px;
    color: black;
}

.flip-card-back p {
    font-size: 14px;
    line-height: 1.5;
}

/* Flèches de navigation */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 20px;
    transition: background 0.3s;
}

.carousel-arrow:hover {
    background: rgba(0,0,0,0.8);
}

.carousel-prev {
    left: -20px;
}

.carousel-next {
    right: -20px;
}

/* Dots de pagination */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: #4a90e2;
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-slide {
        flex: 0 0 250px;
    }
    
    .flip-card {
        height: 300px;
    }
    
    .carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}