/*
 * =========================================================
 *  Hoja de Estilos Final v3 - MÓVIL CORREGIDO
 * =========================================================
 */

/* --- Ventana del Chat (IFRAME) --- */
#chat_iframe {
    position: fixed;
    bottom: 145px;
    right: 18px;
    width: 800px;
    height: 600px;
    border: none;
    border-radius: 12px;
    display: none;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    background: white;
}

/* --- Botón del Chat --- */
#chat_button {
    position: fixed !important;
    bottom: 75px !important;
    right: 18px !important;
    z-index: 10000;
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    background: #727cf5 !important;
    border: none !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.3) !important;
    padding: 0 !important;
    cursor: pointer !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: background-color 0.3s ease-in-out;
    font-size: 22px !important;
    color: #fff !important;
}

/* --- Efecto Hover --- */
#chat_button:hover {
    background: #833471 !important;
}

/* --- Video dentro del Botón --- */
#chat_button video.chat-logo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    pointer-events: none !important;
}

/* --- Overlay --- */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9998;
}


/* ======================================================= */
/*      ↓↓↓ DISEÑO RESPONSIVO PARA MÓVILES (CORREGIDO) ↓↓↓  */
/* ======================================================= */
@media (max-width: 600px) {

    /* --- El botón del chat en móviles --- */
    #chat_button {
        /* ======================================================= */
        /*      ↓↓↓ LO SUBIMOS PARA QUE NO CHOQUE ↓↓↓            */
        /* ======================================================= */
        bottom: 64px !important; /* <<-- Sube el botón para que se vea sobre el botón de "subir" */
        right: 2px !important;
        width: 60px !important;
        height: 60px !important;
    }

    /* --- La ventana del chat en móviles --- */
    #chat_iframe {
        /* Dimensiones */
        width: calc(100% - 30px) !important; /* Ancho completo menos 15px de margen a cada lado */
        height: 55vh !important; /* Altura del 70% de la ventana visible */
        max-height: 500px !important; /* Una altura máxima para que no sea gigante */

        /* ======================================================= */
        /*      ↓↓↓ ¡AQUÍ ESTÁ EL CAMBIO PRINCIPAL! ↓↓↓            */
        /*      Lo posicionamos desde arriba en lugar de abajo.    */
        /* ======================================================= */
        position: fixed !important;
        top: 20px !important;  /* <<== ESTA ES LA LÍNEA QUE CONTROLAS */
        left: 15px !important;
        
        /* Reseteamos 'bottom' y 'right' para que no interfieran */
        bottom: auto !important;
        right: auto !important;

        /* Estilos visuales */
        border-radius: 12px !important;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2) !important;
    }
  }