.ride-gallery-section {
    max-width: 1180px;
    margin-inline: auto;
    padding: 18px 28px 46px;
}

.ride-gallery-heading {
    margin-bottom: 16px;
}

.ride-gallery-section .cab-viewer[data-cab-viewer] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-inline: auto;
}

.ride-gallery-section .viewer-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 430px;
    max-height: 620px;
    aspect-ratio: 16 / 9;
    box-sizing: border-box;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid var(--line, #d9dee3);
    border-radius: 20px;
}

.ride-gallery-section .viewer-stage > img[data-viewer-image] {
    display: block;
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    transform: none;
}

.ride-gallery-section .viewer-stage > video,
.ride-gallery-section .viewer-stage > iframe {
    display: block;
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.ride-gallery-section .viewer-stage > video { object-fit: contain; object-position: center; }
.ride-gallery-section .viewer-stage > iframe { object-fit: initial; }

.ride-gallery-section .viewer-stage > [hidden] {
    display: none !important;
}

.ride-gallery-section .viewer-caption {
    z-index: 4;
    left: 12px;
    right: 12px;
    bottom: 10px;
    padding: 6px 10px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    pointer-events: none;
}

.ride-gallery-section .stage-play {
    z-index: 5;
    pointer-events: none;
}

.ride-gallery-section .viewer-thumbs {
    display: flex;
    width: 100%;
    margin: 14px auto 0;
    padding: 0 2px;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.ride-gallery-section .viewer-thumbs::-webkit-scrollbar {
    display: none;
}

.ride-gallery-section .viewer-thumbs button {
    flex: 0 0 120px;
    width: 120px;
    height: 78px;
    padding: 0;
}

.ride-gallery-section .viewer-thumbs button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #FFFFFF;
}

.media-lightbox .lightbox-content {
    display: grid;
    place-items: center;
    overflow: hidden;
}

.media-lightbox .lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-lightbox .lightbox-content video,
.media-lightbox .lightbox-content iframe {
    display: block;
    width: min(100%, 1100px);
    height: min(76vh, 620px);
    border: 0;
    background: #000;
    object-fit: contain;
}

@media (max-width: 900px) {
    .ride-gallery-section .cab-viewer[data-cab-viewer] {
        width: 100%;
        max-width: 100%;
    }

    .ride-gallery-section .viewer-stage {
        height: auto;
        min-height: auto;
        max-height: none;
        aspect-ratio: 16 / 10;
    }
}

.ride-gallery-section .viewer-stage > img[data-viewer-image] { object-fit: contain !important; object-position: center; }
.ride-gallery-section .viewer-stage > video { object-fit: contain; object-position: center; background: #000; }
.ride-gallery-section .viewer-stage > iframe { width: 100% !important; height: 100% !important; }
.ride-gallery-section .viewer-stage > [hidden] { display: none !important; }
.ride-gallery-section .viewer-stage > :is(img[data-viewer-image], video, iframe):not([hidden]) { min-width: 0; min-height: 0; }
.ride-gallery-section .viewer-stage.vehicle-image-stage{display:grid;place-items:center;height:auto;aspect-ratio:16/10;padding:clamp(10px,2vw,24px);background:#fff}
.ride-gallery-section .viewer-stage.vehicle-image-stage > img[data-viewer-image]{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;transform:none!important;margin:auto;padding:0}
.ride-gallery-section .viewer-stage.vehicle-image-stage > video,.ride-gallery-section .viewer-stage.vehicle-image-stage > iframe{position:absolute;inset:0;grid-area:auto;width:100%!important;height:100%!important;max-width:none;max-height:none}

@media (max-width: 600px) {
    .ride-gallery-section {
        padding: 14px 12px 38px;
    }

    .ride-gallery-section .cab-viewer[data-cab-viewer] {
        width: 100%;
        max-width: none;
    }

    .ride-gallery-section .viewer-stage { border-radius: 14px; }

    .ride-gallery-section .viewer-thumbs {
        gap: 8px;
    }

    .ride-gallery-section .viewer-thumbs button {
        flex-basis: 92px;
        width: 92px;
        height: 62px;
    }

    .media-lightbox .lightbox-content video,
    .media-lightbox .lightbox-content iframe {
        height: min(70vh, 420px);
    }
}
