/* Voertuig Gallery — layout + styling driven by CSS variables set inline in ssr.php.
   The variables carry the values from the design panel; everything below is the
   default look, tuned for a professional vehicle gallery. */

.wm-vehicle-gallery {
    --wm-main-height: 480px;
    --wm-object-fit: cover;
    --wm-thumb-height: 80px;
    --wm-active-border: #E6007E;
    --wm-arrow-color: #ffffff;
    --wm-arrow-bg: rgba(0, 0, 0, 0.45);
    --wm-arrow-size: 44px;
    --wm-radius: 10px;
    --wm-gap: 12px;
    width: 100%;
    display: flex;
    gap: var(--wm-gap);
    box-sizing: border-box;
}

.wm-vehicle-gallery *,
.wm-vehicle-gallery *::before,
.wm-vehicle-gallery *::after {
    box-sizing: border-box;
}

/* --- Position: bottom (default) --- */
.wm-vehicle-gallery--pos-bottom {
    flex-direction: column;
}

/* --- Position: left / right --- */
.wm-vehicle-gallery--pos-left {
    flex-direction: row-reverse;
    align-items: stretch;
}
.wm-vehicle-gallery--pos-right {
    flex-direction: row;
    align-items: stretch;
}
.wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumbs-wrap,
.wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumbs-wrap {
    width: calc(var(--wm-thumb-height) + 16px);
    flex: 0 0 auto;
}
.wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumbs,
.wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumbs {
    width: 100%;
    height: 100%;
}

/* --- Position: overlay --- */
.wm-vehicle-gallery--pos-overlay {
    flex-direction: column;
    position: relative;
}
/* The whole thumbnail wrap (strip + arrows) sits inside the main image, with equal
   spacing on both sides, so nothing spills outside the photo. */
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__main-wrap {
    position: relative;
}
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumbs-wrap {
    position: absolute;
    left: var(--wm-gap);
    right: var(--wm-gap);
    bottom: var(--wm-gap);
    z-index: 2;
    width: auto;
    padding: 6px 36px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--wm-radius);
    backdrop-filter: blur(4px);
}
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumbs {
    position: static;
    width: 100%;
}

/* --- Main image --- */
.wm-vehicle-gallery__main-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: var(--wm-radius);
    overflow: hidden;
}

.wm-vehicle-gallery__main {
    width: 100%;
    height: var(--wm-main-height);
    overflow: hidden;
    background: #f2f2f2;
}

/* When an aspect ratio is set, the main slider uses it instead of a fixed height. */
.wm-vehicle-gallery--main-ratio .wm-vehicle-gallery__main {
    height: auto;
    aspect-ratio: var(--wm-main-ratio);
}

.wm-vehicle-gallery__main .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2;
    overflow: hidden;
}

.wm-vehicle-gallery__image {
    width: 100%;
    height: var(--wm-main-height);
    display: block;
    object-fit: var(--wm-object-fit);
    object-position: var(--wm-main-pos);
    transition: transform 0.4s ease;
}

.wm-vehicle-gallery--main-ratio .wm-vehicle-gallery__image {
    height: 100%;
}

/* Subtle zoom hint on hover of the main image. */
.wm-vehicle-gallery__main .swiper-slide:hover .wm-vehicle-gallery__image {
    transform: scale(1.03);
}

/* --- Thumbnails --- */
.wm-vehicle-gallery__thumbs-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
}
.wm-vehicle-gallery--pos-bottom .wm-vehicle-gallery__thumbs-wrap {
    width: 100%;
}
.wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumbs-wrap,
.wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumbs-wrap {
    height: var(--wm-main-height);
    flex: 0 0 auto;
}

.wm-vehicle-gallery__thumbs {
    overflow: hidden;
}

.wm-vehicle-gallery--pos-bottom .wm-vehicle-gallery__thumbs,
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumbs {
    width: 100%;
    height: var(--wm-thumb-height);
}

.wm-vehicle-gallery__thumbs .swiper-slide {
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
    border-radius: calc(var(--wm-radius) - 4px);
    overflow: hidden;
    height: var(--wm-thumb-height);
    position: relative;
}

/* When a thumbnail aspect ratio is set, use it instead of the fixed height. The
   container must release its fixed height so the ratio can express itself, and the
   ratio needs to win over Swiper's inline slide height. */
.wm-vehicle-gallery--thumb-ratio.wm-vehicle-gallery--pos-bottom .wm-vehicle-gallery__thumbs,
.wm-vehicle-gallery--thumb-ratio.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumbs {
    height: auto;
}
.wm-vehicle-gallery--thumb-ratio .wm-vehicle-gallery__thumbs .swiper-slide {
    height: auto !important;
    aspect-ratio: var(--wm-thumb-ratio);
}

