/* =================================================== */
/* ESTILOS EXCLUSIVOS: CHAT INTERACTIVO FLOTANTE       */
/* =================================================== */
.futu-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999; /* Asegura estar por encima de sliders y footers */
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

/* --- BOTÓN ACCIONADOR FLOTANTE (FAB) --- */
.chat-fab-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a66ff 0%, #001a88 100%);
    border: none;
    border-radius: 30% !important;
    padding: 2rem !important;
    color: #ffffff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(26, 102, 255, 0.4);
    position: relative;
    outline: none !important;
}

.chat-btn-notification {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: #ff6200; /* Naranja corporativo */
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

/* --- VENTANA PRINCIPAL DE CHAT --- */
.chat-window-card {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    max-height: 540px;
    background-color: #ffffff;
    border-radius: 24px;
    box-shadow: 0 15px 45px rgba(0, 5, 84, 0.15);
    border: 1px solid rgba(0, 5, 84, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    opacity: 0;
    transform-origin: bottom right;
}

/* Encabezado del chat */
.chat-window-header {
    background: linear-gradient(135deg, #001a88 0%, #1a66ff 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
}
.chat-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-avatar-status {
    position: relative;
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-avatar-status img {
    width: 100%;
    height: auto;
    object-fit: contain;
}
.status-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #b0f216; /* Verde limón de actividad */
    border: 2px solid #001a88;
    border-radius: 50%;
}
.chat-header-meta h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}
.chat-header-meta span {
    font-size: 11px;
    opacity: 0.85;
    display: block;
}
.chat-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.chat-close-btn:hover { opacity: 1; }

/* Cuerpo de Mensajes */
.chat-window-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 240px;
    scroll-behavior: smooth;
}

/* Burbujas de chat */
.chat-msg-row {
    display: flex;
    width: 100%;
}
.bot-msg { justify-content: flex-start; }
.user-msg { justify-content: flex-end; }

.chat-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}
.bot-msg .chat-msg-bubble {
    background-color: #ffffff;
    color: #334155;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    border-top-left-radius: 4px;
}
.user-msg .chat-msg-bubble {
    background-color: #1a66ff;
    color: #ffffff;
    border-top-right-radius: 4px;
}

/* Área de Opciones Predeterminadas (Menú) */
.chat-window-options {
    padding: 15px;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.chat-opt-btn {
    background-color: #090582b3 !important;
    color: #001a88;
    border: none;
    border-radius: 12px !important;
    padding: 20px 14px !important;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    outline: none !important;
}
.chat-opt-btn:hover {
    background-color: #1a66ff;
    color: #ffffff;
}

/* Bloque del botón de retorno */
.chat-window-footer {
    padding: 12px 15px;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}
.chat-return-menu-btn {
    background-color: #f27a30 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 8px 20px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}
.chat-return-menu-btn:hover {
    background-color: #d65a18 !important;
}

/* Estilos de Redes Sociales incrustados en respuesta */
.chat-embed-socials {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.chat-embed-socials a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #001a88;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}
.chat-embed-socials a:hover {
    background-color: #1a66ff;
    color: #ffffff;
}

/* --- ADAPTACIÓN RESPONSIVA TOTAL --- */
@media (max-width: 480px) {
    .futu-chat-widget {
        bottom: 20px;
        right: 20px;
    }
    .chat-window-card {
        width: calc(100vw - 40px);
        bottom: 70px;
        max-height: 80vh;
    }
}