/**
 * KYM Streaming - Estilos del Espacio Publicitario Afiliado
 * Optimizado para móvil y escritorio (360px, 390px, 1280px)
 * Cumple con reserva de espacio para evitar CLS (Cumulative Layout Shift)
 */

#sponsor-banner-slot {
    max-width: 1100px !important;
    margin: 14px auto !important;
    padding: 0 12px;
    box-sizing: border-box;
    width: 100%;
}

.kym-ad-container {
    background: #152238;
    border: 1px solid #344258;
    border-radius: 12px;
    padding: 12px 16px;
    box-sizing: border-box;
    color: #edf2fa;
    min-height: 102px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease;
}

.kym-ad-container:hover {
    border-color: #4b6080;
}

.kym-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.kym-ad-badge {
    font: 600 11px/1.4 system-ui, -apple-system, sans-serif;
    letter-spacing: 0.05em;
    color: #9cb1ce;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.kym-ad-preview-tag {
    font: 700 10px/1.4 system-ui, -apple-system, sans-serif;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Modo Tarjeta de Texto Adaptable */
.kym-ad-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.kym-ad-copy {
    flex: 1;
    min-width: 0;
}

.kym-ad-title {
    font: 700 16px/1.3 system-ui, -apple-system, sans-serif;
    color: #ffffff;
    display: block;
    margin-bottom: 3px;
}

.kym-ad-desc {
    font: 400 13px/1.4 system-ui, -apple-system, sans-serif;
    color: #cbd5e1;
    margin: 0;
}

.kym-ad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid #8195b3;
    border-radius: 8px;
    color: #ffffff;
    background: #1e3a5f;
    text-decoration: none;
    font: 600 14px/1.4 system-ui, -apple-system, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.kym-ad-btn:hover {
    background: #274874;
    border-color: #a5b7d1;
    color: #ffffff;
}

.kym-ad-btn:focus-visible,
.kym-ad-image-link:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 3px;
}

/* Modo Banner Gráfico */
.kym-ad-image-link {
    display: block;
    width: 100%;
    text-decoration: none;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
}

.kym-ad-banner-img {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

/* Responsividad móvil estricta (<= 540px, incluyendo 360px y 390px) */
@media (max-width: 540px) {
    .kym-ad-container {
        padding: 10px 12px;
        min-height: 110px;
    }

    .kym-ad-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .kym-ad-btn {
        width: 100%;
        text-align: center;
    }

    .kym-ad-title {
        font-size: 15px;
    }

    .kym-ad-desc {
        font-size: 12px;
    }
}

/* ==========================================================================
   Posicionamiento Seguro para In-Page Push (Monetag IPP)
   Garantiza que cualquier notificación flotante se ancle en la parte inferior
   sin obstruir la barra de navegación superior (logo, enlaces, menú hamburguesa).
   ========================================================================== */
html > iframe,
body > iframe,
iframe[style*="fixed"],
iframe[style*="position: fixed"],
iframe[style*="position:fixed"],
div[id^="atContainer-"],
div[class*="container-"][style*="fixed"] {
    top: auto !important;
    bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
    margin-top: 0 !important;
}

html > div[style*="position: fixed"][style*="z-index"]:not(.modal):not([id*="Modal"]):not([class*="modal"]):not([id*="bs-"]):not(#btn-scroll-to-top):not(.floating-wa),
body > div[style*="position: fixed"][style*="z-index"]:not(.modal):not([id*="Modal"]):not([class*="modal"]):not([id*="bs-"]):not(#btn-scroll-to-top):not(.floating-wa) {
    top: auto !important;
    bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
    margin-top: 0 !important;
}

