.wpfb-lightbox-wrapper {
    position: relative;
}

.wpfb-lightbox-trigger img {
    display: block;
    max-width: 100%;
    cursor: pointer;
}

.wpfb-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
}

.wpfb-lightbox-overlay.open {
    display: flex;
}

.wpfb-lightbox-panel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 95vh;
    background: #111;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 12px;
    overflow: hidden;
}

.wpfb-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.wpfb-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.wpfb-lightbox-flipbook {
    width: 100%;
    height: calc(95vh - 64px);
    min-height: 360px;
}

body.wpfb-lightbox-open {
    overflow: hidden;
}

/* Reset image/figure margins inside lightbox flipbook to avoid horizontal gaps */
.wpfb-lightbox-flipbook .wpfb-page,
.wpfb-lightbox-flipbook .wpfb-page > figure,
.wpfb-lightbox-flipbook .wpfb-page > figure > img {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wpfb-lightbox-flipbook .wpfb-page img {
    display: block;
    width: 100%;
    height: auto;
}
