/* Sohbet botu görünümü: kaynak sitedeki asistanın birebir görünümü — sağ altta sayfanın üstünde yüzen koyu lacivert pencere
   (380 px, köşe 16 px, derin gölge), turkuaz-yeşil başlık (robot kutusu + ad + «Çevrimiçi»), balonlu mesajlar, 2 sütunlu hızlı
   sorular, ayrık yazı kutusu ve gönder düğmesi; kapalıyken turkuaz-yeşil yuvarlak robot balonu (80 px, telefonda 64 px), nabız
   halkası, yeşil nokta ve dönen «Merhaba!» konuşma kabarcığı. Bot paketinin yapısı değişmez; yalnız değişkenler ve görünüm. */
#kp-bot {
  --zemin: #0f172a;
  --metin: #f1f5f9;
  --yuzey-2: #1e293b;
  --kenar: #334155;
  --soluk: #94a3b8;
  --vurgu: #0891b2;
  --vurgu-ustu: #fff;
  --b-gradyan: linear-gradient(135deg, #0891b2 0%, #0d9488 50%, #059669 100%);
  --b-robot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='8' width='16' height='12' rx='3' fill='white'/%3E%3Ccircle cx='9' cy='13' r='2' fill='%230891b2'/%3E%3Ccircle cx='15' cy='13' r='2' fill='%230891b2'/%3E%3Crect x='8' y='17' width='8' height='1.5' rx='.75' fill='%230891b2'/%3E%3Cline x1='12' y1='8' x2='12' y2='4' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='3' r='2' fill='white'/%3E%3Crect x='1' y='11' width='3' height='5' rx='1' fill='white'/%3E%3Crect x='20' y='11' width='3' height='5' rx='1' fill='white'/%3E%3C/svg%3E");
  --b-robot-bas: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='8' width='16' height='12' rx='3' fill='white'/%3E%3Ccircle cx='9' cy='13' r='1.5' fill='%230d9488'/%3E%3Ccircle cx='15' cy='13' r='1.5' fill='%230d9488'/%3E%3Crect x='8' y='16.5' width='8' height='1.5' rx='.75' fill='%230d9488'/%3E%3Cline x1='12' y1='8' x2='12' y2='5' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='4' r='1.5' fill='white'/%3E%3C/svg%3E");
  --b-ucak: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='white' d='M498 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480v-83.6c0-4 1.5-7.8 4.2-10.8l167.6-182.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3.3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z'/%3E%3C/svg%3E");
  --kb-b: 80px;
  font-family: Inter, system-ui, sans-serif;
}

/* ── Kapalı: yuvarlak robot balonu ───────────────────────────────────────────────────────────────── */
#kp-bot .kp-bot-balon {
  inset-block-end: 24px;
  inset-inline-end: 24px;
  border: 0;
  background: var(--b-gradyan);
  box-shadow: 0 8px 30px rgba(8, 145, 178, 0.4);
  overflow: visible;
}
#kp-bot .kp-bot-balon:hover,
#kp-bot .kp-bot-balon:focus-visible {
  background: var(--b-gradyan);
}
/* paketin simgesi yerine kaynaktaki dolu robot (simgenin kendi kutusunda, nabız halkasının ÜSTÜNDE) */
#kp-bot .kp-bot-balon > svg {
  position: relative;
  z-index: 1;
  inline-size: 40px;
  block-size: 40px;
  color: transparent;
  background: var(--b-robot) center / contain no-repeat;
  transition: scale 0.3s;
}
#kp-bot .kp-bot-balon:hover > svg {
  scale: 1.1;
}
#kp-bot .kp-bot-balon > img {
  display: none;
}
/* nabız halkası (kaynaktaki .unimad-pulse-button::before) */
#kp-bot .kp-bot-balon::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--b-gradyan);
  z-index: -1;
  animation: b-bot-nabiz 2s ease-in-out infinite;
}
/* sağ üstte yeşil «çevrimiçi» noktası */
#kp-bot .kp-bot-balon::after {
  content: "";
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid #fff;
  box-shadow: 0 10px 15px -3px rgba(74, 222, 128, 0.5);
  animation: b-bot-zipla 1.5s ease-in-out infinite;
}
@keyframes b-bot-nabiz {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 0;
  }
}
@keyframes b-bot-zipla {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* «Merhaba!» konuşma kabarcığı (tema işaretlemesi, düzende balonun yanında): mesajlar sırayla belirir */
.b-bot-kabarcik {
  position: fixed;
  inset-block-end: calc(24px + 80px + 12px);
  inset-inline-end: 24px;
  z-index: 2147483000;
  display: block;
  inline-size: 0;
  block-size: 0;
  cursor: pointer;
}
.b-bot-kabarcik > span {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  padding: 12px 20px;
  border-radius: 9999px;
  background: #fff;
  color: #0891b2;
  font: 700 14px/20px Inter, system-ui, sans-serif;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.25));
  opacity: 0;
  /* görünmeyen mesaj tıklanmaz (opaklıkla birlikte görünürlük de değişir) */
  visibility: hidden;
  animation: b-bot-kabarcik 21s linear infinite;
}
.b-bot-kabarcik > span::after {
  content: "";
  position: absolute;
  inset-block-end: -10px;
  inset-inline-end: 36px;
  border-inline: 10px solid transparent;
  border-block-start: 10px solid #fff;
}
/* kaynaktaki zamanlama: ilk mesaj 5,5 sn, sonra her 3,5 sn'de bir sonraki mesaj 2 sn görünür (21 sn'lik döngü) */
.b-bot-kabarcik > span:first-child {
  opacity: 1;
  visibility: visible;
  animation:
    b-bot-ilk 5.8s linear forwards,
    b-bot-kabarcik 21s linear 24.5s infinite;
}
.b-bot-kabarcik > span:nth-child(2) {
  animation-delay: 7s;
}
.b-bot-kabarcik > span:nth-child(3) {
  animation-delay: 10.5s;
}
.b-bot-kabarcik > span:nth-child(4) {
  animation-delay: 14s;
}
.b-bot-kabarcik > span:nth-child(5) {
  animation-delay: 17.5s;
}
.b-bot-kabarcik > span:nth-child(6) {
  animation-delay: 21s;
}
@keyframes b-bot-ilk {
  0%,
  94.8% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}
