.lightbox {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    overscroll-behavior: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox__stage {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top))
             max(16px, env(safe-area-inset-right))
             max(16px, env(safe-area-inset-bottom))
             max(16px, env(safe-area-inset-left));
}

.lightbox__media {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__img {
    display: block;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    object-fit: contain;
    width: auto;
    height: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-md);
}

.lightbox__iframe,
.lightbox__video {
    width: min(960px, calc(100vw - 32px));
    height: min(540px, 70vh);
    max-width: 100%;
    border: 0;
    background: #000;
    border-radius: var(--radius-md);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox__close {
    top: 16px;
    right: 16px;
    font-size: 1.25rem;
}

.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__nav--prev {
    left: 16px;
}

.lightbox__nav--next {
    right: 16px;
}

.lightbox__nav svg {
    width: 22px;
    height: 22px;
}

.lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 999px;
}

.product-gallery__main {
    cursor: zoom-in;
}

.product-gallery__main--video {
    cursor: default;
}

@media (min-width: 768px) {
    .lightbox__close,
    .lightbox__nav {
        width: 48px;
        height: 48px;
    }
}
