/* Vitrin sohbet botu: yalnız B2B_Tanimlar.AiChatbotAktif açık tenantta yüklenir. */
.aic-open { position: fixed; left: 20px; bottom: 20px; z-index: 1040; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 24px 0 20px; border: 0; border-radius: 999px; background: var(--aic-bg, var(--primaryColor)); color: var(--aic-fg, var(--on-primary, #fff)); font-weight: 700; font-size: 17px; box-shadow: var(--sh-rest, 0 6px 18px rgba(0, 0, 0, .22)); cursor: pointer; }
.aic-open[hidden] { display: none; }
.aic-open i { font-size: 22px; }
.aic-open:focus-visible, .aic-panel button:focus-visible, .aic-panel a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.aic-panel { position: fixed; left: 20px; bottom: 20px; z-index: 1041; display: flex; flex-direction: column; width: 360px; max-width: calc(100vw - 32px); height: min(540px, calc(100vh - 40px)); background: #fff; color: #1f2329; border-radius: var(--r-16, 16px); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.aic-panel[hidden] { display: none; }
.aic-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--aic-bg, var(--primaryColor)); color: var(--aic-fg, var(--on-primary, #fff)); }
.aic-close { width: 32px; height: 32px; border: 0; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
.aic-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; overflow-y: auto; background: #f6f7f9; }
.aic-msg { max-width: 86%; padding: 8px 12px; border-radius: var(--r-12, 12px); font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.aic-bot { align-self: flex-start; background: #fff; color: #1f2329; border: 1px solid #e6e8ec; }
.aic-user { align-self: flex-end; background: #1f2329; color: #fff; }
.aic-wait { color: #5b626c; }
.aic-products { display: flex; flex-direction: column; gap: 6px; }
.aic-products a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: #fff; border: 1px solid #e6e8ec; border-radius: var(--r-10, 10px); color: #1f2329; text-decoration: none; }
.aic-products a:hover { border-color: var(--primaryColor); }
.aic-p-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.aic-p-code { font-size: 12px; color: #5b626c; }
.aic-form { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid #e6e8ec; }
.aic-form input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid #d5d8de; border-radius: var(--r-10, 10px); font-size: 16px; color: #1f2329; background: #fff; }
.aic-form button { width: 44px; min-height: 40px; border: 0; border-radius: var(--r-10, 10px); background: #1f2329; color: #fff; cursor: pointer; }
.aic-form button:disabled { opacity: .55; cursor: default; }
.aic-note { padding: 0 10px 8px; background: #fff; font-size: 11px; color: #5b626c; }
@media (max-width: 991.98px) {
    .aic-open { left: 16px; bottom: 84px; width: 56px; padding: 0; justify-content: center; }
    .aic-open span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .aic-panel { left: 16px; right: 16px; bottom: 16px; width: auto; max-width: none; height: min(560px, calc(100vh - 32px)); }
}

/* Önerilen ürün kartı + sepete ekle */
.aic-product { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #fff; border: 1px solid #e6e8ec; border-radius: var(--r-10, 10px); }
.aic-products .aic-product a.aic-p-link { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.aic-p-link img { flex: 0 0 48px; width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: var(--r-8, 8px); }
.aic-p-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aic-p-add { min-height: 36px; border: 0; border-radius: var(--r-8, 8px); background: #1f2329; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.aic-p-add:disabled { opacity: .55; cursor: default; }
.aic-p-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.aic-products .aic-product a.aic-p-cart { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 8px; border: 1px solid #1f2329; border-radius: var(--r-8, 8px); background: #fff; color: #1f2329; font-size: 13px; font-weight: 600; text-decoration: none; }
.aic-products .aic-product a.aic-p-cart:hover { background: #f3f4f6; }
/* "Hemen Sipariş Ver" (instant-order.js yüklüyse): kartın altında tam genişlik, marka renginde */
.aic-products .aic-product .aic-p-now { grid-column: 1 / -1; min-height: 36px; padding: 0 8px; border: 0; border-radius: var(--r-8, 8px); background: var(--aic-bg, var(--primaryColor)); color: var(--aic-fg, var(--on-primary, #fff)); font-size: 13px; font-weight: 700; cursor: pointer; }
.aic-products .aic-product .aic-p-now:focus-visible { outline: 2px solid #1f2329; outline-offset: 2px; }
.aic-products a.aic-login { padding: 8px 10px; background: transparent; border: 0; font-size: 13px; font-weight: 600; text-decoration: underline; text-align: center; }

.aic-consent { padding: 12px; background: #fff; border-top: 1px solid #e6e8ec; font-size: 13px; line-height: 1.4; color: #1f2329; }
.aic-consent p { margin: 0 0 8px; }
.aic-consent button { width: 100%; min-height: 40px; border: 0; border-radius: var(--r-10, 10px); background: #1f2329; color: #fff; font-weight: 600; cursor: pointer; }
.aic-form[hidden], .aic-consent[hidden] { display: none; }

/* Sağ alt konum (B2B_Tanimlar.AiChatbotKonum = right) */
/* Sağ altta "yukarı çık" düğmesi (app.css .back-to-top) var: düğme onun üstünde durur. */
.aic-open.aic-right { left: auto; right: 20px; bottom: 92px; }
.aic-teaser.aic-right { left: auto; right: 16px; }
.aic-panel.aic-right { left: auto; right: 20px; }
@media (max-width: 991.98px) {
    /* Mobilde sağ altta sosyal medya düğmesi (custom.css .floating-social-bar, bottom 80px) de var. */
    .aic-open.aic-right { left: auto; right: 16px; bottom: 140px; }
    .aic-panel.aic-right { left: 16px; right: 16px; }
}

/* Davet balonu ("Sohbet açık gelsin" — yalnız mobilde, oturumda bir kez). Düğmenin hemen üstünde. */
.aic-teaser { position: fixed; left: 16px; bottom: 150px; z-index: 1040; display: flex; align-items: flex-start; gap: 4px; max-width: min(300px, calc(100vw - 32px)); padding: 12px 8px 12px 14px; background: #fff; color: #1f2329; border-radius: var(--r-16, 16px); box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
.aic-teaser[hidden] { display: none; }
.aic-teaser-text { flex: 1 1 auto; padding: 0; border: 0; background: transparent; color: inherit; font-size: 15px; font-weight: 600; line-height: 1.35; text-align: left; cursor: pointer; }
.aic-teaser-close { flex: 0 0 28px; height: 28px; border: 0; background: transparent; color: #5b626c; font-size: 16px; cursor: pointer; }
.aic-teaser button:focus-visible { outline: 2px solid #1f2329; outline-offset: 2px; }
@media (max-width: 991.98px) {
    .aic-teaser.aic-right { bottom: 206px; }
}

/* Toner maskotu (AiChatbotIkon = "mascot"): yazısız karakter düğmesi (.aic-mbtn) + konuşma balonu, ikisi .aic-dock içinde.
   İlk açılışta yazıcıdan basılarak çıkar (.aic-birth, oturumda bir kez), gözleri imleci izler (JS). */
.aic-dock { position: fixed; left: 20px; bottom: 40px; z-index: 1040; }
.aic-dock.aic-right { left: auto; right: 20px; bottom: 120px; }
.aic-mbtn { position: relative; display: block; width: 96px; height: 108px; padding: 0; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.aic-mbtn[hidden] { display: none; }
.aic-mbtn:focus-visible { outline: 2px solid #1f2329; outline-offset: 2px; border-radius: var(--r-12, 12px); }
.aic-mstage { position: absolute; inset: -40px -24px -14px -24px; pointer-events: none; }
.aic-mstage > .aic-mascot { position: absolute; left: 24px; top: 40px; width: calc(100% - 48px); height: calc(100% - 54px); overflow: visible; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .22)); transform-origin: 50% 100%; }
.aic-printer { display: none; position: absolute; left: 50%; bottom: -3px; width: 96px; height: 48px; margin-left: -48px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
.aic-birth .aic-mstage { overflow: hidden; }
.aic-birth .aic-printer { display: block; animation: aic-printer 2.6s ease-in-out both; }
.aic-birth .aic-printer-led { animation: aic-led .25s steps(2) infinite; }
.aic-birth .aic-mstage > .aic-mascot { animation: aic-born 2.6s linear both; }
@keyframes aic-printer { 0% { opacity: 0; transform: translateY(14px); } 8%, 74% { opacity: 1; transform: translateY(0); } 20%, 30%, 40%, 50% { transform: translate(-1px, 0); } 25%, 35%, 45%, 55% { transform: translate(1px, 0); } 88%, 100% { opacity: 0; transform: translateY(16px); } }
@keyframes aic-led { 0% { opacity: 1; } 100% { opacity: .25; } }
@keyframes aic-born {
    0%, 12% { transform: translateY(116px); }
    18% { transform: translate(-1px, 92px); } 24% { transform: translate(1px, 74px); } 30% { transform: translate(-1px, 56px); }
    36% { transform: translate(1px, 42px); } 42% { transform: translate(-1px, 30px); } 50% { transform: translate(0, 22px); }
    62% { transform: translateY(-30px) rotate(-6deg); animation-timing-function: ease-in; }
    76% { transform: translateY(0) scale(1.1, .88); }
    84% { transform: scale(.95, 1.06); } 92% { transform: scale(1.02, .98); } 100% { transform: none; }
}
.aic-m-bob { animation: aic-bob 2.8s ease-in-out infinite; }
.aic-m-shadow { transform-origin: 32px 69px; animation: aic-shadow 2.8s ease-in-out infinite; }
.aic-m-eyes { transform-box: fill-box; transform-origin: center; animation: aic-blink 4.2s infinite; }
.aic-m-pupils { transition: transform .12s ease-out; }
.aic-m-wave { transform-box: view-box; transform-origin: 51px 45px; animation: aic-wave 4.2s ease-in-out infinite; }
.aic-m-hat { transform-box: view-box; transform-origin: 32px 27px; transition: transform .25s ease; }
.aic-m-mouth { transform-box: fill-box; transform-origin: 50% 0; }
.aic-mbtn:hover .aic-m-hat, .aic-mbtn:focus-visible .aic-m-hat { transform: rotate(-12deg) translateY(-4px); }
.aic-mbtn:hover .aic-m-wave { animation-duration: 1s; }
.aic-mbtn.aic-talk .aic-m-mouth { animation: aic-talk .32s ease-in-out infinite alternate; }
.aic-mbtn.aic-talk .aic-m-hat { animation: aic-hat-bounce .64s ease-in-out infinite; }
@keyframes aic-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes aic-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.82); opacity: .7; } }
@keyframes aic-blink { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.1); } }
@keyframes aic-wave { 0%, 55%, 100% { transform: rotate(0); } 62% { transform: rotate(-22deg); } 70% { transform: rotate(10deg); } 78% { transform: rotate(-22deg); } 86% { transform: rotate(4deg); } }
@keyframes aic-talk { 0% { transform: scaleY(.45); } 100% { transform: scaleY(1.25); } }
@keyframes aic-hat-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px) rotate(-3deg); } }

/* Konuşma balonu: maskotun ağız hizasında, sağ konumda solunda (sol konumda sağında). */
.aic-bubble { position: absolute; bottom: 44px; left: calc(100% + 6px); display: flex; align-items: flex-start; gap: 2px; width: max-content; max-width: min(250px, calc(100vw - 140px)); padding: 10px 6px 10px 14px; background: #fff; color: #1f2329; border-radius: var(--r-16, 16px); box-shadow: 0 10px 28px rgba(0, 0, 0, .2); transform-origin: 0 100%; animation: aic-pop .35s cubic-bezier(.34, 1.56, .64, 1); }
.aic-bubble::after { content: ""; position: absolute; left: -6px; bottom: 14px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); border-radius: 2px; }
.aic-right .aic-bubble { left: auto; right: calc(100% + 6px); transform-origin: 100% 100%; }
.aic-right .aic-bubble::after { left: auto; right: -6px; }
.aic-bubble[hidden] { display: none; }
.aic-bubble-text { position: relative; z-index: 1; padding: 0; border: 0; background: transparent; color: inherit; font-size: 15px; font-weight: 700; line-height: 1.35; text-align: left; cursor: pointer; }
.aic-bubble-close { position: relative; z-index: 1; flex: 0 0 24px; height: 24px; border: 0; background: transparent; color: #5b626c; font-size: 14px; cursor: pointer; }
.aic-bubble button:focus-visible { outline: 2px solid #1f2329; outline-offset: 2px; }
@keyframes aic-pop { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: scale(1); } }

.aic-head-title { display: inline-flex; align-items: center; gap: 8px; }
.aic-head-mascot { display: inline-block; width: 30px; height: 34px; }
.aic-head-mascot .aic-mascot { width: 100%; height: 100%; overflow: visible; }
.aic-head-mascot .aic-m-shadow, .aic-head-mascot .aic-m-wave { display: none; }
@media (max-width: 991.98px) {
    .aic-dock { left: 12px; bottom: 80px; }
    .aic-dock.aic-right { left: auto; right: 12px; bottom: 136px; }
    .aic-mbtn { width: 70px; height: 79px; }
    .aic-bubble { bottom: 34px; }
    .aic-bubble-text { font-size: 14px; }
    body:has(.floating-social-left) .aic-dock.aic-right { bottom: 80px; }
    body:has(.floating-social-left) .aic-dock:not(.aic-right) { bottom: 136px; }
}
@media (prefers-reduced-motion: reduce) {
    .aic-m-bob, .aic-m-shadow, .aic-m-eyes, .aic-m-wave, .aic-bubble, .aic-mbtn.aic-talk .aic-m-mouth, .aic-mbtn.aic-talk .aic-m-hat { animation: none; }
    .aic-m-hat, .aic-m-pupils { transition: none; }
}

/* Sosyal medya şeridi solda (custom.css .floating-social-left): mobilde aynı köşeyi paylaşmasınlar. */
@media (max-width: 991.98px) {
    body:has(.floating-social-left) .aic-open.aic-right { bottom: 84px; }
    body:has(.floating-social-left) .aic-teaser.aic-right { bottom: 150px; }
    body:has(.floating-social-left) .aic-open:not(.aic-right) { bottom: 140px; }
    body:has(.floating-social-left) .aic-teaser:not(.aic-right) { bottom: 206px; }
}