@keyframes b-bot-kabarcik {
  0%,
  9.5% {
    opacity: 1;
    visibility: visible;
  }
  11%,
  100% {
    opacity: 0;
    visibility: hidden;
  }
}
/* pencere açıkken ya da bot kopukken (yerinde arama düğmeleri) kabarcık yok */
html:has(#kp-bot[data-acik]) .b-bot-kabarcik,
html:has(#kp-bot[data-kopuk]) .b-bot-kabarcik {
  display: none;
}

/* telefon ve tablet: balon 64 px; kabarcık balonun içinde beyaz daire olarak (kaynaktaki lg:hidden görünüm) */
@media (max-width: 1023px) {
  #kp-bot {
    --kb-b: 64px;
  }
  #kp-bot .kp-bot-balon > svg {
    inline-size: 32px;
    block-size: 32px;
  }
  .b-bot-kabarcik {
    inset-block-end: 24px;
    inline-size: 64px;
    block-size: 64px;
    pointer-events: none;
  }
  .b-bot-kabarcik > span {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 64px;
    block-size: 64px;
    padding: 8px;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    overflow: hidden;
    filter: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }
  .b-bot-kabarcik > span::after {
    content: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #kp-bot .kp-bot-balon::before,
  #kp-bot .kp-bot-balon::after,
  .b-bot-kabarcik > span {
    animation: none;
  }
}

/* ── Açık: koyu lacivert pencere. Yüzerken sağ altta (her genişlikte; telefonda da tam ekran değil); ziyaretçi
   «sağa sabitle»ye basınca (kökte data-sabit) yerleşim ürünündür: sağ kenarda boydan boya, sayfa daralır ─────────── */
#kp-bot .kp-bot-panel:not(.kp-bot-yer) {
  background: linear-gradient(to bottom right, #1e293b, #0f172a);
  border: 1px solid #334155;
  font-size: 14px;
}
#kp-bot:not([data-sabit]) .kp-bot-panel:not(.kp-bot-yer) {
  inset: auto 24px 24px auto;
  inline-size: min(380px, calc(100vw - 2rem));
  block-size: min(581px, calc(100dvh - 48px));
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Pencere sağa sabitken (kökte data-kp-bot-sabit; ürün --kp-bot-dock = pencere genişliği, sayfayı o kadar daraltır) sabit
   üst bilgi ve yazı okuma çubuğu pencerenin altına girmez. Kaynağın «right-0» / «w-full» sınıflarından özgül. */
:root header[data-b-ust] {
  right: var(--kp-bot-dock, 0px);
}
:root [data-b-ilerleme] {
  inline-size: calc(100% - var(--kp-bot-dock, 0px));
}

/* Pencere sağa sabitken sayfa daralır ama düzen ekran genişliğine göre seçilir (lg/xl): büyük başlıklar sütuna sığmaz,
   degrade yazının kutu dışına taşan harfleri boyanmaz (kırpılmış görünür). Yalnız sabitken: başlık, bulunduğu kutunun
   genişliğine göre küçülür (sığıyorsa özgün boy kalır, 1em sınırı). Oranlar en uzun sözcüğün genişlik/yazı boyu ölçümünden
   (%5–10 pay). Pencere kapalıyken bu kuralların hiçbiri eşleşmez; görünüm değişmez. */
