.magezon-builder a.mgz-magnific[data-type="image"] {
    cursor: zoom-in;
}

body.rr-mgz-lightbox-open {
    overflow: hidden !important;
}

.rr-mgz-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.rr-mgz-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rr-mgz-lightbox__backdrop,
.rr-mgz-lightbox__backdrop:hover,
.rr-mgz-lightbox__backdrop:focus {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.94);
    cursor: zoom-out;
    filter: none;
    transform: none;
}

.rr-mgz-lightbox__panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    width: 100%;
    height: 100%;
    gap: 14px;
}

.rr-mgz-lightbox__image {
    grid-column: 2;
    grid-row: 1;
    max-width: min(1180px, calc(100vw - 160px));
    max-height: calc(100vh - 112px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: #111;
    box-shadow:
        0 0 0 1px rgba(43, 209, 128, 0.22),
        0 24px 80px rgba(0, 0, 0, 0.65);
}

.rr-mgz-lightbox__close,
.rr-mgz-lightbox__nav {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(131, 255, 189, 0.28);
    background: rgba(4, 4, 4, 0.88);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    box-shadow: none;
    text-shadow: none;
    transform: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.rr-mgz-lightbox__close:hover,
.rr-mgz-lightbox__close:focus,
.rr-mgz-lightbox__nav:hover,
.rr-mgz-lightbox__nav:focus {
    border-color: rgba(43, 209, 128, 0.9);
    background: rgba(4, 4, 4, 0.92);
    color: #2bd180;
    filter: none;
    transform: none;
}

.rr-mgz-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}

.rr-mgz-lightbox__nav {
    width: 50px;
    height: 64px;
    border-radius: 8px;
    font-size: 30px;
    line-height: 1;
}

.rr-mgz-lightbox__nav--prev {
    grid-column: 1;
    grid-row: 1;
}

.rr-mgz-lightbox__nav--next {
    grid-column: 3;
    grid-row: 1;
}

.rr-mgz-lightbox__caption {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: min(900px, 92vw);
    color: #d9d9d9;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.rr-mgz-lightbox-open .page-header,
.rr-mgz-lightbox-open .panel.wrapper,
.rr-mgz-lightbox-open .header-panel-info {
    pointer-events: none !important;
}

@media (max-width: 767.98px) {
    .rr-mgz-lightbox {
        padding: 12px;
    }

    .rr-mgz-lightbox__panel {
        display: flex;
        flex-wrap: wrap;
        align-content: center;
        justify-content: center;
        align-items: center;
        gap: 10px 14px;
    }

    .rr-mgz-lightbox__image {
        order: 1;
        flex: 0 1 auto;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 160px);
        max-height: calc(100svh - 160px);
        border-radius: 6px;
    }

    .rr-mgz-lightbox__nav {
        order: 2;
        position: static;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        z-index: 2;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
        font-size: 26px;
        background: rgba(4, 4, 4, 0.72);
        transform: none;
    }

    .rr-mgz-lightbox__nav--prev {
        left: auto;
    }

    .rr-mgz-lightbox__nav--next {
        right: auto;
    }

    .rr-mgz-lightbox__close {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 3;
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }

    .rr-mgz-lightbox__caption {
        order: 3;
        flex: 0 0 100%;
        padding: 0 20px;
        font-size: 13px;
    }
}
