/* Kiralama asistanı: sağdan açılan geniş panel, sade ve modern (sohbet odaklı). Renkler temadan gelir. */
:root {
  --kb-bg: #faf9f6;
  --kb-surface: #ffffff;
  --kb-user: #f0eee8;
  --kb-line: #e8e5dd;
  --kb-text: var(--ink, #1d1d27);
  --kb-soft: #6b6a66;
  --kb-accent: var(--ink, #1d1d27);
}

/* Açma butonu */
.kb-fab { position: fixed; right: 20px; bottom: 20px; z-index: 140; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--kb-accent); color: #fff; font: 600 14.5px/1 var(--font, system-ui); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); cursor: pointer; border: 0; transition: transform .2s, opacity .2s, box-shadow .2s; }
.kb-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
.kb-fab.hide { opacity: 0; pointer-events: none; transform: translateY(10px); }

/* Panel */
.kb-chat { position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: min(688px, 100vw); display: flex; flex-direction: column; background: var(--kb-bg); color: var(--kb-text); font-family: var(--font, system-ui); box-shadow: -24px 0 60px rgba(20, 18, 12, .12); border-left: 1px solid var(--kb-line); transform: translateX(100%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); }
.kb-chat[hidden] { display: flex; visibility: hidden; }
.kb-chat.open { transform: none; visibility: visible; }

/* İnce, sade kaydırma çubukları (panel, kartlar, mesaj kutusu) */
.kb-chat * { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .16) transparent; }
.kb-chat ::-webkit-scrollbar { width: 6px; height: 6px; }
.kb-chat ::-webkit-scrollbar-track { background: transparent; }
.kb-chat ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .14); border-radius: 99px; }
.kb-chat ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .26); }

/* Başlık */
.kb-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--kb-bg); border-bottom: 1px solid var(--kb-line); }
.kb-logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none; color: var(--kb-text); }
.kb-logo .logo-mark { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.kb-logo .logo-text { font-size: 21px; }
.kb-logo img { height: 30px; width: auto; max-width: 150px; object-fit: contain; }
.kb-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: var(--kb-line); }
.kb-avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--kb-accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.kb-title { flex: 1; min-width: 0; }
.kb-title b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.1px; }
.kb-title small { display: block; color: var(--kb-soft); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--kb-soft); background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.kb-icon:hover { background: rgba(0, 0, 0, .05); color: var(--kb-text); }

