/* ==============================================================================
   🎨 KURUMSAL AI CHATBOT & MODAL STİL DOSYASI (PRIME BUYS MOTORU)
   ============================================================================== */

/* ---------- FAB Floating Button ---------- */
.pt-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999990;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}
.pt-chat-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}
.pt-chat-fab .pt-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.pt-chat-fab .pt-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0f172a;
}
.pt-chat-fab .pt-lbl {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* ---------- Chat Panel ---------- */
.pt-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 999995;
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 110px));
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.pt-chat-panel.pt-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ---------- Chat Header ---------- */
.pt-chat-head {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pt-chat-head .pt-ht b {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.pt-chat-head .pt-ht span {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
}
.pt-chat-head .pt-ctrls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pt-chat-head .pt-btn-clear {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #e2e8f0;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.pt-chat-head .pt-btn-clear:hover {
  background: rgba(255, 255, 255, 0.22);
}
.pt-chat-head .pt-btn-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

/* ---------- Chat Body & Messages ---------- */
.pt-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}
.pt-msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  animation: ptMsgIn 0.2s ease-out;
}
@keyframes ptMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.pt-msg.user {
  align-self: flex-end;
  background: #0284c7;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pt-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}
.pt-msg.bot b {
  color: #0f172a;
  font-weight: 700;
}
.pt-msg a {
  color: #0284c7;
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- 3 Bouncing Dots Typing Indicator ---------- */
.pt-typing {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}
.pt-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: ptBlink 1.2s infinite ease-in-out;
}
.pt-typing i:nth-child(2) { animation-delay: 0.2s; }
.pt-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes ptBlink {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
  30% { opacity: 1; transform: scale(1.15); }
}

/* Streaming Blinking Cursor */
.pt-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #0284c7;
  vertical-align: -2px;
  margin-left: 2px;
  animation: ptCursorBlink 0.75s infinite;
}
@keyframes ptCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- Action Badges & Buttons inside Chat ---------- */
.pt-action-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pt-wa-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  background: #25d366;
  color: #fff !important;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 3px 8px rgba(37, 211, 102, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.pt-wa-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(37, 211, 102, 0.45);
}
.pt-btn-form-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.pt-btn-form-trigger:hover {
  background: #1e293b;
  transform: translateY(-1px);
}
.pt-nav-badge {
  margin-top: 8px;
  padding: 7px 14px;
  background: #ea580c;
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
}

/* ---------- Quick Action Chips ---------- */
.pt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 18px 12px;
  background: #f8fafc;
}
.pt-chips button {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pt-chips button:hover {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}

/* ---------- Chat Input Form ---------- */
.pt-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}
.pt-chat-input input {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.pt-chat-input input:focus {
  border-color: #0284c7;
}
.pt-chat-input button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0284c7;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.pt-chat-input button:hover {
  background: #0369a1;
}

/* ---------- Chat Footer ---------- */
.pt-chat-foot {
  padding: 6px 16px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pt-wa-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #16a34a;
  text-decoration: none;
  font-weight: 700;
}

/* ==============================================================================
   📋 POPUP MODAL (HIZLI TEKLİF & SERVİS FORMU)
   ============================================================================== */
.pt-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s, visibility 0.28s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.pt-modal.pt-modal-open {
  opacity: 1;
  visibility: visible;
}
.pt-modal-card {
  background: #fff;
  border-radius: 20px;
  width: min(96vw, 560px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.pt-modal.pt-modal-open .pt-modal-card {
  transform: none;
}
.pt-modal-head {
  padding: 24px 26px 8px;
  position: relative;
  border-bottom: 1px solid #f1f5f9;
}
.pt-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 24px;
  color: #475569;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
}
.pt-modal-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #0284c7;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.pt-modal-head h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: #0f172a;
  font-weight: 700;
}
.pt-modal-head p {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.pt-modal-body {
  padding: 20px 26px 26px;
}
.pt-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pt-field {
  margin-bottom: 14px;
}
.pt-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}
.pt-field input,
.pt-field select,
.pt-field textarea {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.pt-field input:focus,
.pt-field select:focus,
.pt-field textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.pt-btn-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  margin-top: 6px;
}
.pt-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}
.pt-form-note {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 10px;
  text-align: center;
}

