/* Estilos para el botón flotante */
.chat-button {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: linear-gradient(90deg, #6c63ff, #a65cff);
    color: white;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 9999999999;	
}

.chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

/* Ventana modal pequeña */
.chat-popup {
    position: fixed;
    bottom: 22px; /* Ajuste vertical */
    right: 20px; /* Ajuste horizontal */
    width: 380px; /* Ancho */
    height: 600px; /* Alto */
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none; /* Ocultar por defecto */
    z-index: 9999999999; /* Siempre por encima de otros elementos */
    overflow: hidden;
}

/* Cabecera de la ventana */
.chat-header {
    background: linear-gradient(90deg, #6c63ff, #a65cff);
    color: white;
    padding: 30px 10px;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chat-header .close {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: white;
}

/* Contenedor del cuerpo del chat */
.chat-body {
    position: relative; /* Necesario para posicionar el GIF */
    width: 100%;
    height: calc(100% - 10px); /* Ajusta la altura según el header */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Ocultar desbordes */
}

/* Estilos del iframe */
.chat-body iframe {
    display: none; /* Ocultar inicialmente */
    width: 100%;
    height:  calc(100% - 20px);
    border: none; /* Sin bordes */
}

/* Estilos del GIF de carga */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.chat-body.loaded iframe {
    display: block; /* Mostrar iframe cuando esté cargado */
}

.chat-body.loaded .loading {
    display: none; /* Ocultar GIF de carga */
}
@media screen and (max-width: 768px) {
    .chat-popup {
        bottom: 20px; /* Reduce el espacio inferior */
        right: 10px; /* Reduce el espacio derecho */
        width: 95%; /* Ocupa el 90% del ancho disponible */
        max-width: none; /* Quita el límite máximo */
        height: 85vh; /* Ocupa el 80% de la altura de la pantalla */
        border-radius: 10px; /* Bordes más pequeños */
        z-index: 9999999999;
    }

    .chat-header {
        padding: 20px 10px; /* Ajusta el padding */
        font-size: 1em; /* Reduce ligeramente el tamaño de la fuente */
    }

    .chat-button {
        bottom: 15px;
        right: 15px;
        padding: 10px 15px;
        font-size: 14px; /* Ajusta el tamaño del texto */
        border-radius: 20px;
    }
}