/* Widget Flotante del Chatbot */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background-color: #7A2E34; /* Primario */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #9E9E9E; /* Neutral */
}

.chatbot-window.open {
    display: flex;
}

.chatbot-header {
    background-color: #7A2E34; /* Primario */
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.chatbot-close {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #F8F6F3; /* Fondo */
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background-color: #7A2E34; /* Primario */
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.bot {
    align-self: flex-start;
    background-color: #ffffff;
    color: #3B2A1F; /* Secundario */
    border: 1px solid #9E9E9E; /* Neutral */
    border-bottom-left-radius: 2px;
}

.chat-message.bot p {
    margin-bottom: 5px;
}

.chat-message.bot p:last-child {
    margin-bottom: 0;
}

.chatbot-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #9E9E9E; /* Neutral */
    background: #fff;
}

.chatbot-input {
    flex-grow: 1;
    border: 1px solid #9E9E9E; /* Neutral */
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
    color: #3B2A1F; /* Secundario */
}

.chatbot-input:focus {
    border-color: #A13B42; /* Acento */
}

.chatbot-send {
    background: #7A2E34; /* Primario */
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
}

.chatbot-send:hover {
    background: #A13B42; /* Acento */
}

.chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Indicador de escritura */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background-color: #ffffff;
    border: 1px solid #9E9E9E; /* Neutral */
    padding: 10px 15px;
    border-radius: 15px;
    border-bottom-left-radius: 2px;
    margin-bottom: 10px;
}
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #3B2A1F; /* Secundario */
    border-radius: 50%;
    margin-right: 3px;
    animation: typing 1s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; margin-right: 0; }

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

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        right: -10px;
        bottom: 70px;
    }
}
