/* ============================================
   Chat Widget - Asistente Matamoros 360
   ============================================ */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #67B023, #0A1D37);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(103, 176, 35, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10000;
    transition: all 0.3s ease;
}

.chat-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(103, 176, 35, 0.5);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid #e0e0e0;
}

.chat-window.active {
    display: flex;
}

.chat-header {
    background: linear-gradient(135deg, #0A1D37, #67B023);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
}

.chat-header .chat-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header .chat-logo i {
    font-size: 20px;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.chat-message.user {
    background: #0A1D37;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.chat-message.bot {
    background: #f0f4f8;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.chat-message.bot-result {
    background: #e8f5e9;
    border-left: 3px solid #67B023;
}

.chat-message .message-meta {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-area {
    display: flex;
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.chat-input-area input[type="text"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input[type="text"]:focus {
    border-color: #67B023;
}

.chat-send-btn {
    background: #67B023;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    margin-left: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: #0A1D37;
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-loading {
    text-align: center;
    padding: 10px;
    color: #999;
    font-size: 13px;
}

.chat-suggestion {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 4px 0;
    background: #f0f4f8;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.chat-suggestion:hover {
    background: #e0e7f0;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget-container {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
    }

    .chat-window {
        position: fixed;
        bottom: 0;
        top: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        bottom: 70px;
    }

    .chat-toggle-btn {
        bottom: 12px;
        right: 12px;
    }
}