:root[data-kp-bot-sabit] :is(h1, h2).font-heading:has(> span.block) {
  container-type: inline-size;
}
:root[data-kp-bot-sabit] :is(h1, h2).font-heading > span.block {
  font-size: min(1em, 100cqi / 7.8);
}
/* hizmetler: kare kartlar sütun sayısını kalan genişliğe göre alır (en dar 13rem), başlık kartın iç genişliğine sığar */
:root[data-kp-bot-sabit] .grid:has(> a.group.aspect-square.rounded-2xl) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
:root[data-kp-bot-sabit] a.group.aspect-square > div.absolute:has(> h2) {
  container-type: inline-size;
}
:root[data-kp-bot-sabit] a.group.aspect-square.rounded-2xl h2 {
  font-size: min(2.25rem, 100cqi / 5.5);
}
:root[data-kp-bot-sabit] a.group.aspect-square.rounded-xl h2 {
  font-size: min(2.25rem, 100cqi / 7.7);
}
/* ana sayfa hizmet kartları: simge (3rem) + aralık (0.75rem) yanında büyük harfli başlık */
:root[data-kp-bot-sabit] .group > div.p-8:has(> a > h3) {
  container-type: inline-size;
}
:root[data-kp-bot-sabit] .group > div.p-8 > a > h3 {
  font-size: min(1.25rem, (100cqi - 3.75rem) / 7.4);
}
/* alt bilgi: e-posta adresi dar sütunda bölünebilir (pencerenin altına taşmaz) */
:root[data-kp-bot-sabit] footer a[href^="mailto:"] {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* başlık: turkuaz-yeşil şerit, robot kutusu, ad, «Çevrimiçi» ve yuvarlak kapat düğmesi */
#kp-bot .kp-bot-ust {
  min-block-size: 80px;
  padding: 16px;
  border: 0;
  background: var(--b-gradyan);
  color: #fff;
  overflow: hidden;
}
#kp-bot .kp-bot-ust::before {
  inset: -40px -40px auto auto;
  inline-size: 128px;
  block-size: 128px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
#kp-bot .kp-bot-ust::after {
  inset: auto auto -32px -32px;
  inline-size: 96px;
  block-size: 96px;
  margin: 0;
  border-radius: 50%;
  clip-path: none;
  background: rgba(255, 255, 255, 0.05);
}
#kp-bot .kp-bot-ust h2 {
  position: relative;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: #fff;
}
#kp-bot .kp-bot-ust h2::before {
  inline-size: 48px;
  block-size: 48px;
  border-radius: 12px;
  background: var(--b-robot-bas) center / 28px 28px no-repeat, rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
#kp-bot .kp-bot-ust h2::after {
  padding-inline-start: 12px;
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.8);
  background: radial-gradient(circle at 4px 50%, #4ade80 0 4px, transparent 4.5px) no-repeat;
}
#kp-bot .kp-bot-kapat,
#kp-bot .kp-bot-yapistir {
  position: relative;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transition:
    background-color 0.3s,
    rotate 0.3s;
}
#kp-bot .kp-bot-kapat:hover,
#kp-bot .kp-bot-kapat:focus-visible,
#kp-bot .kp-bot-yapistir:hover,
#kp-bot .kp-bot-yapistir:focus-visible,
#kp-bot .kp-bot-yapistir[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}
#kp-bot .kp-bot-kapat:hover,
#kp-bot .kp-bot-kapat:focus-visible {
  rotate: 90deg;
}
#kp-bot .kp-bot-kapat svg {
  inline-size: 18px;
  block-size: 18px;
  stroke-width: 2.6;
}
#kp-bot .kp-bot-yapistir svg {
  inline-size: 18px;
  block-size: 18px;
  stroke-width: 2.2;
}

/* mesajlar: yarı saydam koyu zemin, robot kutulu bot balonları */
#kp-bot .kp-bot-mesajlar {
  padding: 16px;
  gap: 16px;
  background: rgba(30, 41, 59, 0.5);
}
#kp-bot .kp-bot-m {
  font-size: 14px;
  line-height: 1.625;
}
#kp-bot .kp-bot-bot,
:root #kp-bot .kp-bot-mesajlar[data-bos] > .kp-bot-karsilama {
  position: relative;
  margin: 0 0 0 48px;
  padding: 16px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 4px 16px 16px;
  background: rgba(51, 65, 85, 0.8);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.625;
  letter-spacing: 0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
