/**
 * PM Product Gallery
 * Werkt volledig zelfstandig naast Elementor en WooCommerce.
 */
.pm-product-gallery,
.pm-product-gallery *,
.pm-gallery-lightbox,
.pm-gallery-lightbox * {
    box-sizing: border-box;
}

.pm-product-gallery {
    width: 100%;
    min-width: 0;
}

.pm-product-gallery button {
    font: inherit;
}

.pm-product-gallery .pm-gallery-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: clamp(360px, 42vw, 560px);
    overflow: hidden;
    padding: 20px;
    border: 1px solid #e2e8ed;
    border-radius: 12px;
    background: #ffffff;
}

.pm-product-gallery .pm-gallery-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.pm-product-gallery .pm-gallery-slide.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.pm-product-gallery .pm-gallery-slide img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pm-product-gallery .pm-gallery-slide[data-type="image"] img {
    cursor: zoom-in;
}

.pm-product-gallery .pm-gallery-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.pm-product-gallery .pm-thumbs {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.pm-product-gallery .pm-thumbs-track {
    display: flex;
    gap: 10px;
    transition: transform 250ms ease;
    will-change: transform;
}

.pm-product-gallery .pm-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 calc((100% - 30px) / 4);
    min-width: 0;
    height: 84px;
    margin: 0;
    padding: 8px !important;
    overflow: hidden;
    appearance: none;
    border: 1px solid #dbe4e9 !important;
    border-radius: 8px !important;
    outline: 0;
    background: #ffffff !important;
    box-shadow: none !important;
    cursor: pointer;
    opacity: .62;
    transition: border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.pm-product-gallery .pm-thumb:hover,
.pm-product-gallery .pm-thumb:focus-visible {
    border-color: #2797d3 !important;
    opacity: 1;
}

.pm-product-gallery .pm-thumb:focus-visible,
.pm-product-gallery .pm-arrow:focus-visible,
.pm-product-gallery .pm-gallery-zoom-btn:focus-visible {
    outline: 2px solid #2797d3 !important;
    outline-offset: 2px;
}

.pm-product-gallery .pm-thumb.active {
    border-color: #2797d3 !important;
    opacity: 1;
}

.pm-product-gallery .pm-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pm-product-gallery .pm-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px !important;
    height: 32px !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important;
    appearance: none;
    border: 1px solid #dbe4e9 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: none !important;
    color: #2797d3 !important;
    font-size: 26px !important;
    font-weight: 400;
    line-height: 1 !important;
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.pm-product-gallery .pm-arrow:hover,
.pm-product-gallery .pm-arrow:focus-visible {
    border-color: #2797d3 !important;
    color: #e88100 !important;
    transform: scale(1.04);
}

.pm-product-gallery .pm-gallery-static .pm-thumbs-track,
.pm-product-gallery.pm-gallery-static .pm-thumbs-track {
    justify-content: center;
}

.pm-product-gallery .pm-gallery-zoom-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important;
    appearance: none;
    border: 1px solid #dbe4e9 !important;
    border-radius: 50% !important;
    outline: 0;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 2px 10px rgba(25, 51, 65, .08) !important;
    color: #202a33 !important;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease;
}

.pm-product-gallery .pm-gallery-zoom-btn:hover {
    border-color: #2797d3 !important;
    transform: scale(1.05);
}

.pm-product-gallery .pm-gallery-zoom-btn svg {
    width: 16px;
    height: 16px;
}

.pm-product-gallery .pm-gallery-slide-video {
    padding: 0;
    background: #111111;
}

.pm-product-gallery .pm-gallery-video-cover {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 !important;
    overflow: hidden;
    appearance: none;
    border: 0 !important;
    border-radius: 0 !important;
    background: #111111 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.pm-product-gallery .pm-gallery-video-cover img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
}

.pm-product-gallery .pm-gallery-play,
.pm-product-gallery .pm-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .74);
    color: #ffffff;
    line-height: 1;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.pm-product-gallery .pm-gallery-play {
    width: 70px;
    height: 70px;
    padding-left: 4px;
    font-size: 28px;
}

.pm-product-gallery .pm-thumb-play {
    width: 28px;
    height: 28px;
    padding-left: 2px;
    font-size: 12px;
}

html.pm-lightbox-open,
body.pm-lightbox-open {
    overflow: hidden !important;
}

.pm-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background: rgba(0, 0, 0, .78);
}

.pm-gallery-lightbox.open {
    display: flex;
}

.pm-gallery-lightbox .pm-lightbox-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1200px, calc(100vw - 48px));
    height: min(820px, calc(100dvh - 48px));
    max-width: calc(100vw - 48px);
    max-height: calc(100dvh - 48px);
    padding: 18px;
    overflow: hidden;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.pm-gallery-lightbox .pm-lightbox-img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

.pm-gallery-lightbox .pm-lightbox-video {
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #000000;
}

.pm-gallery-lightbox .pm-lightbox-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.pm-gallery-lightbox button.pm-lightbox-close,
.pm-gallery-lightbox button.pm-lightbox-nav {
    position: absolute;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important;
    appearance: none;
    border: 0 !important;
    border-radius: 50% !important;
    outline: 0;
    background: rgba(255, 255, 255, .97) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22) !important;
    color: #202a33 !important;
    font-family: inherit !important;
    cursor: pointer;
}

.pm-gallery-lightbox button.pm-lightbox-close {
    top: 14px;
    right: 14px;
    width: 42px !important;
    height: 42px !important;
    font-size: 31px !important;
    font-weight: 300;
    line-height: 1 !important;
}

.pm-gallery-lightbox button.pm-lightbox-nav {
    top: 50%;
    width: 46px !important;
    height: 46px !important;
    font-size: 40px !important;
    font-weight: 300;
    line-height: 1 !important;
    transform: translateY(-50%);
}

.pm-gallery-lightbox button.pm-lightbox-close:hover,
.pm-gallery-lightbox button.pm-lightbox-close:focus-visible {
    transform: scale(1.05);
}

.pm-gallery-lightbox button.pm-lightbox-nav:hover,
.pm-gallery-lightbox button.pm-lightbox-nav:focus-visible {
    transform: translateY(-50%) scale(1.05);
}

.pm-gallery-lightbox .pm-lightbox-prev {
    left: 24px;
}

.pm-gallery-lightbox .pm-lightbox-next {
    right: 24px;
}

@media (max-width: 767px) {
    .pm-product-gallery .pm-gallery-main {
        height: clamp(300px, 90vw, 430px);
        padding: 14px;
        border-radius: 10px;
    }

    .pm-product-gallery .pm-gallery-slide {
        padding: 14px;
    }

    .pm-product-gallery .pm-thumb {
        height: 68px;
        padding: 6px !important;
    }

    .pm-product-gallery .pm-arrow {
        flex-basis: 28px;
        width: 28px !important;
        height: 28px !important;
        font-size: 23px !important;
    }

    .pm-gallery-lightbox {
        padding: 12px;
    }

    .pm-gallery-lightbox .pm-lightbox-inner {
        width: calc(100vw - 24px);
        height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
        padding: 12px;
        border-radius: 10px;
    }

    .pm-gallery-lightbox button.pm-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .pm-gallery-lightbox button.pm-lightbox-nav {
        width: 40px !important;
        height: 40px !important;
        font-size: 34px !important;
    }

    .pm-gallery-lightbox .pm-lightbox-prev {
        left: 12px;
    }

    .pm-gallery-lightbox .pm-lightbox-next {
        right: 12px;
    }
}