@media (max-width: 480px) {
  .pt-form-row { grid-template-columns: 1fr; gap: 0; }
  .pt-chat-panel { right: 12px; bottom: 80px; width: calc(100vw - 24px); height: calc(100vh - 100px); }
  .pt-chat-fab { right: 16px; bottom: 16px; padding: 10px; }
  .pt-chat-fab .pt-lbl { display: none; }
}

/* MOBILE: FAB yukari alindi (call-now + WhatsApp ile cakismasin) - 03.09.2026 */
@media (max-width: 768px) { .pt-chat-fab { bottom: 96px; } .pt-chat-panel { bottom: 160px; } }

/* === UI LAYOUT v5.2 (09.09) — AI sol altta, sağda WA+Tel ikonları === */
/* 1) AI chatbot FAB: SOL ALT köşe */
.pt-chat-fab {
  right: auto !important;
  left: 24px;
  bottom: 24px;
}
/* 2) Chat panel: sol tarafa açılır */
.pt-chat-panel {
  right: auto !important;
  left: 24px;
  bottom: 96px;
}
/* 3) SAĞ ALT İLETİŞİM CLUSTER: WhatsApp + Telefon yan yana, aynı hizada */
.pt-contact-cluster {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999989;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pt-ci {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.pt-ci:hover { transform: translateY(-2px); }
.pt-ci svg { width: 24px; height: 24px; fill: currentColor; }
.pt-ci-wa { background: #25D366; }
.pt-ci-tel { background: #0284c7; }
/* 4) Site float butonları gizli (JS de gizler — çifte güvence) */
#simple-chat-button--container,
#callnowbutton,
.whatsapp-float,
.chaty-widget,
.chaty-i-trigger,
.csaas-widget-trigger,
.csass-chaty-widget { display: none !important; }
/* Mobil: cluster sağ altta kalır, FAB sol */
@media (max-width: 480px) {
  .pt-chat-fab { left: 16px; bottom: 16px; }
  .pt-chat-panel { left: 12px; bottom: 76px; width: calc(100vw - 24px); }
  .pt-contact-cluster { right: 16px; bottom: 16px; gap: 8px; }
  .pt-ci { width: 46px; height: 46px; }
}

/* === UI v6 (17.09) — premium polish === */
/* Panel açıkken FAB ve sağ cluster gizlenir (mobilde temiz görünüm) */
body.pt-chat-open .pt-chat-fab { opacity: 0 !important; pointer-events: none !important; transform: scale(.85) !important; visibility: hidden !important; }
body.pt-chat-open .pt-contact-cluster { opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; }
.pt-chat-fab, .pt-contact-cluster { transition: opacity .2s ease, transform .2s ease; }
/* Mobil: chips tek satır yatay kaydırılabilir */
@media (max-width: 768px) {
  .pt-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .pt-chips::-webkit-scrollbar { display: none; }
  .pt-chips button { flex: 0 0 auto; }
  .pt-btn-clear { display: none; }
  .pt-chat-head { padding: 12px 14px; }
}
/* Desktop: Temizle butonu ghost stil */
.pt-btn-clear { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #cbd5e1; border-radius: 8px; }
.pt-btn-clear:hover { background: rgba(255,255,255,.08); }
/* Panel premium */
.pt-chat-panel { border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.30); overflow: hidden; }
.pt-chat-head { background: linear-gradient(135deg, #0f172a, #1e293b); }
/* FAB pulse */
.pt-chat-fab .pt-dot { animation: ptPulse 2.4s infinite; }
@keyframes ptPulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5);} 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0);} 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0);} }

/* === v10: Servis Kaydı kartı === */
.pt-ticket-card { background: #f0fdf4; border: 1px solid #86efac; border-radius: 12px; padding: 12px 14px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.pt-ticket-head { font-size: 13.5px; color: #14532d; font-weight: 600; }
.pt-ticket-sub { font-size: 12.5px; color: #166534; }
.pt-ticket-card .pt-wa-badge { margin-top: 2px; }
