.lbm-pl-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lbm-pl-modal.is-open {
    display: flex;
}

.lbm-pl-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.lbm-pl-dialog {
    position: relative;
    width: var(--lbm-pl-popup-width, 80vw);
    max-height: var(--lbm-pl-popup-max-height, 90vh);
    overflow: auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
    z-index: 2;
    box-sizing: border-box;
}

.lbm-pl-dialog.lbm-pl-no-scroll-inner {
    overflow: hidden;
}

.lbm-pl-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.46);
    color: #ffffff;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    backdrop-filter: blur(6px);
}

.lbm-pl-close:hover,
.lbm-pl-close:focus {
    background: rgba(0, 0, 0, 0.72);
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.lbm-pl-image-wrap {
    line-height: 0;
    background: #ffffff;
    text-align: center;
}

.lbm-pl-image-link {
    display: block;
    line-height: 0;
    text-decoration: none !important;
}

.lbm-pl-image-link:focus {
    outline: 3px solid rgba(0, 94, 51, 0.35);
    outline-offset: -3px;
}

.lbm-pl-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px 14px 0 0;
}

.lbm-pl-auto-fit .lbm-pl-image,
.lbm-pl-image-only .lbm-pl-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(var(--lbm-pl-popup-max-height, 90vh) - 4px);
    object-fit: contain;
    margin: 0 auto;
}

.lbm-pl-image-only .lbm-pl-image {
    border-radius: 14px;
}

.lbm-pl-has-button.lbm-pl-auto-fit .lbm-pl-image {
    max-height: calc(var(--lbm-pl-popup-max-height, 90vh) - 82px);
    border-radius: 14px 14px 0 0;
}

.lbm-pl-body {
    padding: 24px;
    color: #222222;
    font-family: inherit;
}

.lbm-pl-body-actions-only {
    padding: 16px 20px 20px;
    text-align: center;
}

.lbm-pl-title {
    margin: 0 0 12px;
    color: inherit;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.2;
}

.lbm-pl-content {
    font-size: 1rem;
    line-height: 1.6;
}

.lbm-pl-content p:first-child {
    margin-top: 0;
}

.lbm-pl-content p:last-child {
    margin-bottom: 0;
}

.lbm-pl-actions {
    margin-top: 20px;
}

.lbm-pl-body-actions-only .lbm-pl-actions {
    margin-top: 0;
}

.lbm-pl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: #005e33;
    color: #ffffff !important;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.lbm-pl-button:hover,
.lbm-pl-button:focus {
    opacity: 0.92;
    transform: translateY(-1px);
    outline: 2px solid rgba(0, 94, 51, 0.3);
    outline-offset: 2px;
}

body.lbm-pl-no-scroll {
    overflow: hidden;
}

.lbm-pl-lightbox-frame,
.lbm-pl-lightbox-image {
    display: block;
    width: 100%;
    border: 0;
}

.lbm-pl-lightbox-frame {
    min-height: min(78vh, 760px);
}

.lbm-pl-lightbox-image {
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    background: #ffffff;
}

.lbm-pl-lightbox-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .lbm-pl-modal {
        padding: 10px;
        align-items: center;
    }

    .lbm-pl-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 92vh;
        border-radius: 12px;
    }

    .lbm-pl-image,
    .lbm-pl-image-only .lbm-pl-image {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 12px;
    }

    .lbm-pl-has-button.lbm-pl-auto-fit .lbm-pl-image {
        max-height: calc(92vh - 78px);
    }

    .lbm-pl-body {
        padding: 20px 16px;
    }

    .lbm-pl-body-actions-only {
        padding: 14px 14px 16px;
    }

    .lbm-pl-button {
        width: 100%;
    }
}

/* v1.1.1 - Largura automática fina: o popup abraça a imagem. */
.lbm-pl-dialog.lbm-pl-auto-width {
    width: fit-content !important;
    max-width: min(95vw, 1100px) !important;
}

.lbm-pl-dialog.lbm-pl-auto-width .lbm-pl-image-wrap,
.lbm-pl-dialog.lbm-pl-auto-width .lbm-pl-image-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.lbm-pl-dialog.lbm-pl-auto-width .lbm-pl-image {
    width: auto !important;
    max-width: min(95vw, 1100px);
    height: auto !important;
    object-fit: contain;
    margin: 0 auto;
}

.lbm-pl-dialog.lbm-pl-auto-width.lbm-pl-image-only .lbm-pl-image {
    max-height: calc(var(--lbm-pl-popup-max-height, 90vh) - 4px);
}

.lbm-pl-dialog.lbm-pl-auto-width.lbm-pl-has-button .lbm-pl-image {
    max-height: calc(var(--lbm-pl-popup-max-height, 90vh) - 94px);
}

.lbm-pl-dialog.lbm-pl-auto-width .lbm-pl-body-actions-only {
    width: auto;
    padding: 16px 18px 20px;
}

.lbm-pl-dialog.lbm-pl-auto-width .lbm-pl-close {
    top: 12px;
    right: 12px;
}

@media (max-width: 600px) {
    .lbm-pl-dialog.lbm-pl-auto-width {
        width: fit-content !important;
        max-width: 95vw !important;
    }

    .lbm-pl-dialog.lbm-pl-auto-width .lbm-pl-image {
        max-width: 95vw;
    }

    .lbm-pl-dialog.lbm-pl-auto-width.lbm-pl-has-button .lbm-pl-image {
        max-height: calc(92vh - 86px);
    }
}
