/* --- ESTILOS CORREGIDOS Y OPTIMIZADOS PARA EL CHATBOT --- */

.chatbot-modal {
    display: none;
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 350px;
    height: 450px;
    background-color: #836c6cc1;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Activo */
.chatbot-modal.active {
    display: flex;
}

/* Cabecera */
.chatbot-header {
    background: linear-gradient(to right, #805c01, #f2f2f2);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Botón cerrar */
.close-btn {
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #000;
}

/* Mensajes */
.chatbot-messages {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    background-color: #c6adadc8;
    border-radius: 15px;
    padding: 15px;
    max-width: 80%;
    font-family: Arial, sans-serif;
    animation: messageFadeIn 0.4s ease-in-out;
}

/* Botones */
.chat-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px 20px;
    margin-bottom: 10px;
}

.chat-button {
    background-color: #000;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
}

.chat-button:hover {
    background-color: #5f4705;
}

/* Botón flotante */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #fff;
    border-radius: 50%;
    padding: 5px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: bounce 2s infinite;
}

.chatbot-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 🔥 CORRECCIÓN CLAVE PARA MÓVIL */
@media (max-width: 768px) {
    .chatbot-modal {
        width: calc(100% - 20px);
        max-width: 100%;
        height: calc(100dvh - 140px);
        right: 10px;
        left: 10px;
        bottom: 90px;
        border-radius: 16px;
    }

    .chatbot-toggle {
        animation: none;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes messageFadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Ocultar inputs que no usas */
.chatbot-input,
.opciones-rapidas,
.quick-options {
    display: none !important;
}

/* Estilos para el botón "Bajar al final" con círculo blanco y flecha hacia abajo */
.scroll-to-bottom {
    background-color: white; /* Fondo blanco para el círculo */
    color: black; /* Color de texto negro */
    padding: 12px;
    border: none;
    border-radius: 50%; /* Botón redondo */
    cursor: pointer;
    font-size: 20px; /* Tamaño de la flecha */
    width: 50px; /* Ancho del botón */
    height: 50px; /* Alto del botón */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Sombra suave */
    position: fixed; /* Fijamos el botón en la pantalla */
    bottom: 20px; /* Lo posicionamos 20px desde la parte inferior */
    right: 20px; /* Lo posicionamos 20px desde la parte derecha */
    z-index: 1001;
}

/* Flecha dentro del botón */
.scroll-to-bottom::after {
    content: "↓"; /* Usamos la flecha hacia abajo */
    font-size: 24px; /* Tamaño de la flecha */
    font-weight: bold;
}

/* Efecto de hover */
.scroll-to-bottom:hover {
    background-color: #f0f0f0; /* Fondo gris claro al pasar el ratón */
}

/* Estilos para el contenedor de mensajes */
.chatbot-messages {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 350px; /* Limitar la altura de los mensajes */
    margin-bottom: 70px; /* Ajuste para evitar que el contenido se superponga al botón */
}