/* chat-widget/chat-widget.css */

/* Contenedor principal del Widget */
.floating-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px; /* <--- CORRECTO: Lado derecho */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* <--- CORRECTO: Alineado a la derecha */
    
    /* Oculto al inicio, aparecerá con JS */
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Clase 'show' que añadirá JavaScript */
.floating-chat-widget.show {
    opacity: 1;
    transform: scale(1);
}

/* Botón principal de chat */
.chat-toggle-button {
    background-color: #007bff; /* Color primario, puedes cambiarlo */
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
    padding: 0; /* Reseteo para el botón */
}

.chat-toggle-button:hover {
    background-color: #0056b3; /* Color más oscuro al pasar el mouse */
}

/* CORRECTO: Estilo para tu nueva imagen de auriculares */
.chat-button-icon {
    width: 40px;  /* Ajusta este tamaño si lo ves muy grande o pequeño */
    height: 40px;
    object-fit: contain; /* Asegura que la imagen se vea bien */
}

/* Contenedor de las opciones de WhatsApp y Telegram */
.chat-options {
    position: absolute;
    bottom: 75px; /* Encima del botón principal */
    right: 0; /* <--- CORRECTO: Lado derecho */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Estilo de los botones-burbuja de redes */
.chat-options a {
    /* background-color: #fff; */ /* <-- CORREGIDO: Comentado para quitar el fondo blanco */
    /* width: 50px; */ /* <-- CORREGIDO: Comentado, la imagen ya tiene el tamaño */
    /* height: 50px; */ /* <-- CORREGIDO: Comentado */
    border-radius: 50%;
    /* display: flex; */ /* <-- CORREGIDO: Comentado */
    /* align-items: center; */ /* <-- CORREGIDO: Comentado */
    /* justify-content: center; */ /* <-- CORREGIDO: Comentado */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Transición con "rebote" */
    
    /* Ocultos por defecto */
    opacity: 0;
    transform: scale(0);
}

/* LA REGLA DUPLICADA FUE ELIMINADA */

/* Animación de aparición de las burbujas cuando se hace clic */
.chat-options.show a {
    opacity: 1;
    transform: scale(1);
}

/* Retraso escalonado para que aparezcan una tras otra */
.chat-options.show a:nth-child(1) {
    transition-delay: 0.1s;
}
.chat-options.show a:nth-child(2) {
    transition-delay: 0.2s;
}

/* Burbuja de pensamiento */
.thought-bubble {
    position: absolute;
    bottom: 60px; /* Al lado del botón */
    right: 70px; /* <--- CORRECTO: Lado derecho */
    background-color: #f0f0f0;
    padding: 12px 18px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #333;
    width: 200px; /* Ancho del mensaje */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease-out;
}

/* El "triángulo" de la burbuja de pensamiento */
.thought-bubble::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: -10px; /* <--- CORRECTO: Lado derecho */
    border-width: 10px 0 10px 15px; /* <--- CAMBIADA LA DIRECCIÓN DEL BORDE */
    border-style: solid;
    border-color: transparent transparent transparent #f0f0f0; /* <--- CAMBIADO EL COLOR DEL BORDE */
}

/* Clase 'show' para la burbuja de pensamiento */
.thought-bubble.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Adaptabilidad para móviles */
@media (max-width: 768px) {
    .floating-chat-widget {
        bottom: 15px;
        right: 15px; /* <--- CORRECTO: Lado derecho */
    }
    .thought-bubble {
        /* En móviles, es mejor que aparezca arriba, no al lado */
        right: 0; /* <--- CORRECTO: Lado derecho */
        bottom: 140px; /* Encima de las opciones */
        width: 180px;
        font-size: 13px;
    }
    .thought-bubble::after {
        /* Reposicionamos el triángulo */
        right: 20px; /* <--- CORRECTO: Lado derecho */
        bottom: -15px;
        border-width: 15px 10px 0 10px;
        border-color: #f0f0f0 transparent transparent transparent;
    }
} /* <-- CORREGIDO: LA REGLA @media TERMINA AQUÍ */

/* --- ESTILOS DE ICONOS MOVIDOS FUERA DEL @media --- */
/* Nueva regla para los iconos de WhatsApp y Telegram */
.chat-option-icon {
    width: 50px;  /* El tamaño de los botones-burbuja */
    height: 50px;
    object-fit: cover; /* Se asegura que la imagen llene el espacio */
    border-radius: 50%; /* Asegura que sean redondos */
    transition: transform 0.2s ease; /* Animación al pasar el mouse */
}

/* Efecto hover en el 'a' ahora afectará a la imagen */
.chat-options a:hover .chat-option-icon {
    transform: scale(1.1); /* Agranda un poco el icono al pasar el mouse */
}