/* Satış asistanı sohbet balonu (assets/js/assistant.js). Renkler sitenin vurgu rengi. */
.aia {
    --aia-accent: #f94620;
    --aia-accent-2: #ff6a4a;
    --aia-ink: #1f2430;
    --aia-muted: #6b7280;
    --aia-line: #e6e8ec;
    --aia-soft: #f5f6f8;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10010;
    font-size: 15px;
    line-height: 1.5;
    color: var(--aia-ink);
}
.aia[dir='rtl'] { right: auto; left: 20px; }
.aia *, .aia *::before, .aia *::after { box-sizing: border-box; }
.has-aia .back_top { bottom: 90px; }

.aia-launcher {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--aia-accent-2), var(--aia-accent));
    box-shadow: 0 10px 28px -10px rgba(249, 70, 32, 0.75);
    cursor: pointer;
    transition: transform 0.2s ease;
}
.aia-launcher:hover { transform: translateY(-2px); }
.aia-launcher:focus-visible, .aia button:focus-visible, .aia input:focus-visible, .aia textarea:focus-visible { outline: 2px solid var(--aia-accent); outline-offset: 2px; }

.aia-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: min(600px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--aia-line);
    border-radius: 16px;
    box-shadow: 0 24px 60px -20px rgba(20, 24, 40, 0.35);
    overflow: hidden;
}
.aia[dir='rtl'] .aia-panel { right: auto; left: 0; }
.aia-panel[hidden] { display: none; }

.aia-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--aia-accent-2), var(--aia-accent));
}
.aia-head strong { display: block; font-size: 16px; }
.aia-head small { display: block; font-size: 12px; opacity: 0.9; line-height: 1.4; margin-top: 2px; }
.aia-close { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 2px; }

.aia-messages { flex: 1; overflow-y: auto; padding: 16px; background: var(--aia-soft); }
.aia-msg { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.aia-user { align-items: flex-end; }
.aia-bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; background: #fff; border: 1px solid var(--aia-line); overflow-wrap: anywhere; }
.aia-user .aia-bubble { background: var(--aia-accent); border-color: var(--aia-accent); color: #fff; white-space: pre-line; }
.aia-bubble p { margin: 0 0 6px; }
.aia-bubble p:last-child { margin-bottom: 0; }
.aia-bubble ul, .aia-bubble ol { margin: 4px 0 6px; padding-inline-start: 20px; }
.aia-bubble a { color: var(--aia-accent); text-decoration: underline; }

.aia-rate { display: flex; gap: 4px; margin-top: 4px; }
.aia-rate button { border: 0; background: transparent; cursor: pointer; font-size: 14px; opacity: 0.45; padding: 2px 4px; border-radius: 6px; }
.aia-rate button:hover, .aia-rate button.is-on { opacity: 1; background: #fff; }

.aia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.aia-chips button, .aia-cta {
    border: 1px solid var(--aia-accent);
    background: #fff;
    color: var(--aia-accent);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13.5px;
    cursor: pointer;
}
.aia-chips button:hover, .aia-cta:hover { background: var(--aia-accent); color: #fff; }
.aia-cta { margin-top: 8px; }
.aia-cta:disabled { opacity: 0.6; cursor: default; }

.aia-typing .aia-bubble { display: inline-flex; gap: 4px; align-items: center; }
.aia-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--aia-muted); animation: aia-dot 1.2s infinite ease-in-out; }
.aia-typing span:nth-child(2) { animation-delay: 0.15s; }
.aia-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aia-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.aia-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.aia-note { font-size: 13px; color: var(--aia-muted); text-align: center; margin: 4px 0 12px; }

.aia-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--aia-line); background: #fff; }
.aia-input { flex: 1; resize: none; border: 1px solid var(--aia-line); border-radius: 12px; padding: 9px 12px; font: inherit; max-height: 120px; }
.aia-send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--aia-accent); color: #fff; cursor: pointer; }
.aia[dir='rtl'] .aia-send svg { transform: scaleX(-1); }
.aia-send:disabled { opacity: 0.5; cursor: default; }
.aia-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.aia-foot { padding: 0 12px 10px; background: #fff; text-align: center; }
.aia-team, .aia-link { border: 0; background: transparent; color: var(--aia-muted); font-size: 12.5px; text-decoration: underline; cursor: pointer; padding: 0; }
.aia-team[hidden] { display: none; }

.aia-contact { background: #fff; border: 1px solid var(--aia-line); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.aia-contact p { margin: 0; font-size: 14px; }
.aia-contact input[type='text'], .aia-contact input[type='email'], .aia-contact input[type='tel'], .aia-contact textarea {
    width: 100%;
    border: 1px solid var(--aia-line);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
}
.aia-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--aia-muted); margin: 0; }
.aia-consent input { margin-top: 3px; flex: none; }
.aia-consent a { color: var(--aia-accent); }
.aia-error { color: #c0261b; font-size: 13px; }
.aia-error[hidden] { display: none; }
.aia-actions { display: flex; gap: 12px; align-items: center; }
.aia-actions .aia-cta { margin-top: 0; background: var(--aia-accent); color: #fff; }

@media (max-width: 575.98px) {
    .aia { right: 14px; bottom: 14px; }
    .aia[dir='rtl'] { left: 14px; }
    .aia.is-open { right: 0; left: 0; bottom: 0; top: 0; }
    .aia.is-open .aia-launcher { display: none; }
    .aia.is-open .aia-panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .aia-launcher, .aia-typing span { transition: none; animation: none; }
}
