/* ===============================
   ESTILOS PARA EL CHATBOT VERDE RENACER
   =============================== */
   :root {
    --primary-color: #28a745; /* Verde principal del sitio */
    --bot-bg: #ffffff;
    --header-bg: #2a3f54; /* Un color oscuro para el encabezado */
    --user-msg-bg: #e1ffc7; /* Un verde claro para el usuario */
    --bot-msg-bg: #f1f0f0;
    --button-bg: #ffffff;
    --button-border: #cccccc;
    --button-hover-bg: #f5f5f5;
}

/* --- CONTENEDOR PRINCIPAL DEL CHAT --- */
#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    max-height: 70vh;
    background-color: var(--bot-bg);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}
#chatbot-container.open {
    transform: scale(1);
}

/* --- BOTÓN PARA ABRIR/CERRAR --- */
#chatbot-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: transform 0.3s ease;
}
#chatbot-toggle-btn:hover {
    transform: scale(1.1);
}
#chatbot-toggle-btn.hidden {
    transform: scale(0);
}
#chatbot-toggle-btn img, #chatbot-toggle-btn i {
    width: 32px;
    height: 32px;
    font-size: 30px;
}

/* --- ENCABEZADO DEL CHAT --- */
#chatbot-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#chatbot-title {
    font-weight: bold;
}
#chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* --- ÁREA DE MENSAJES --- */
#chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
}
.bot-message {
    background-color: var(--bot-msg-bg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.user-message {
    background-color: var(--user-msg-bg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* --- BOTONES DE OPCIONES --- */
.bot-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.bot-button {
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    border-radius: 15px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}
.bot-button:hover {
    background: var(--button-hover-bg);
}
.bot-button:disabled {
    cursor: default;
    opacity: 0.7;
}
.bot-button:disabled:not(.selected) {
    background: #f0f0f0;
    color: #999;
}

/* --- PUNTOS DE CARGA --- */
.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }