/* KMS — standaard fotoweergave (zie js/kms-photo.js en <KmsPhotoLink>).
   Een native <dialog> in de top layer: ligt boven alles, vangt de focus en sluit met Esc. */

html.kms-photo-open {
    overflow: hidden;
}

dialog.kms-photo {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f1f5f9;
    overflow: hidden;
}

dialog.kms-photo::backdrop {
    background: rgba(15, 23, 42, 0.88);
}

.kms-photo__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 56px 72px;
    cursor: zoom-out;
}

.kms-photo__img {
    display: block;
    min-height: 0;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    cursor: default;
}

.kms-photo__caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
    max-width: 100%;
    font-size: 0.875rem;
    line-height: 1.4;
    cursor: default;
}

.kms-photo__count {
    color: #94a3b8;
}

.kms-photo__download {
    color: #fff;
    text-decoration: underline;
}

.kms-photo__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}

.kms-photo__btn:hover {
    background: rgba(255, 255, 255, 0.26);
}

.kms-photo__btn:focus-visible,
.kms-photo__download:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.kms-photo__btn[hidden],
.kms-photo__download[hidden] {
    display: none;
}

.kms-photo__close {
    top: 12px;
    right: 12px;
}

.kms-photo__prev,
.kms-photo__next {
    top: 50%;
    transform: translateY(-50%);
}

.kms-photo__prev {
    left: 12px;
}

.kms-photo__next {
    right: 12px;
}

/* Klikbare foto's in de pagina zelf: laat zien dat er een grotere versie is. */
a[data-kms-photo] {
    cursor: zoom-in;
}

/* De link om de hoofdfoto van de productpagina mag de opmaak van de foto niet verstoren. */
.sf-gallery__main a[data-kms-photo] {
    display: contents;
}

@media (max-width: 600px) {
    .kms-photo__stage {
        padding: 56px 8px 72px;
    }

    .kms-photo__prev,
    .kms-photo__next {
        top: auto;
        bottom: 12px;
        transform: none;
    }

    .kms-photo__prev {
        left: calc(50% - 52px);
    }

    .kms-photo__next {
        right: calc(50% - 52px);
    }
}
