/* Stretch automatique du slider à la hauteur de la colonne Divi voisine */
.et_pb_column:has(.rc-slider) {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    > .et_pb_module,
    > .et_pb_text,
    > .et_pb_code,
    > .et_pb_text_inner,
    > .et_pb_code_inner {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .et_pb_text_inner,
    .et_pb_code_inner {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
}

.rc-slider {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;

    .rc-slider__viewport {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: var(--color-primary, #373737);
        cursor: grab;
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;

        &.is-dragging {
            cursor: grabbing;
        }
    }

    /* Fallback : si le parent n'a pas de hauteur définie, on retombe sur l'aspect-ratio */
    &:not(.rc-slider--full) .rc-slider__viewport {
        aspect-ratio: var(--rc-slider-ratio, 16 / 9);
    }

    &.rc-slider--full {
        .rc-slider__viewport {
            aspect-ratio: auto;
        }
    }

    .rc-slider__track {
        display: flex;
        width: 100%;
        height: 100%;
        min-width: 0;
        transform: translate3d(0, 0, 0);
        transition: transform 0.6s ease;
        will-change: transform;

        .rc-slider__viewport.is-dragging & {
            transition: none;
        }
    }

    .rc-slider__slide {
        flex: 0 0 100%;
        width: 100%;
        height: 100%;
        min-width: 0;
        margin: 0;
        position: relative;
        overflow: hidden;

        img {
            width: 100%;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
            object-fit: cover;
            display: block;
            pointer-events: none;
            -webkit-user-drag: none;
        }
    }

    .rc-slider__dots {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: var(--s-medium, 1rem);
        display: flex;
        justify-content: center;
        align-items: center;
        gap: var(--s-small, 0.75rem);
        z-index: 2;
        pointer-events: none;
    }

    .rc-slider__dot {
        width: 10px;
        height: 10px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: var(--color-primary, #373737);
        cursor: pointer;
        pointer-events: auto;
        transition: background 0.25s ease, transform 0.25s ease;

        &.is-active {
            background: #C1B99B;
            transform: scale(1.2);
        }

        &:focus-visible {
            outline: 2px solid var(--color-tertiary);
            outline-offset: 3px;
        }
    }

    /* Responsive */
    @media (prefers-reduced-motion: reduce) {
        .rc-slider__track {
            transition: none;
        }
    }
}
