.spider-carousel-container {
    position: relative;
    width: 95%;
    max-width: 600px;
    margin: 2rem auto;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    aspect-ratio: 4 / 3; /* Hauteur proportionnelle à la largeur */
}

/* Pour navigateurs anciens sans "aspect-ratio" */
@supports not (aspect-ratio: 1) {
    .spider-carousel-container::before {
        content: "";
        display: block;
        padding-top: 75%; /* 3/4 = 75% → ratio 4:3 */
    }
    .spider-carousel-track {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

.spider-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spider-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
}

.spider-slide img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
    transition: opacity 0.3s ease;
}

/* Navigation - adaptée au mobile */
.spider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spider-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.spider-nav.prev { left: 12px; }
.spider-nav.next { right: 12px; }

/* Dots */
.spider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* Mobile first adjustments */
@media (max-width: 480px) {
    .spider-carousel-container {
        width: 96%;
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    }

    .spider-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
        left: 8px;
        right: 8px;
    }

    .spider-nav.prev { left: 8px; }
    .spider-nav.next { right: 8px; }

    .spider-dots {
        bottom: 12px;
    }

    .dot {
        width: 6px;
        height: 6px;
    }
}