#kp-bot .kp-bot-bot::before,
:root #kp-bot .kp-bot-mesajlar[data-bos] > .kp-bot-karsilama::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -48px;
  inline-size: 36px;
  block-size: 36px;
  margin: 0;
  padding: 0;
  border-radius: 12px;
  clip-path: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='8' width='16' height='12' rx='3' fill='white'/%3E%3Ccircle cx='9' cy='13' r='1.6' fill='%2314b8a6'/%3E%3Ccircle cx='15' cy='13' r='1.6' fill='%2314b8a6'/%3E%3Cline x1='12' y1='8' x2='12' y2='5' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='4' r='1.5' fill='white'/%3E%3C/svg%3E")
      center / 18px 18px no-repeat,
    linear-gradient(to bottom right, #06b6d4, #14b8a6);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
:root #kp-bot .kp-bot-mesajlar[data-bos] {
  padding-block: 16px;
}
:root #kp-bot .kp-bot-mesajlar[data-bos] > .kp-bot-karsilama {
  margin-block-start: 0;
}
:root #kp-bot .kp-bot-mesajlar[data-bos] > .kp-bot-karsilama::after {
  content: none;
}
:root #kp-bot .kp-bot-mesajlar[data-bos] > :last-child {
  margin-block-end: 0;
}
#kp-bot .kp-bot-bot a {
  color: #22d3ee;
}
#kp-bot .kp-bot-ziyaretci {
  margin-inline-end: 0;
  padding: 12px;
  border-radius: 16px 4px 16px 16px;
  background: linear-gradient(to right, #3b82f6, #9333ea);
  color: #fff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
#kp-bot .kp-bot-ziyaretci::before,
#kp-bot .kp-bot-ziyaretci::after {
  content: none;
}

/* hızlı sorular: 2 sütun, renkli küçük kartlar (kaynaktaki kısa yol düğmeleri) */
#kp-bot .kp-bot-hizli-onay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-block-start: -8px;
}
#kp-bot .kp-bot-hizli-onay button {
  min-block-size: 0;
  padding: 10px 12px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  background: linear-gradient(to right, rgba(8, 145, 178, 0.3), rgba(13, 148, 136, 0.3));
  color: #cffafe;
  font-size: 12px;
  line-height: 16px;
}
#kp-bot .kp-bot-hizli-onay button::after {
  content: none;
}
#kp-bot .kp-bot-hizli-onay button:nth-child(2) {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(to right, rgba(5, 150, 105, 0.3), rgba(22, 163, 74, 0.3));
  color: #d1fae5;
}
#kp-bot .kp-bot-hizli-onay button:nth-child(3) {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(to right, rgba(37, 99, 235, 0.3), rgba(79, 70, 229, 0.3));
  color: #dbeafe;
}
#kp-bot .kp-bot-hizli-onay button:nth-child(4) {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(to right, rgba(217, 119, 6, 0.3), rgba(234, 88, 12, 0.3));
  color: #fef3c7;
}
#kp-bot .kp-bot-hizli-onay button:hover:not(:disabled),
#kp-bot .kp-bot-hizli-onay button:focus-visible {
  filter: brightness(1.25);
}

/* yazı alanı: ayrı kutu + kare gönder düğmesi, üstte ince çizgi */
#kp-bot .kp-bot-girdi {
  align-items: flex-end;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 0;
  border-block-start: 1px solid #334155;
  border-radius: 0;
  background: #1e293b;
}
#kp-bot .kp-bot-girdi textarea {
  min-block-size: 44px;
  padding: 12px 16px;
  border: 1px solid #475569;
  border-radius: 12px;
  background: rgba(51, 65, 85, 0.5);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  transition: border-color 0.15s;
}
#kp-bot .kp-bot-girdi textarea:focus {
  border-color: #06b6d4;
}
#kp-bot .kp-bot-girdi textarea::placeholder {
  color: #94a3b8;
}
#kp-bot .kp-bot-girdi .kp-bot-dugme {
  inline-size: 48px;
  block-size: 48px;
  min-block-size: 48px;
  border-radius: 12px;
  background: var(--b-ucak) center / 20px 20px no-repeat, linear-gradient(to right, #06b6d4, #14b8a6);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
#kp-bot .kp-bot-girdi .kp-bot-dugme::before,
#kp-bot .kp-bot-girdi .kp-bot-dugme::after {
  content: none;
}
#kp-bot .kp-bot-girdi .kp-bot-dugme:hover:not(:disabled) {
  background: var(--b-ucak) center / 20px 20px no-repeat, linear-gradient(to right, #22d3ee, #2dd4bf);
}
#kp-bot .kp-bot-girdi .kp-bot-dugme:disabled {
  opacity: 0.5;
}
