.popup-ad-root {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: clamp(18px, 3vw, 38px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
}

.popup-ad-root[hidden] {
    display: none;
}

.popup-ad-root.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-ad-root.is-closing {
    opacity: 0;
}

.popup-ad-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.75);
}

.popup-ad-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 920px);
    max-height: min(88vh, 860px);
    overflow: hidden;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
    color: #1f2933;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.28s ease;
}

.popup-ad-root.is-visible .popup-ad-dialog {
    transform: translateY(0) scale(1);
}

.popup-ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(20, 24, 31, 0.92);
    color: #ffffff;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 0;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.popup-ad-close::before {
    content: "×";
    display: block;
    transform: translateY(-1px);
}

.popup-ad-image {
    width: 100%;
    max-height: 72vh;
    object-fit: cover;
}

.popup-ad-content {
    padding: clamp(18px, 3vw, 30px);
    text-align: center;
}

.popup-ad-content h2 {
    margin: 0;
    color: #173f2b;
    font-size: clamp(1.45rem, 2.6vw, 2.25rem);
    line-height: 1.15;
}

.popup-ad-content p {
    max-width: 680px;
    margin: 10px auto 0;
    color: #56616c;
    font-size: 1rem;
    line-height: 1.65;
}

.popup-ad-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: 18px;
    padding: 12px 24px;
    border-radius: 999px;
    background: #2f6b3b;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(47, 107, 59, 0.22);
}

.popup-ad-video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.popup-ad-video iframe,
.popup-ad-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

body.popup-ad-lock {
    overflow: hidden !important;
}

@media (max-width: 768px) {
    .popup-ad-root {
        padding: 14px;
        align-items: center;
    }

    .popup-ad-dialog {
        width: 90vw;
        max-height: 84vh;
        border-radius: 12px;
    }

    .popup-ad-image {
        max-height: 58vh;
    }

    .popup-ad-content {
        padding: 18px;
    }

    .popup-ad-content h2 {
        font-size: 1.35rem;
    }

    .popup-ad-content p {
        font-size: 0.94rem;
    }
}