/* Üst şerit: WhatsApp · Telefonla ara · Bilgi formu — tam genişlik, eşit parçalar, boşluksuz */
.kb-quick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
.kb-quick a, .kb-quick button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; margin: 0; border: 0; border-radius: 0; color: #fff; font: 600 14px var(--font, system-ui); text-decoration: none; cursor: pointer; transition: filter .15s; }
.kb-quick a:hover, .kb-quick button:hover { filter: brightness(1.08); }
.kb-q-wa { background: #168a45; }
.kb-q-call { background: #c8102e; }
.kb-q-form { background: var(--kb-accent); }
.kb-q-form.on { filter: brightness(1.25); }
.kb-lead { padding: 14px 18px 16px; background: var(--kb-surface); border-bottom: 1px solid var(--kb-line); display: flex; flex-direction: column; gap: 10px; }
.kb-lead[hidden] { display: none; }
.kb-lead p { margin: 0; font-size: 13.5px; color: var(--kb-soft); }
.kb-lead-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kb-lead input, .kb-lead textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--kb-line); border-radius: 12px; padding: 10px 12px; font: 14px/1.4 var(--font, system-ui); background: var(--kb-bg); color: var(--kb-text); outline: none; resize: none; }
.kb-lead input:focus, .kb-lead textarea:focus { border-color: #cfcabf; background: #fff; }
.kb-lead-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kb-lead-foot button { height: 40px; padding: 0 22px; border-radius: 12px; border: 0; background: var(--kb-accent); color: #fff; font: 600 14px var(--font, system-ui); cursor: pointer; }
.kb-lead-foot button:disabled { opacity: .5; }
.kb-lead-msg { font-size: 13px; color: var(--kb-soft); }
.kb-lead-msg.err { color: #b42318; }
[data-corners="square"] .kb-chat .kb-quick a, [data-corners="square"] .kb-chat .kb-quick button { border-radius: 0 !important; }

/* Mesaj akışı: ortalı, okunaklı sütun */
.kb-log { flex: 1; overflow-y: auto; padding: 24px 28px 12px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.kb-log > * { flex-shrink: 0; width: 100%; max-width: 620px; margin-left: auto; margin-right: auto; }
.kb-msg { font-size: 15px; line-height: 1.62; word-wrap: break-word; animation: kb-in .22s ease; }
@keyframes kb-in { from { opacity: 0; transform: translateY(4px); } }
.kb-msg.user { width: auto; max-width: min(80%, 500px); margin-right: max(0px, calc((100% - 620px) / 2)); align-self: flex-end; background: var(--kb-user); color: var(--kb-text); padding: 10px 16px; border-radius: 18px; }
.kb-msg.bot { padding: 2px 2px; color: var(--kb-text); }
.kb-msg.bot p { margin: 0 0 10px; }
.kb-msg.bot p:last-child { margin-bottom: 0; }
.kb-msg.bot ul { margin: 4px 0 10px; padding-left: 20px; }
.kb-msg.bot li { margin: 3px 0; }
.kb-msg.bot b { font-weight: 600; }
.kb-msg.err { background: #fff4f2; color: #a8321f; border: 1px solid #f3d3cc; padding: 10px 14px; border-radius: 14px; font-size: 14px; }
.kb-status { display: flex; align-items: center; gap: 8px; color: var(--kb-soft); font-size: 13px; padding: 0 2px; }
.kb-dots { display: inline-flex; gap: 4px; }
.kb-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: kb-blink 1.2s infinite; }
.kb-dots i:nth-child(2) { animation-delay: .15s; } .kb-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes kb-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Ürün kartları: yatay şerit, ince çubuk */
.kb-cards { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.kb-card { flex: 0 0 210px; scroll-snap-align: start; background: var(--kb-surface); border: 1px solid var(--kb-line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.kb-card:hover { box-shadow: 0 8px 24px rgba(20, 18, 12, .08); transform: translateY(-1px); }
.kb-card img, .kb-card .kb-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f1efe9; display: block; }
.kb-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.kb-card-body b { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card-body small { color: var(--kb-soft); font-size: 12px; }
.kb-card-price { font-weight: 700; font-size: 14.5px; margin-top: auto; padding-top: 4px; }
.kb-card-price small { font-weight: 400; }
.kb-card-act { display: flex; gap: 6px; margin-top: 8px; }
.kb-card-act a, .kb-card-act button { flex: 1; height: 32px; border-radius: 10px; font: 600 12.5px var(--font, system-ui); display: grid; place-items: center; cursor: pointer; border: 1px solid var(--kb-line); background: var(--kb-surface); color: var(--kb-text); text-decoration: none; transition: background .15s; }
.kb-card-act a:hover { background: #f6f4ef; }
.kb-card-act button { background: var(--kb-accent); color: #fff; border-color: var(--kb-accent); }
.kb-card-act button.done { background: #e9f7ef; color: #11733c; border-color: #bfe5cd; }

/* Fiyat özeti */
.kb-quote { background: var(--kb-surface); border: 1px solid var(--kb-line); border-radius: 16px; padding: 14px 16px; font-size: 14px; }
.kb-quote div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.kb-quote span { color: var(--kb-soft); }
.kb-quote .total { border-top: 1px dashed var(--kb-line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 16px; }

/* Seçenekler ve aksiyonlar */
.kb-options, .kb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-options button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--kb-line); background: var(--kb-surface); color: var(--kb-text); font: 500 13.5px var(--font, system-ui); cursor: pointer; transition: border-color .15s, background .15s; }
.kb-options button:hover { border-color: #c9c5bb; background: #f6f4ef; }
.kb-options.used { opacity: .45; pointer-events: none; }
.kb-actions a { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 12px; font: 600 14px var(--font, system-ui); text-decoration: none; border: 1px solid var(--kb-line); color: var(--kb-text); background: var(--kb-surface); }
.kb-actions a.primary { background: var(--red, #e3182d); border-color: var(--red, #e3182d); color: #fff; }

/* Yazma kutusu: tek parça, gönder butonu içinde */
.kb-compose { padding: 10px 28px 18px; background: var(--kb-bg); }
.kb-box { max-width: 620px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; background: var(--kb-surface); border: 1px solid var(--kb-line); border-radius: 22px; box-shadow: 0 4px 18px rgba(20, 18, 12, .06); transition: border-color .15s, box-shadow .15s; }
.kb-box:focus-within { border-color: #cfcabf; box-shadow: 0 6px 24px rgba(20, 18, 12, .1); }
.kb-compose textarea { flex: 1; resize: none; border: 0; padding: 8px 0; font: 15px/1.5 var(--font, system-ui); max-height: 160px; min-height: 24px; outline: none; background: transparent; color: var(--kb-text); overflow-y: auto; scrollbar-width: none; }
.kb-compose textarea::-webkit-scrollbar { display: none; }
.kb-compose textarea::placeholder { color: #9a988f; }
.kb-send { width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--kb-accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: opacity .15s, transform .15s; }
.kb-send:not(:disabled):hover { transform: translateY(-1px); }
.kb-send:disabled { opacity: .25; cursor: default; }
.kb-hint { max-width: 620px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: #9a988f; }

[data-corners="square"] .kb-chat *, [data-corners="square"] .kb-fab { border-radius: 0 !important; }

@media (max-width: 720px) {
  .kb-log { padding: 18px 16px 10px; }
  .kb-compose { padding: 8px 12px 14px; }
}
@media (max-width: 560px) {
  .kb-logo .logo-text, .kb-sep { display: none; }
  .kb-lead-row { grid-template-columns: 1fr; }
  .kb-quick a span, .kb-quick button span { font-size: 13px; }
  .kb-fab span { display: none; }
  .kb-fab { width: 56px; height: 56px; padding: 0; justify-content: center; right: 16px; bottom: 16px; }
  .kb-chat { width: 100vw; border-left: 0; }
  .kb-card { flex-basis: 180px; }
}
