/* ═══════════════════════════════════════
   AI SALES ASSISTANT — "Relay-style" widget
   Namespace: .asa-*
═══════════════════════════════════════ */

.asa-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ink-black, #0a0a0a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(10,10,10,.25);
    z-index: 9998;
    border: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
.asa-launcher:hover { transform: scale(1.06); box-shadow: 0 14px 36px rgba(10,10,10,.32); }
.asa-launcher.hidden { display: none; }
.asa-launcher .asa-badge-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

.asa-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(10,10,10,.28);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: var(--font-sans, 'Inter', sans-serif);
    border: 1px solid rgba(10,10,10,.08);
}
.asa-window.open { display: flex; animation: asaSlideUp .25s ease; }

@keyframes asaSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* HEADER */
.asa-header {
    background: #0a0a0a;
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.asa-header-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
}
.asa-header-text { flex: 1; line-height: 1.25; }
.asa-header-title { font-size: .95rem; font-weight: 700; }
.asa-header-sub { font-size: .74rem; color: rgba(255,255,255,.55); }
.asa-header-close {
    background: none; border: none; color: rgba(255,255,255,.7);
    font-size: 1rem; cursor: pointer; padding: 6px;
    transition: color .15s ease;
}
.asa-header-close:hover { color: #fff; }

/* BODY / MESSAGES */
.asa-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fafafc;
}
.asa-msg {
    max-width: 88%;
    background: #eef0f4;
    color: #0a0a0a;
    padding: 12px 14px;
    border-radius: 14px 14px 14px 4px;
    font-size: .86rem;
    line-height: 1.5;
}
.asa-msg a { color: #4f46e5; text-decoration: underline; }
.asa-msg.asa-msg-user {
    align-self: flex-end;
    background: #0a0a0a;
    color: #fff;
    border-radius: 14px 14px 4px 14px;
}
.asa-msg-time {
    text-align: center;
    font-size: .7rem;
    color: #9a9aa5;
    margin: 2px 0;
}

/* QUICK ACTIONS */
.asa-quick-actions {
    display: flex;
    gap: 8px;
    padding: 0 18px 14px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.asa-quick-btn {
    background: #0a0a0a;
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
    white-space: nowrap;
}
.asa-quick-btn:hover { background: #1f2128; }
.asa-quick-btn.asa-quick-outline {
    background: #fff;
    color: #0a0a0a;
    border: 1px solid #0a0a0a;
}
.asa-quick-btn.asa-quick-outline:hover { background: #f2f2f5; }

/* INPUT */
.asa-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #ececf1;
    flex-shrink: 0;
}
.asa-input {
    flex: 1;
    border: 1px solid #dcdce4;
    border-radius: 24px;
    padding: 11px 16px;
    font-size: .85rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s ease;
}
.asa-input:focus { border-color: #6366f1; }
.asa-send-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #0a0a0a;
    color: #fff;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease;
}
.asa-send-btn:hover { background: #1f2128; }
.asa-send-btn:disabled { opacity: .4; cursor: not-allowed; }

/* DISCLAIMER */
.asa-disclaimer {
    padding: 10px 18px 16px;
    font-size: .68rem;
    line-height: 1.5;
    color: #9a9aa5;
    flex-shrink: 0;
}
.asa-disclaimer a { color: #6366f1; text-decoration: underline; }

/* TYPING INDICATOR */
.asa-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: #eef0f4;
    border-radius: 14px 14px 14px 4px;
    align-self: flex-start;
    width: fit-content;
}
.asa-typing span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #9a9aa5;
    animation: asaBounce 1.2s infinite;
}
.asa-typing span:nth-child(2) { animation-delay: .15s; }
.asa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes asaBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ✅ AI Sales Assistant — Modal centré sur mobile (au lieu du plein écran) */
.asa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,.45);
    z-index: 9998;
    display: none;
    backdrop-filter: blur(2px);
}
.asa-overlay.open { display: block; }

@media (max-width: 480px) {
    .asa-window {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: calc(100vw - 32px);
        height: min(640px, calc(100vh - 64px));
        max-height: calc(100vh - 64px);
        border-radius: 20px;
        z-index: 9999;
    }
    .asa-window.open { animation: asaModalIn .22s ease; }

    .asa-launcher { bottom: 16px; right: 16px; }
}

@keyframes asaModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Icônes SVG — remplace les anciennes règles fa i ── */

.asa-launcher svg {
    width: 24px;
    height: 24px;
    display: block;
}

.asa-header-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.asa-header-close svg {
    width: 16px;
    height: 16px;
    display: block;
    color: rgba(255,255,255,.7);
    transition: color .15s ease;
}
.asa-header-close:hover svg { color: #fff; }

.asa-send-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    color: #fff;
}