/* ============================================================
   AI CHATBOT V1 — mevcut :root token'larını (style.css) kullanır,
   yeni token tanımlamaz. Site tasarım sistemine ek, yeniden tasarım değil.
   ============================================================ */

.chatbot-launcher {
  position: fixed; bottom: 24px; right: 96px; z-index: 95;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--espresso); color: var(--gold-pale);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(36,28,21,0.28);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.chatbot-launcher:hover { background: var(--gold); color: var(--espresso); transform: translateY(-2px); }
.chatbot-launcher svg { width: 24px; height: 24px; }

.chatbot-panel {
  position: fixed; z-index: 250;
  bottom: 96px; right: 24px; width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: 70vh;
  background: var(--porcelain); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(36,28,21,0.35);
  display: flex; flex-direction: column; overflow: hidden;
  animation: chatbotOpen 0.25s var(--ease);
}
.chatbot-panel[hidden] { display: none; }
@keyframes chatbotOpen { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.chatbot-panel-header {
  background: var(--espresso); color: var(--ivory-on-dark);
  padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-size: 1.05rem; flex: 0 0 auto;
}
.chatbot-close { color: var(--ivory-soft-on-dark); font-size: 1.4rem; line-height: 1; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.chatbot-close:hover { color: var(--gold-pale); }

.chatbot-messages {
  flex: 1 1 auto; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.7rem;
}
.chatbot-msg { display: flex; }
.chatbot-msg p { margin: 0; padding: 0.65rem 0.9rem; border-radius: 14px; font-size: 0.92rem; line-height: 1.55; white-space: pre-line; max-width: 85%; }
.chatbot-msg--bot { justify-content: flex-start; }
.chatbot-msg--bot p { background: var(--paper); color: var(--espresso); border: 1px solid var(--hairline); border-bottom-left-radius: 4px; }
.chatbot-msg--user { justify-content: flex-end; }
.chatbot-msg--user p { background: var(--espresso); color: var(--porcelain); border-bottom-right-radius: 4px; }
.chatbot-typing p { opacity: 0.65; font-style: italic; }
.chatbot-msg--action { justify-content: flex-start; }

.chatbot-action-btn {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 0.6rem 1.1rem; border-radius: 999px;
  background: var(--gold); color: var(--espresso); font-size: 0.85rem; font-weight: 600;
  border: none; cursor: pointer; transition: background 0.3s ease;
}
.chatbot-action-btn:hover { background: var(--gold-pale); }

.chatbot-quick-actions {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 1.25rem 0.85rem;
}
.chatbot-chip {
  padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--gold-line);
  background: transparent; color: var(--espresso-soft); font-size: 0.78rem; cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.chatbot-chip:hover { background: var(--gold); color: var(--espresso); border-color: var(--gold); }

.chatbot-input-row {
  flex: 0 0 auto; display: flex; gap: 0.5rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--hairline); background: var(--porcelain);
}
.chatbot-input-row input {
  flex: 1; border: 1px solid var(--hairline); border-radius: 999px; padding: 0.65rem 1rem; font-size: 0.9rem; font-family: var(--font-body); background: var(--paper); color: var(--espresso);
}
.chatbot-input-row input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.chatbot-input-row button {
  width: 40px; height: 40px; border-radius: 50%; background: var(--espresso); color: var(--porcelain);
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
}
.chatbot-input-row button:hover { background: var(--gold); color: var(--espresso); }

/* chatbot açıkken mevcut floating CTA'lar (dikkat dağıtmasın) gizlenir */
body.chatbot-open .wa-float,
body.chatbot-open .mobile-bar { display: none !important; }

@media (max-width: 700px) {
  .chatbot-launcher { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; }
  .chatbot-launcher svg { width: 20px; height: 20px; }
  .chatbot-panel {
    inset: 0; bottom: 0; right: 0; width: 100%; height: 100%; max-height: 100dvh; max-width: 100%;
    border-radius: 0;
  }
}

/* Mobil: aşağı kaydırırken düğme sağa kayıp gizlenir (bkz. js/script.js) */
@media (max-width: 700px) {
  .chatbot-launcher { transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), background 0.3s var(--ease); }
  .chatbot-launcher.is-scroll-hidden { transform: translateX(80px); opacity: 0; pointer-events: none; }
}
