/*
 * Vloershop Core — Productgalerij (.vs-gallery).
 * Verticale thumbnails links + grote hoofdfoto rechts (vloerenmarkt-stijl).
 * Theme-resistant: button-reset + !important op kritieke layout.
 */

.vs-gallery,
.vs-gallery * {
    box-sizing: border-box;
}

.vs-gallery {
    --vs-gallery-gap: 14px;
    --vs-gallery-thumb-w: 84px;
    --vs-gallery-radius: 10px;
    --vs-gallery-active: var(--vs-color-primary, #2a3065);
    --vs-gallery-border: #e5e7eb;

    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: var(--vs-gallery-gap) !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ---- Thumbnail-strip ---- */
.vs-gallery__thumbs {
    flex: 0 0 var(--vs-gallery-thumb-w) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: none;
}

/* Bij 0 of 1 afbeelding verbergen we de strip — anders blijft een lege rail
   van 84px ruimte innemen en wordt de hoofdfoto onnodig klein.
   (De oude :only-child-selector matchte nooit: de strip heeft altijd de
   hoofdfoto als sibling.) */
.vs-gallery__thumbs:empty,
.vs-gallery__thumbs:not(:has(> :nth-child(2))) {
    display: none !important;
}

.vs-gallery button.vs-gallery__thumb,
.vs-gallery__thumb {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    aspect-ratio: 1 / 1;
    overflow: hidden !important;
    background: #fff !important;
    border: 2px solid var(--vs-gallery-border) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: border-color 0.15s ease !important;
}

.vs-gallery__thumb:hover {
    border-color: #c7ccd8 !important;
}

.vs-gallery__thumb.is-active {
    border-color: var(--vs-gallery-active) !important;
}

.vs-gallery__thumb-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* ---- Hoofdfoto ---- */
.vs-gallery__main {
    position: relative !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    border-radius: var(--vs-gallery-radius) !important;
    overflow: hidden !important;
    background: #fff !important;
}

.vs-gallery button.vs-gallery__main-btn,
.vs-gallery__main-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: var(--vs-gallery-radius) !important;
    box-shadow: none !important;
    cursor: zoom-in !important;
    overflow: hidden !important;
}

.vs-gallery__main-img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover !important;
}

.vs-gallery__zoom-hint {
    position: absolute !important;
    right: 12px !important;
    bottom: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 12px !important;
    font-family: 'Lato', system-ui, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1f2733 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) !important;
    pointer-events: none !important;
}

/* ---- Lightbox ---- */
.vs-gallery-lightbox {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    background: rgba(15, 18, 25, 0.88) !important;
}

.vs-gallery-lightbox.is-open {
    display: flex !important;
}

.vs-gallery-lightbox__img {
    max-width: 92vw !important;
    max-height: 92vh !important;
    border-radius: 8px !important;
    object-fit: contain !important;
}

.vs-gallery-lightbox__close {
    position: absolute !important;
    top: 18px !important;
    right: 22px !important;
    width: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 30px !important;
    line-height: 1 !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

/* ---- Mobiel: thumbs onder de hoofdfoto, horizontaal ---- */
@media (max-width: 768px) {
    .vs-gallery {
        flex-direction: column-reverse !important;
    }

    .vs-gallery__thumbs {
        flex: 0 0 auto !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: 100% !important;
        overflow-x: auto !important;
    }

    .vs-gallery__thumb {
        flex: 0 0 64px !important;
        width: 64px !important;
    }
}
