/* =====================================================================
   WhatsApp yönlendirmeli destek asistanı (_WhatsAppAssistant.cshtml)
   ===================================================================== */
.tt-wa [hidden], .tt-wa-teaser[hidden], .tt-wa[hidden] { display: none !important; }

/* --- Yüzen buton --- */
.tt-wa-fab.corp-wa-float {
    position: fixed; right: 24px; bottom: 24px; z-index: 9990;
    width: 60px; height: 60px; border-radius: 50%;
    display: grid; place-items: center;
    border: 0; cursor: pointer; color: #fff; font-size: 1.85rem;
    background: linear-gradient(145deg, #2be37a, #12a150);
    box-shadow: 0 14px 30px -10px rgba(18, 161, 80, 0.75), 0 0 0 0 rgba(37, 211, 102, 0.55);
    animation: ttWaPulse 2.8s ease-out infinite;
    transition: transform .25s ease, background .25s ease;
}
.tt-wa-fab:hover { transform: translateY(-2px) scale(1.04); }
.tt-wa-fab > i { grid-area: 1 / 1; transition: transform .3s ease, opacity .2s ease; }
.tt-wa-fab-x { opacity: 0; transform: rotate(-90deg) scale(.6); font-size: 1.35rem; }
.tt-wa-fab.is-open { animation: none; background: var(--brand-800, #123A8A); box-shadow: 0 14px 30px -12px rgba(var(--brand-950-rgb, 10,30,74), .7); }
.tt-wa-fab.is-open .tt-wa-fab-ico { opacity: 0; transform: rotate(90deg) scale(.6); }
.tt-wa-fab.is-open .tt-wa-fab-x { opacity: 1; transform: none; }
.tt-wa-fab-dot {
    position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent, #F26A1B); border: 2px solid #fff;
}
.tt-wa-fab.is-open .tt-wa-fab-dot { display: none; }
@keyframes ttWaPulse {
    0% { box-shadow: 0 14px 30px -10px rgba(18,161,80,.75), 0 0 0 0 rgba(37,211,102,.5); }
    70% { box-shadow: 0 14px 30px -10px rgba(18,161,80,.75), 0 0 0 16px rgba(37,211,102,0); }
    100% { box-shadow: 0 14px 30px -10px rgba(18,161,80,.75), 0 0 0 0 rgba(37,211,102,0); }
}

/* --- Tanıtım balonu --- */
.tt-wa-teaser {
    position: fixed; right: 96px; bottom: 34px; z-index: 9989;
    max-width: 260px; padding: .85rem 2rem .85rem 1rem;
    background: #fff; color: var(--text-main, #14213D);
    border-radius: 16px 16px 4px 16px; border: 1px solid var(--line, #E3E9F2);
    box-shadow: 0 18px 40px -18px rgba(var(--shadow-rgb, 16,32,72), .45);
    font-size: .86rem; line-height: 1.45; cursor: pointer;
    opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .25s ease, transform .25s ease;
}
.tt-wa-teaser.is-on { opacity: 1; transform: none; }
.tt-wa-teaser strong { display: block; margin-bottom: .15rem; font-size: .92rem; }
.tt-wa-teaser span { color: var(--text-muted, #56637A); }
.tt-wa-teaser-x { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 1.2rem; color: #94a3b8; cursor: pointer; line-height: 1; padding: 4px; }

/* --- Panel --- */
.tt-wa {
    position: fixed; right: 24px; bottom: 96px; z-index: 9991;
    width: 380px; max-height: min(640px, calc(100vh - 120px));
    display: flex; flex-direction: column;
    background: var(--surface-1, #F8FAFF);
    border-radius: 20px; overflow: hidden;
    border: 1px solid rgba(var(--brand-rgb, 26,77,179), .12);
    box-shadow: 0 30px 70px -25px rgba(var(--brand-950-rgb, 10,30,74), .55);
    opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right;
    transition: opacity .25s ease, transform .3s cubic-bezier(.16,1,.3,1);
    font-family: 'Inter', system-ui, sans-serif;
}
.tt-wa.is-open { opacity: 1; transform: none; }

.tt-wa-head {
    display: flex; align-items: center; gap: .75rem;
    padding: .9rem 1rem; color: #fff;
    background: linear-gradient(120deg, var(--brand-950, #0A1E4A), var(--brand-700, #1A4DB3));
}
.tt-wa-avatar { position: relative; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: #fff; display: grid; place-items: center; }
.tt-wa-avatar img { width: 30px; height: 30px; }
.tt-wa-presence { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2px solid var(--brand-900, #0D2A66); }
.tt-wa.is-offline .tt-wa-presence { background: #f59e0b; }
.tt-wa-headtext { flex: 1; min-width: 0; }
.tt-wa-headtext h2 { margin: 0; font: 700 1rem/1.2 'Plus Jakarta Sans', 'Inter', sans-serif; color: #fff; }
.tt-wa-headtext span { display: block; font-size: .74rem; opacity: .8; margin-top: .15rem; }
.tt-wa-close, .tt-wa-back {
    flex: 0 0 34px; height: 34px; border-radius: 10px; border: 0; cursor: pointer;
    background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center;
}
.tt-wa-close:hover, .tt-wa-back:hover { background: rgba(255,255,255,.22); }
.tt-wa-progress { height: 3px; background: rgba(var(--brand-rgb, 26,77,179), .12); }
.tt-wa-progress span { display: block; height: 100%; width: 33%; background: linear-gradient(90deg, #22c55e, var(--accent, #F26A1B)); transition: width .35s ease; }

.tt-wa-body { flex: 1; overflow-y: auto; padding: 1rem; overscroll-behavior: contain; }
.tt-wa-step { display: none; }
.tt-wa-step.is-on { display: block; animation: ttWaIn .3s ease both; }
@keyframes ttWaIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

.tt-wa-msg {
    background: #fff; border: 1px solid var(--line, #E3E9F2);
    border-radius: 4px 16px 16px 16px; padding: .75rem .9rem; margin-bottom: .9rem;
    font-size: .88rem; line-height: 1.5; color: var(--text-main, #14213D);
}
.tt-wa-msg p { margin: 0; }
.tt-wa-context {
    display: flex; align-items: center; gap: .55rem; margin-bottom: .9rem;
    padding: .6rem .8rem; border-radius: 12px; font-size: .8rem;
    background: rgba(var(--accent-rgb, 242,106,27), .08); color: var(--accent-600, #D9550B);
    border: 1px dashed rgba(var(--accent-rgb, 242,106,27), .35);
}
.tt-wa-context strong { color: var(--text-main, #14213D); }

.tt-wa-topics { display: grid; gap: .5rem; }
.tt-wa-topic {
    display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
    padding: .7rem .8rem; border-radius: 14px; cursor: pointer;
    background: #fff; border: 1px solid var(--line, #E3E9F2); color: var(--text-main, #14213D);
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.tt-wa-topic:hover, .tt-wa-topic:focus-visible { border-color: var(--brand-600, #2563EB); transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(var(--shadow-rgb, 16,32,72), .6); outline: none; }
.tt-wa-topic > span:nth-child(2) { flex: 1; min-width: 0; }
.tt-wa-topic strong { display: block; font-size: .9rem; }
.tt-wa-topic small { display: block; font-size: .76rem; color: var(--text-muted, #56637A); margin-top: .1rem; }
.tt-wa-topic > .fa-chevron-right { color: #94a3b8; font-size: .75rem; }
.tt-wa-topic-ico {
    flex: 0 0 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
    color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff);
}
.tt-wa-alt { display: flex; gap: .4rem; margin-top: .9rem; flex-wrap: wrap; }
.tt-wa-alt a {
    flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem .6rem; border-radius: 10px; font-size: .78rem; font-weight: 600; text-decoration: none;
    color: var(--brand-800, #123A8A); background: var(--brand-50, #EEF4FF);
}
.tt-wa-alt a:hover { background: var(--brand-100, #DCE7FF); }

/* Form */
.tt-wa-field { display: grid; gap: .35rem; margin-bottom: .8rem; }
.tt-wa-field label { font-size: .78rem; font-weight: 700; color: var(--text-main, #14213D); }
.tt-wa-field input, .tt-wa-field textarea {
    width: 100%; box-sizing: border-box; padding: .6rem .75rem; border-radius: 10px;
    border: 1px solid var(--border-strong, #C9D5E8); background: #fff; color: var(--text-main, #14213D);
    font: inherit; font-size: .88rem; resize: vertical;
}
.tt-wa-field input:focus, .tt-wa-field textarea:focus { outline: none; border-color: var(--brand-600, #2563EB); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 26,77,179), .15); }
.tt-wa-field textarea.is-err { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.tt-wa-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tt-wa-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tt-wa-chips button {
    padding: .35rem .65rem; border-radius: 999px; cursor: pointer; font-size: .76rem; font-weight: 600;
    border: 1px solid var(--line, #E3E9F2); background: #fff; color: var(--brand-800, #123A8A);
    transition: all .15s ease;
}
.tt-wa-chips button:hover { border-color: var(--brand-600, #2563EB); }
.tt-wa-chips button.is-on { background: var(--brand-800, #123A8A); border-color: var(--brand-800, #123A8A); color: #fff; }

.tt-wa-next, .tt-wa-send {
    display: flex; align-items: center; justify-content: center; gap: .55rem; width: 100%;
    height: 48px; border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
    font: 700 .95rem 'Inter', sans-serif; color: #fff;
}
.tt-wa-next { background: linear-gradient(120deg, var(--brand-800, #123A8A), var(--brand-600, #2563EB)); margin-top: .2rem; }
.tt-wa-send { background: linear-gradient(145deg, #25d366, #12a150); box-shadow: 0 12px 24px -12px rgba(18,161,80,.8); }
.tt-wa-send i { font-size: 1.25rem; }
.tt-wa-next:hover, .tt-wa-send:hover { filter: brightness(1.06); }

.tt-wa-preview {
    white-space: pre-wrap; word-break: break-word;
    margin-bottom: .9rem; padding: .8rem .9rem; font-size: .84rem; line-height: 1.5;
    background: #dcf8c6; color: #111b21; border-radius: 14px 4px 14px 14px;
    box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.tt-wa-edit { display: block; margin: .6rem auto 0; border: 0; background: none; color: var(--brand-700, #1A4DB3); font-weight: 600; font-size: .82rem; cursor: pointer; }
.tt-wa-fine { margin: .7rem 0 0; text-align: center; font-size: .72rem; color: var(--text-muted, #56637A); }

/* Ürün detayındaki sabit alt çubukla çakışmasın */
body:has(.tt-sticky-cta) .tt-wa-teaser { display: none !important; }

/* --- Mobil: alttan açılan panel --- */
@media (max-width: 640px) {
    .tt-wa-fab.corp-wa-float { right: 16px; bottom: 16px; width: 56px; height: 56px; font-size: 1.7rem; }
    .tt-wa-teaser { right: 82px; bottom: 22px; max-width: calc(100vw - 110px); }
    .tt-wa {
        left: 0; right: 0; bottom: 0; width: auto;
        max-height: 88vh; max-height: 88dvh;
        border-radius: 20px 20px 0 0; transform: translateY(100%); transform-origin: bottom center;
    }
    .tt-wa.is-open { transform: none; }
    .tt-wa-body { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
    html.tt-wa-open .tt-wa-fab { opacity: 0; pointer-events: none; }
    html.tt-wa-open { overflow: hidden; }
    .tt-wa-row { grid-template-columns: 1fr; gap: 0; }
    .tt-wa-field input, .tt-wa-field textarea { font-size: 16px; } /* iOS yakınlaştırmasını engelle */
}
@media (prefers-reduced-motion: reduce) {
    .tt-wa-fab { animation: none; }
    .tt-wa, .tt-wa-step.is-on, .tt-wa-teaser { transition: none; animation: none; }
}
