/* Carousel Prestations */
.prestations-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    max-width: var(--max-width, 1400px);
    margin: 0 auto 60px;
    padding: 0 20px;
}

.carousel-nav {
    display: flex;
    gap: 16px;
}

.carousel-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color, #F8F9FA);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

.carousel-btn svg {
    transition: transform 0.3s ease;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.carousel-container {
    width: 100%;
    position: relative;
    /* Optional edge fade */
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.carousel-track {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 40px;
    padding-right: 80px;
    /* Ensure last cards aren't cut off */
    scroll-padding-left: calc((100vw - var(--max-width, 1400px)) / 2 + 20px);
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-stop: always;
}

/* Fallback for very small padding calc */
@media (max-width: 1440px) {
    .carousel-track {
        padding-left: 20px;
        scroll-padding-left: 20px;
    }
}

.carousel-track:active {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    min-width: 380px;
    width: 400px;
    flex-shrink: 0;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface-color, #1A1A1E);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 420px;
    /* Reduced from 500px */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.4s ease, border-color 0.4s ease;
    padding: 48px 32px 32px;
    /* Slightly reduced padding */
    scroll-snap-align: center;
    scroll-snap-stop: always;
    will-change: transform, opacity;
}

.carousel-content {
    position: relative;
    z-index: 2;
    /* We can keep it static or move it up on hover */
}

.carousel-content h3 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--text-color, #F8F9FA);
    font-weight: 600;
    min-height: 4.5rem;
    /* Forces consistent space for 2 lines */
}

.carousel-desc {
    color: var(--text-secondary, #94A3B8);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
    opacity: 0.8;
    min-height: 3.2rem;
    /* Forces 2-line height for alignment */
}

.carousel-services {
    margin-top: 20px;
    opacity: 1;
    visibility: visible;
    max-height: 250px;
}

.carousel-services li {
    font-size: 0.95rem;
    padding-left: 20px;
    margin-bottom: 10px;
}

.carousel-services li::before {
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
}

@media (hover: none) and (pointer: coarse) {

    /* Touch devices specific optimizations */
    .carousel-card {
        /* Ensure touch interaction is silky smooth */
        transform: translateY(0) !important;
        border-color: rgba(255, 255, 255, 0.15);
    }
}

@media (max-width: 768px) {
    .prestations-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 40px;
        padding-left: 24px;
    }

    .carousel-nav {
        display: none;
    }

    .carousel-container {
        /* On prend toute la largeur de l'écran en annulant le padding de la section (20px typiquement) */
        width: 100vw;
        margin-left: -20px;
        margin-right: -20px;
        padding: 0;
        /* Désactivation du masque pour que les cartes sur les côtés soient bien visibles */
        -webkit-mask-image: none;
        mask-image: none;
        overflow-x: hidden;
    }

    .carousel-track {
        gap: 16px;
        padding-bottom: 24px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .carousel-card {
        min-width: calc(100vw - 60px);
        width: calc(100vw - 60px);
        height: auto;
        min-height: 360px;
        /* Reduced from 420px */
        /* Légèrement plus haut pour que tout le texte rentre */
        padding: 24px;
        border-radius: 20px;
        scroll-snap-align: center;
    }

    .carousel-content h3 {
        font-size: clamp(1.2rem, 6vw, 1.5rem);
        line-height: 1.25;
        letter-spacing: -0.01em;
        margin-bottom: 12px;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .carousel-desc {
        font-size: 0.95rem;
    }

    .carousel-services li {
        font-size: 0.9rem;
    }

    /* Désactiver les animations d'entrée lourdes sur mobile pour la fluidité du scroll */
    .carousel-card.staggered-item {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}