.wm-vehicle-gallery__thumbs .swiper-slide:hover {
    opacity: 0.85;
}

.wm-vehicle-gallery__thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--wm-active-border);
}

.wm-vehicle-gallery__thumb-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: var(--wm-thumb-fit);
    object-position: var(--wm-thumb-pos);
}

/* --- Arrows --- */
.wm-vehicle-gallery__prev,
.wm-vehicle-gallery__next {
    --swiper-navigation-size: calc(var(--wm-arrow-size) * 0.44);
    color: var(--wm-arrow-color);
    background: var(--wm-arrow-bg);
    width: var(--wm-arrow-size);
    height: var(--wm-arrow-size);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    transition: background 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}
.wm-vehicle-gallery__main-wrap:hover .wm-vehicle-gallery__prev,
.wm-vehicle-gallery__main-wrap:hover .wm-vehicle-gallery__next {
    opacity: 1;
}
.wm-vehicle-gallery__prev:hover,
.wm-vehicle-gallery__next:hover {
    background: var(--wm-active-border);
}
.wm-vehicle-gallery__prev { left: 12px; }
.wm-vehicle-gallery__next { right: 12px; }

.wm-vehicle-gallery__prev::after,
.wm-vehicle-gallery__next::after {
    font-size: calc(var(--wm-arrow-size) * 0.38);
    font-weight: 700;
}

/* Keep arrows visible on touch devices (no hover). */
@media (hover: none) {
    .wm-vehicle-gallery__prev,
    .wm-vehicle-gallery__next {
        opacity: 1;
    }
}

/* --- Thumbnail arrows --- */
.wm-vehicle-gallery__thumb-prev,
.wm-vehicle-gallery__thumb-next {
    position: absolute;
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--wm-arrow-bg);
    color: var(--wm-arrow-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.wm-vehicle-gallery__thumb-prev:hover,
.wm-vehicle-gallery__thumb-next:hover {
    background: var(--wm-active-border);
}
.wm-vehicle-gallery__thumb-prev::after,
.wm-vehicle-gallery__thumb-next::after {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}
.wm-vehicle-gallery__thumb-prev.swiper-button-disabled,
.wm-vehicle-gallery__thumb-next.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
}

/* Horizontal thumbnails (bottom/overlay): arrows left & right, chevrons sideways. */
.wm-vehicle-gallery--pos-bottom .wm-vehicle-gallery__thumb-prev,
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumb-prev {
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
}
.wm-vehicle-gallery--pos-bottom .wm-vehicle-gallery__thumb-next,
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumb-next {
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
}
.wm-vehicle-gallery--pos-bottom .wm-vehicle-gallery__thumb-prev::after,
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumb-prev::after {
    transform: rotate(-135deg);
    margin-left: 3px;
}
.wm-vehicle-gallery--pos-bottom .wm-vehicle-gallery__thumb-next::after,
.wm-vehicle-gallery--pos-overlay .wm-vehicle-gallery__thumb-next::after {
    transform: rotate(45deg);
    margin-right: 3px;
}

/* Vertical thumbnails (left/right): arrows top & bottom, chevrons up/down. */
.wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumb-prev,
.wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumb-prev {
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
}
.wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumb-next,
.wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumb-next {
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
}
.wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumb-prev::after,
.wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumb-prev::after {
    transform: rotate(-45deg);
    margin-top: 3px;
}
.wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumb-next::after,
.wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumb-next::after {
    transform: rotate(135deg);
    margin-bottom: 3px;
}

/* --- Pagination --- */
.wm-vehicle-gallery__pagination {
    --swiper-pagination-color: #ffffff;
    --swiper-pagination-bullet-inactive-color: #ffffff;
    --swiper-pagination-bullet-inactive-opacity: 0.5;
    --swiper-pagination-bullet-size: 9px;
}

/* --- Empty state --- */
.wm-vehicle-gallery__empty {
    padding: 2rem;
    text-align: center;
    color: #595959;
    background: #f2f2f2;
    border-radius: var(--wm-radius);
    width: 100%;
}

/* --- Responsive: side thumbnails drop under the image on small screens --- */
@media (max-width: 767px) {
    .wm-vehicle-gallery--pos-left,
    .wm-vehicle-gallery--pos-right {
        flex-direction: column;
    }
    .wm-vehicle-gallery--pos-left .wm-vehicle-gallery__thumbs,
    .wm-vehicle-gallery--pos-right .wm-vehicle-gallery__thumbs {
        width: 100%;
        height: var(--wm-thumb-height);
    }
    .wm-vehicle-gallery {
        --wm-main-height: 320px;
    }
}

/* --- Lightbox --- */
.wm-vehicle-gallery__lightbox {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}
.wm-vehicle-gallery--main-ratio .wm-vehicle-gallery__lightbox {
    height: 100%;
}
