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

.ad-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.56);
}

.ad-popup__dialog {
    position: relative;
    width: min(100%, 640px);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.ad-popup__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--color-navy);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}

.ad-popup__label {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 2;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #6b7280;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ad-popup__media,
.ad-popup picture,
.ad-popup img {
    display: block;
    width: 100%;
}

.ad-popup img {
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

@media (max-width: 767px) {
    .ad-popup {
        padding: 0.85rem;
        align-items: end;
    }

    .ad-popup__dialog {
        max-height: 80vh;
        overflow-y: auto;
        border-radius: 16px;
    }
}
