/* AI sales assistant widget (assets/js/ai-chat.js). Bottom left, so it never covers the WhatsApp and back-to-top buttons. */
.ai-chat-toggle { position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 1035; display: inline-flex; align-items: center; gap: .5rem; height: 52px; padding: 0 1.2rem; border: 0; border-radius: 999px; background: var(--ti-grad); color: #fff; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(var(--ti-primary-rgb), .75); transition: transform .2s ease; }
.ai-chat-toggle:hover { transform: translateY(-2px); }
.ai-chat-toggle i { font-size: 1.05rem; }
#aiChat.is-open .ai-chat-toggle { display: none; }
.ai-chat-panel { position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 1040; width: min(390px, calc(100vw - 2.5rem)); height: min(600px, calc(100vh - 2.5rem)); display: flex; flex-direction: column; border-radius: 20px; border: 1px solid var(--ti-border-strong); background: var(--ti-card-solid, #111118); color: var(--ti-ink); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55); overflow: hidden; }
.ai-chat-panel[hidden] { display: none; }
.ai-chat-head { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; background: var(--ti-grad); color: #fff; }
.ai-chat-head div { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.ai-chat-head small { opacity: .85; font-size: .75rem; }
.ai-chat-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.ai-chat-close { border: 0; background: transparent; color: #fff; font-size: 1.15rem; padding: .25rem .4rem; }
.ai-chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.ai-msg { max-width: 86%; padding: .6rem .85rem; border-radius: 16px; font-size: .92rem; line-height: 1.45; overflow-wrap: anywhere; }
.ai-msg a { color: inherit; text-decoration: underline; }
.ai-assistant { align-self: flex-start; background: var(--ti-glass, rgba(255, 255, 255, .06)); border: 1px solid var(--ti-border); border-bottom-left-radius: 6px; }
.ai-user { align-self: flex-end; background: var(--ti-primary); color: #fff; border-bottom-right-radius: 6px; }
.ai-typing { animation: ai-pulse 1s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .4; } }
.ai-action { align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border-radius: 999px; background: #25d366; color: #fff; font-weight: 600; font-size: .85rem; text-decoration: none; }
.ai-action:hover { color: #fff; filter: brightness(1.05); }
.ai-chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; }
.ai-chat-chips[hidden] { display: none; }
.ai-chat-chips button { border: 1px solid var(--ti-border-strong); background: transparent; color: var(--ti-ink); border-radius: 999px; padding: .35rem .75rem; font-size: .8rem; }
.ai-chat-chips button:hover { border-color: var(--ti-primary); color: var(--ti-primary); }
.ai-chat-form { display: flex; gap: .5rem; padding: .6rem .8rem; border-top: 1px solid var(--ti-border); }
.ai-chat-form textarea { flex: 1; resize: none; max-height: 120px; border: 1px solid var(--ti-border-strong); border-radius: 14px; background: transparent; color: var(--ti-ink); padding: .55rem .75rem; font-size: .92rem; }
.ai-chat-form textarea:focus { outline: none; border-color: var(--ti-primary); }
.ai-chat-form button { width: 44px; border: 0; border-radius: 14px; background: var(--ti-primary); color: #fff; }
.ai-chat-note { margin: 0; padding: 0 1rem .6rem; font-size: .7rem; color: var(--ti-muted); }
@media (max-width: 575.98px) {
    .ai-chat-toggle { left: 1rem; bottom: 1rem; height: 48px; padding: 0 1rem; }
    .ai-chat-panel { left: 0; right: 0; bottom: 0; width: 100%; height: 100%; max-height: 100dvh; border-radius: 0; }
}
