/**
 * AdbnPro Mobile Override Styles
 * Version: 1.7.1
 * 
 * Estilos críticos para corregir tamaño de banners flotantes en móvil
 */

/* ===== OVERRIDE CRÍTICO PARA MÓVILES ===== */
@media screen and (max-width: 768px) {
    
    /* Forzar tamaño apropiado para TODOS los banners flotantes en móvil */
    .adbnpro-floating-banner,
    .adbnpro-floating,
    .adbnpro-rotating-floating-container,
    [class*="adbnpro-position-"],
    [class*="adbnpro-mobile-"] {
        /* Tamaño base más grande */
        width: auto !important;
        min-width: 280px !important;
        max-width: min(95vw, 600px) !important;
        max-height: 60vh !important;
        
        /* Variables CSS para control dinámico */
        width: var(--mobile-width, auto) !important;
        max-width: var(--mobile-max-width, 95vw) !important;
        
        /* Márgenes reducidos en móvil */
        margin: 5px !important;
    }
    
    /* Asegurar que las imágenes dentro se escalen correctamente */
    .adbnpro-floating-banner img,
    .adbnpro-floating img,
    .adbnpro-rotating-floating-container img,
    [class*="adbnpro-position-"] img,
    [class*="adbnpro-mobile-"] img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        display: block !important;
        object-fit: contain !important;
    }
    
    /* Contenedor de contenido flotante */
    .adbnpro-floating-content,
    .adbnpro-content {
        width: 100% !important;
        height: auto !important;
    }
    
    /* ===== MODO SOLO MÓVIL - Tamaño maximizado ===== */
    .adbnpro-floating-banner[data-show-desktop="false"][data-show-tablet="false"][data-show-mobile="true"],
    .adbnpro-floating[data-show-desktop="false"][data-show-tablet="false"][data-show-mobile="true"],
    .adbnpro-rotating-floating-container[data-show-desktop="false"][data-show-tablet="false"][data-show-mobile="true"] {
        /* Usar casi todo el ancho disponible */
        width: calc(95vw - 20px) !important;
        min-width: calc(95vw - 20px) !important;
        max-width: calc(95vw - 20px) !important;
        
        /* Altura proporcional */
        height: auto !important;
        max-height: 70vh !important;
        
        /* Centrado mejorado */
        margin: 10px auto !important;
    }
    
    /* Banners procesados por JavaScript */
    .adbnpro-mobile-processed {
        transition: all 0.3s ease !important;
    }
    
    /* ===== POSICIONES MÓVILES MEJORADAS ===== */
    
    /* Centro - Asegurar visibilidad completa */
    .adbnpro-mobile-center,
    .adbnpro-position-center {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
    }
    
    /* Posiciones superiores */
    .adbnpro-mobile-top-left {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    .adbnpro-mobile-top-center,
    .adbnpro-mobile-top {
        position: fixed !important;
        top: 10px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
    }
    
    .adbnpro-mobile-top-right {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    /* Posiciones centrales laterales */
    .adbnpro-mobile-middle-left {
        position: fixed !important;
        top: 50% !important;
        left: 10px !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
    }
    
    .adbnpro-mobile-middle-right {
        position: fixed !important;
        top: 50% !important;
        right: 10px !important;
        left: auto !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
    }
    
    /* Posiciones inferiores */
    .adbnpro-mobile-bottom-left {
        position: fixed !important;
        bottom: 10px !important;
        left: 10px !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    .adbnpro-mobile-bottom-center,
    .adbnpro-mobile-bottom {
        position: fixed !important;
        bottom: 10px !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
    }
    
    .adbnpro-mobile-bottom-right {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    /* ===== POSICIONES ESPECIALES ===== */
    
    /* Sticky Superior */
    .adbnpro-mobile-top-sticky {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        margin: 0 !important;
        border-radius: 0 0 8px 8px !important;
        z-index: 99999 !important;
    }
    
    /* Sticky Inferior */
    .adbnpro-mobile-bottom-sticky {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        margin: 0 !important;
        border-radius: 8px 8px 0 0 !important;
        z-index: 99999 !important;
    }
    
    /* Ancho completo superior */
    .adbnpro-mobile-top-fullwidth {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: auto !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    /* Ancho completo inferior */
    .adbnpro-mobile-bottom-fullwidth {
        position: fixed !important;
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    /* ===== FIXES ESPECÍFICOS ===== */
    
    /* Fix para banners con dimensiones inline */
    .adbnpro-floating-banner[style*="width"],
    .adbnpro-floating[style*="width"] {
        width: auto !important;
        min-width: 280px !important;
        max-width: 95vw !important;
    }
    
    /* Fix para contenedores rotativos */
    .adbnpro-rotating-floating-container .adbnpro-rotating-item {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Asegurar z-index alto en móvil */
    .adbnpro-floating-banner,
    .adbnpro-floating,
    [class*="adbnpro-mobile-"] {
        z-index: 99999 !important;
    }
    
    /* Botón de cierre más grande en móvil */
    .adbnpro-close {
        width: 44px !important;
        height: 44px !important;
        font-size: 24px !important;
        top: 5px !important;
        right: 5px !important;
    }
}

/* ===== ORIENTACIÓN LANDSCAPE EN MÓVIL ===== */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .adbnpro-floating-banner,
    .adbnpro-floating,
    [class*="adbnpro-mobile-"] {
        max-height: 80vh !important;
        max-width: 60vw !important;
    }
    
    /* Modo solo móvil en landscape */
    .adbnpro-floating-banner[data-show-desktop="false"][data-show-tablet="false"][data-show-mobile="true"] {
        max-width: 70vw !important;
        max-height: 85vh !important;
    }
}

/* ===== DISPOSITIVOS PEQUEÑOS (< 375px) ===== */
@media screen and (max-width: 374px) {
    .adbnpro-floating-banner,
    .adbnpro-floating,
    [class*="adbnpro-mobile-"] {
        min-width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        margin: 10px !important;
    }
}

/* ===== DEBUG MODE ===== */
.adbnpro-debug-mode .adbnpro-floating-banner::after {
    content: attr(data-show-desktop) " | " attr(data-show-tablet) " | " attr(data-show-mobile);
    position: absolute;
    top: 0;
    left: 0;
    background: red;
    color: white;
    padding: 2px 5px;
    font-size: 10px;
    z-index: 999999;
}