.nw-ad-slot {
    width: min(100%, 1180px);
    margin: 14px auto;
    text-align: center;
}

.nw-ad-slot img,
.nw-ad-popup-box img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.nw-ad-link {
    display: block;
    text-decoration: none;
}

.nw-ad-sitetop {
    margin-top: 0;
    margin-bottom: 0;
}

.nw-ad-footer {
    margin-top: 28px;
    margin-bottom: 22px;
}

.nw-ad-bloginline,
.nw-ad-productinline {
    margin-top: 28px;
    margin-bottom: 28px;
}

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

.nw-ad-popup {
    position: fixed;
    inset: 0;
    z-index: 1085;
    display: grid;
    place-items: center;
    padding: 18px;
}

.nw-ad-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .46);
    backdrop-filter: blur(2px);
}

.nw-ad-popup-box {
    position: relative;
    z-index: 1;
    width: min(92vw, 620px);
    background: #fff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 18px 60px rgba(0,0,0,.28);
}

.nw-ad-close {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: #111;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 767px) {
    .nw-ad-slot {
        margin: 10px auto;
        padding-inline: 10px;
    }

    .nw-ad-slot img,
    .nw-ad-popup-box img {
        border-radius: 10px;
    }
}
.nw-ad-external-media {
    width: 100%;
}

.nw-ad-media-frame {
    width: 100%;
    border-radius: 14px;
    background: #111827;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .1);
}

.nw-ad-media-frame iframe,
.nw-ad-media-frame embed,
.nw-ad-media-frame object,
.nw-ad-media-frame video {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    border-radius: inherit;
    background: #111827;
}

.nw-ad-media-load {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: inherit;
    background: linear-gradient(145deg, #111827, #172033);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease;
}

.nw-ad-media-load:hover {
    background: linear-gradient(145deg, #0f172a, #1f2937);
}

.nw-ad-media-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nw-ad-media-play::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 14px solid #fff;
    margin-right: 3px;
}

.nw-ad-external-media.is-loaded .nw-ad-media-load {
    display: none;
}

@media (max-width: 767px) {
    .nw-ad-media-frame {
        border-radius: 10px;
    }

    .nw-ad-media-load {
        font-size: .92rem;
    }

    .nw-ad-media-play {
        width: 38px;
        height: 38px;
    }
}
/* External ad videos keep the source aspect ratio and override the old generic iframe helper. */
.nw-ad-media-frame.responsive-media-frame {
    position: relative;
    width: 100%;
    aspect-ratio: var(--nw-ad-media-ratio, 16 / 9);
    height: auto !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

.nw-ad-media-frame > *:not(.nw-ad-media-load),
.nw-ad-media-frame .h_iframe-aparat_embed_frame,
.nw-ad-media-frame .r1_iframe_embed,
.nw-ad-media-frame .ratio,
.nw-ad-media-frame .embed-responsive {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nw-ad-media-frame .h_iframe-aparat_embed_frame span,
.nw-ad-media-frame .r1_iframe_embed span {
    display: none !important;
}

.nw-ad-media-frame iframe,
.nw-ad-media-frame embed,
.nw-ad-media-frame object,
.nw-ad-media-frame video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    border: 0 !important;
    display: block !important;
}
