.nimbits-newsletter-popup {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nimbits-newsletter-popup.is-open {
    opacity: 1;
    visibility: visible;
}

.nimbits-newsletter-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.nimbits-newsletter-popup__dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.2);
}

.nimbits-newsletter-popup__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--bs-body-color, #212529);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.nimbits-newsletter-popup__close:hover,
.nimbits-newsletter-popup__close:focus {
    background: #fff;
    transform: scale(1.05);
}

.nimbits-newsletter-popup__content {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 280px;
}

.nimbits-newsletter-popup__content--no-image .nimbits-newsletter-popup__text {
    flex: 1 1 100%;
}

.nimbits-newsletter-popup__image {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    background: var(--bs-light, #f8f9fa);
    overflow: hidden;
}

.nimbits-newsletter-popup__image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
}

.nimbits-newsletter-popup__text {
    flex: 1 1 66.666%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 2.5rem 2rem 2rem;
    background: var(--bs-body-bg, #fff);
}

.nimbits-newsletter-popup__headline {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    line-height: 1.25;
}

.nimbits-newsletter-popup__body {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--bs-secondary-color, #6c757d);
}

.nimbits-newsletter-popup__button {
    align-self: flex-start;
    margin-top: 0.25rem;
}

body.nimbits-newsletter-popup-open {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .nimbits-newsletter-popup {
        padding: 0.75rem;
        align-items: center;
    }

    .nimbits-newsletter-popup__dialog {
        width: 100%;
        max-height: calc(100vh - 1.5rem);
        overflow-y: auto;
        border-radius: var(--bs-border-radius-lg, 0.5rem);
    }

    .nimbits-newsletter-popup__content {
        flex-direction: column;
        min-height: auto;
    }

    .nimbits-newsletter-popup__image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        height: 200px;
    }

    .nimbits-newsletter-popup__image img {
        width: 100%;
        height: 200px;
        min-height: 0;
        object-fit: cover;
    }

    .nimbits-newsletter-popup__text {
        flex: 1 1 auto;
        width: 100%;
        padding: 1.5rem 1.25rem 1.75rem;
        background: var(--bs-body-bg, #fff);
    }

    .nimbits-newsletter-popup__headline {
        font-size: 1.35rem;
    }

    .nimbits-newsletter-popup__body {
        color: var(--bs-body-color, #212529);
    }

    .nimbits-newsletter-popup__button {
        align-self: stretch;
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nimbits-newsletter-popup {
        transition: none;
    }
}
