/* ============================================
   Asistente ATIX360 — Widget de chat flotante
   Paleta: azul ATIX (#0A63C2) + acento naranja (#F7941E)
   ============================================ */

#atix360-ai-root { display: none; }

.atix-brand-mark { font-weight: 800; font-family: "Segoe UI", system-ui, sans-serif; letter-spacing: .3px; }
.atix-brand-mark .atix { color: #0A63C2; }
.atix-brand-mark .num { color: #F7941E; }
.atix-header .atix-brand-mark .atix,
.atix-toggle .atix-brand-mark .atix { color: #fff; }
.atix-header .atix-brand-mark .num,
.atix-toggle .atix-brand-mark .num { color: #FFD9A8; }

/* Botón flotante */
.atix-toggle {
    position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
    width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg, #0A63C2 0%, #0850A0 100%);
    box-shadow: 0 8px 24px rgba(10, 99, 194, .38);
    display: flex; align-items: center; justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease;
}
.atix-toggle:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 30px rgba(10, 99, 194, .48); }
.atix-toggle-logo { font-size: 12px; line-height: 1; }
.atix-badge {
    position: absolute; top: 10px; right: 12px; width: 11px; height: 11px;
    background: #22c55e; border-radius: 50%; border: 2px solid #fff;
}

/* Ventana de chat */
.atix-chat {
    position: fixed; right: 20px; bottom: 92px; z-index: 2147483000;
    width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 120px);
    background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
    display: flex; flex-direction: column;
    opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
.atix-chat.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.atix-header {
    background: linear-gradient(135deg, #0A63C2 0%, #0850A0 100%); color: #fff;
    padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.atix-header-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .16);
    display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.atix-header-info { flex: 1; }
.atix-header-info h4 { margin: 0; font-size: 15px; font-weight: 700; }
.atix-header-info span { font-size: 12px; opacity: .85; }
.atix-header-info span::before {
    content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e; margin-right: 6px;
}
.atix-header-minimize {
    background: transparent; border: none; color: #fff; cursor: pointer;
    width: 32px; height: 32px; border-radius: 8px; opacity: .9;
}
.atix-header-minimize:hover { background: rgba(255, 255, 255, .15); }
.atix-header-minimize svg { width: 22px; height: 22px; fill: currentColor; }

.atix-body { flex: 1; display: flex; flex-direction: column; background: #f4f7fb; overflow: hidden; }
.atix-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.atix-msg { display: flex; gap: 8px; max-width: 88%; }
.atix-msg.user { align-self: flex-end; }
.atix-msg.bot { align-self: flex-start; }
.atix-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: #0A63C2; display: flex; align-items: center; justify-content: center; font-size: 8px;
}
.atix-bubble {
    padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word;
}
.atix-msg.bot .atix-bubble { background: #fff; color: #1e293b; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.atix-msg.user .atix-bubble { background: #0A63C2; color: #fff; border-bottom-right-radius: 4px; }
.atix-time { font-size: 10px; color: #94a3b8; margin-top: 3px; padding: 0 4px; }
.atix-msg.user .atix-time { text-align: right; }

.atix-typing { display: none; align-items: center; gap: 8px; padding: 0 16px 6px; }
.atix-typing.show { display: flex; }
.atix-typing-dots { background: #fff; border-radius: 14px; padding: 12px 14px; display: flex; gap: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.atix-typing-dots span { width: 7px; height: 7px; background: #cbd5e1; border-radius: 50%; animation: atixBounce 1.2s infinite; }
.atix-typing-dots span:nth-child(2) { animation-delay: .2s; }
.atix-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes atixBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.atix-quick { padding: 0 16px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.atix-quick-btn {
    background: #fff; border: 1px solid #d5e2f2; color: #0A63C2; border-radius: 18px;
    padding: 7px 13px; font-size: 13px; cursor: pointer; transition: all .15s ease;
}
.atix-quick-btn:hover { background: #0A63C2; color: #fff; border-color: #0A63C2; }

.atix-input-area { display: flex; align-items: flex-end; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid #eef2f7; }
.atix-input {
    flex: 1; resize: none; border: 1px solid #d5e2f2; border-radius: 14px; padding: 10px 14px;
    font-size: 14px; font-family: inherit; max-height: 96px; outline: none;
}
.atix-input:focus { border-color: #0A63C2; }
.atix-send {
    width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
    background: linear-gradient(135deg, #0A63C2 0%, #0850A0 100%); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.atix-send svg { width: 20px; height: 20px; fill: currentColor; }
.atix-send:hover { filter: brightness(1.08); }

.atix-chat-footer { text-align: center; font-size: 11px; color: #94a3b8; padding: 6px; background: #fff; }
.atix-chat-footer strong { color: #0A63C2; }

@media (max-width: 480px) {
    .atix-chat {
        right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0;
    }
    .atix-chat.atix-keyboard-open { height: var(--atix-vv-height, 100dvh); }
    body.atix-chat-open { overflow: hidden; }
}
