/* =========================================================
   Ad Scheduler Widget v2 — Frontend Styles
   ========================================================= */

.asw-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ── Slot (contenedor de cada anuncio) ── */
.asw-slot {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
}

.asw-slot.asw-ratio {
    height: 0; /* el padding-top en línea define la altura */
    overflow: hidden;
}

/* ── Medios ── */
.asw-media {
    display: block;
    width: 100%;
    height: 100%;
}

.asw-slot.asw-ratio .asw-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asw-image {
    object-fit: cover;
}

.asw-youtube,
.asw-video {
    object-fit: contain;
    background: #000;
}

/* ── Enlace envoltorio ── */
.asw-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.asw-slot.asw-ratio .asw-link {
    position: absolute;
    top: 0;
    left: 0;
}

/* ── Rotación: ocultar slots inactivos ── */
.asw-slot.asw-hidden {
    display: none;
}

/* ── Fallback texto ── */
.asw-fallback-text {
    display: block;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* ── Indicadores de rotación (dots) ── */
.asw-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}

.asw-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: all;
    transition: background 0.25s, transform 0.25s;
}

.asw-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ── Transición de entrada ── */
.asw-slot {
    animation: asw-fadein 0.4s ease;
}

@keyframes asw-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =========================================================
   v2.1 — MODO OVERLAY
   El wrapper usa el mismo ratio trick que el modo normal
   (padding-top en % = altura proporcional al ancho).
   El widget de Elementor se posiciona absolute sobre el padre
   pero el tamaño lo dicta el ratio, no la altura del padre.
   ========================================================= */

/* El widget flota sobre el contenedor padre preservando el ratio */
.elementor-widget-asw_ad_scheduler:has(.asw-overlay) {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

/* Fallback para navegadores sin :has() — el JS añade esta clase */
.elementor-widget-asw_ad_scheduler.asw-widget-overlay {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

/* El wrapper en overlay usa padding-top para el ratio,
   igual que .asw-slot.asw-ratio en modo normal.
   El padding-top concreto se inyecta como style inline desde PHP. */
.asw-wrapper.asw-overlay {
    position: relative;
    width: 100%;
    height: 0;            /* la altura la da el padding-top inline */
    overflow: hidden;
    z-index: 100;
    pointer-events: auto;
}

/* Slot en overlay: se estira para cubrir el wrapper completo */
.asw-slot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.asw-slot-overlay .asw-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.asw-slot-overlay .asw-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ── Botón de cierre (✕) ── */
.asw-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    font-weight: 700;
    color: #000;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: background 0.2s, transform 0.15s;
}

.asw-close:hover {
    background: #fff;
    transform: scale(1.08);
}

.asw-close:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Overlay cerrado */
.asw-wrapper.asw-overlay.asw-closed {
    display: none;
}
