/* Iklan melayang KlinikPro (Program Afiliasi) — markup dirakit oleh assets/js/ad-rail.js.
   Layar lebar (>=1600px, sisa ruang di luar kolom konten 1200px): rail kanan melayang
   yang menempel di layar saat menggulir. Layar lebih kecil: banner bawah yang bisa
   ditutup (tidak menghalangi konten). */

.adr-rail, .adr-banner, .adr-corner { display: none; }

/* — Rail kanan (desktop lebar) — lebarnya fluid: mengisi sisa ruang di luar
   kolom konten 1200px (jarak tetap 8px), maksimal 300px seperti unit iklan standar — */
@media (min-width: 1620px) {
    .adr-rail {
        display: block;
        position: fixed;
        top: 50%;
        right: 12px;
        z-index: 40;
        width: min(300px, calc((100vw - 1240px) / 2));
        transform: translateY(-50%);
    }
}

/* — Kartu pojok kanan-bawah: laptop/desktop yang marginnya terlalu sempit untuk
   rail (1200-1619px). Pola widget promo standar — melayang, tidak menutup konten. — */
@media (min-width: 1200px) and (max-width: 1619px) {
    .adr-corner {
        display: block;
        position: fixed;
        right: 16px;
        bottom: 16px;
        z-index: 40;
        width: 330px;
        animation: adr-rise .45s cubic-bezier(.2, .7, .2, 1) both;
    }
}

/* — Banner bawah: hanya mobile & tablet. — */
@media (max-width: 1199px) {
    .adr-banner {
        display: block;
        position: fixed;
        left: 50%;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        width: calc(100% - 24px);
        max-width: 640px;
        transform: translateX(-50%);
        animation: adr-up .45s cubic-bezier(.2, .7, .2, 1) both;
    }
}

.adr-card {
    position: relative;
    overflow: hidden;
    padding: 20px 16px 16px;
    border-radius: 18px;
    color: #fff;
    background: radial-gradient(220px 150px at 100% 0%, #4075aa99 0%, transparent 70%),
        linear-gradient(160deg, #001965 0%, #173f7a 100%);
    box-shadow: 0 24px 48px -28px #001965b3, 0 4px 14px -6px #00196540;
    animation: adr-in .45s cubic-bezier(.2, .7, .2, 1) both;
}

.adr-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #ffffff2b;
    border-radius: 8px;
    background: #ffffff14;
    color: #c6d8f0;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}
.adr-close:hover { background: #ffffff2b; color: #fff; }

.adr-title { margin: 0 0 8px; font-size: 17px; line-height: 1.35; font-weight: 750; letter-spacing: -.015em; }
.adr-title span { color: #a9d1ff; }
.adr-sub { margin: 0 0 14px; font-size: 12.5px; line-height: 1.55; color: #d4e2f5; }

.adr-points { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; font-size: 12.5px; font-weight: 600; }
.adr-points li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.adr-points svg { flex-shrink: 0; margin-top: 1px; color: #5ee0a0; }

.adr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 11px;
    background: #fff;
    color: #001965;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease;
}
.adr-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px #000c; }
.adr-btn svg { flex-shrink: 0; }

.adr-more {
    display: block;
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #c6d8f0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.adr-more:hover { color: #fff; }

/* Varian banner: satu baris ringkas */
.adr-banner .adr-card { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; }
.adr-banner .adr-info { flex: 1; min-width: 0; }
.adr-banner .adr-title { margin: 0 0 2px; font-size: 13px; }
.adr-banner .adr-title span { color: inherit; }
.adr-banner .adr-sub { margin: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adr-banner .adr-points, .adr-banner .adr-more { display: none; }
.adr-banner .adr-btn { flex-shrink: 0; min-height: 36px; padding: 0 14px; font-size: 12.5px; }
.adr-banner .adr-close { position: static; flex-shrink: 0; }

@media (max-width: 400px) {
    .adr-banner .adr-sub { display: none; }
    .adr-banner .adr-btn { padding: 0 12px; }
}

@keyframes adr-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes adr-up { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes adr-rise { from { opacity: 0; transform: translate(12px, 12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .adr-card, .adr-banner, .adr-corner { animation: none; }
    .adr-btn { transition: none; }
}
