/* Estilos personalizados para B2Chat Widget en vista móvil */
/* Usando selectores muy específicos para sobrescribir los estilos de B2Chat */

/* Mobile devices */
@media (max-width: 768px) {

    /* Ocultar el botón flotante del chat en móviles */
    #b2chat-livechat-launcher,
    div[id*="b2chat"][id*="launcher"],
    div[class*="b2chat"][class*="launcher"],
    .b2chat-launcher,
    [data-b2chat-launcher] {
        bottom: 80px !important;
        right: 15px !important;
        z-index: 100 !important;
    }

    /* Contenedor principal del iframe */
    #b2chat-livechat-container,
    div[id*="b2chat"][id*="container"],
    div[class*="b2chat"][class*="container"] {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        z-index: 1000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Iframe del chat cuando está abierto - ocupa toda la pantalla */
    #b2chat-livechat-iframe,
    iframe[id*="b2chat"],
    iframe[src*="b2chat"],
    iframe[class*="b2chat"],
    .b2chat-iframe,
    div[id*="b2chat"] iframe,
    div[class*="b2chat"] iframe {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        min-width: 100vw !important;
        min-height: 100vh !important;
        z-index: 1000 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
    }

    /* Contenedor del widget cuando el chat está abierto */
    div[id*="b2chat-livechat"],
    div[class*="b2chat-livechat"],
    div[id*="b2chat"][id*="widget"],
    div[class*="b2chat"][class*="widget"] {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        z-index: 1000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ajuste para el backdrop/overlay si existe */
    .b2chat-overlay,
    div[class*="b2chat-overlay"],
    div[id*="b2chat-overlay"] {
        z-index: 999 !important;
    }

    /* Forzar que cualquier div dentro de b2chat ocupe toda la pantalla */
    div[id*="b2chat"]>div,
    div[class*="b2chat"]>div {
        max-width: 100vw !important;
        max-height: 100vh !important;
    }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {

    /* Ocultar el botón flotante del chat en tablets */
    #b2chat-livechat-launcher,
    div[id*="b2chat"][id*="launcher"],
    div[class*="b2chat"][class*="launcher"],
    .b2chat-launcher,
    .ripple-area,
    div[class*="svelte-"],
    iframe[class*="svelte-"],
    body>div[style*="position: fixed"][style*="bottom"],
    body>iframe[style*="position: fixed"][style*="bottom"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Contenedor principal del iframe */
    #b2chat-livechat-container,
    div[id*="b2chat"][id*="container"],
    div[class*="b2chat"][class*="container"] {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        z-index: 1000 !important;
    }

    /* Iframe del chat cuando está abierto - ocupa toda la pantalla */
    #b2chat-livechat-iframe,
    iframe[id*="b2chat"],
    iframe[src*="b2chat"],
    iframe[class*="b2chat"],
    .b2chat-iframe,
    div[id*="b2chat"] iframe,
    div[class*="b2chat"] iframe {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        min-width: 100vw !important;
        min-height: 100vh !important;
        z-index: 1000 !important;
        border: none !important;
        border-radius: 0 !important;
    }

    /* Contenedor del widget cuando el chat está abierto */
    div[id*="b2chat-livechat"],
    div[class*="b2chat-livechat"],
    div[id*="b2chat"][id*="widget"],
    div[class*="b2chat"][class*="widget"] {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        z-index: 1000 !important;
    }
}