/* Acarnet Chatbot Widget - hafif, bagimsiz, mobil uyumlu */
#acarbot, #acarbot * { box-sizing: border-box; }
#acarbot {
  --ab-navy: #172b43;
  --ab-purple: #6245fe;
  --ab-pink: #ff7cb0;
  --ab-grad: linear-gradient(135deg, #6245fe 0%, #ff7cb0 100%);
  --ab-bg: #ffffff;
  --ab-user: linear-gradient(135deg, #6245fe 0%, #7d5cff 100%);
  --ab-bot: #f3f4f8;
  position: fixed; right: 22px; bottom: 22px; z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Launcher balon */
#acarbot .ab-launcher {
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--ab-grad); color: #fff; box-shadow: 0 10px 28px rgba(98,69,254,.42);
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: transform .25s ease, box-shadow .25s ease;
}
#acarbot .ab-launcher:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 34px rgba(98,69,254,.55); }
#acarbot .ab-launcher svg { width: 30px; height: 30px; fill: #fff; }
#acarbot .ab-launcher .ab-dot {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #ff4d6d; border: 2px solid #fff; animation: ab-pulse 2s infinite;
}
@keyframes ab-pulse { 0%{box-shadow:0 0 0 0 rgba(255,77,109,.5)} 70%{box-shadow:0 0 0 8px rgba(255,77,109,0)} 100%{box-shadow:0 0 0 0 rgba(255,77,109,0)} }

/* Pencere */
#acarbot .ab-window {
  position: absolute; right: 0; bottom: 78px; width: 372px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 110px); background: var(--ab-bg);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(20,30,60,.28); overflow: hidden;
  display: none; flex-direction: column; transform-origin: bottom right;
  animation: ab-in .28s cubic-bezier(.2,.8,.25,1);
}
#acarbot.ab-open .ab-window { display: flex; }
#acarbot.ab-open .ab-launcher { transform: scale(.9); opacity: .9; }
@keyframes ab-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* Baslik */
#acarbot .ab-head { background: var(--ab-navy); color: #fff; padding: 15px 16px; display: flex; align-items: center; gap: 11px; }
#acarbot .ab-head .ab-ava {
  width: 40px; height: 40px; border-radius: 50%; background: var(--ab-grad);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
#acarbot .ab-head .ab-ava svg { width: 22px; height: 22px; fill: #fff; }
#acarbot .ab-head .ab-meta { line-height: 1.25; flex: 1; min-width: 0; }
#acarbot .ab-head .ab-name { font-weight: 700; font-size: 15px; }
#acarbot .ab-head .ab-stat { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
#acarbot .ab-head .ab-stat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; }
#acarbot .ab-head .ab-close { background: transparent; border: none; color: #fff; cursor: pointer; font-size: 22px; line-height: 1; opacity: .8; padding: 4px; }
#acarbot .ab-head .ab-close:hover { opacity: 1; }

/* Mesaj alani */
#acarbot .ab-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px 14px 6px; background: #fafbfd; }
#acarbot .ab-msg { display: flex; margin-bottom: 12px; }
#acarbot .ab-msg .ab-bub {
  max-width: 80%; padding: 10px 13px; font-size: 14px; line-height: 1.5; border-radius: 16px; word-wrap: break-word; white-space: normal;
}
#acarbot .ab-msg.bot .ab-bub { background: var(--ab-bot); color: #1f2937; border-bottom-left-radius: 5px; }
#acarbot .ab-msg.user { justify-content: flex-end; }
#acarbot .ab-msg.user .ab-bub { background: var(--ab-user); color: #fff; border-bottom-right-radius: 5px; }
#acarbot .ab-msg .ab-bub a { color: inherit; text-decoration: underline; }

/* Yaziyor animasyonu */
#acarbot .ab-typing { display: flex; gap: 4px; padding: 12px 14px; }
#acarbot .ab-typing span { width: 8px; height: 8px; border-radius: 50%; background: #b9c0cf; animation: ab-bounce 1.2s infinite; }
#acarbot .ab-typing span:nth-child(2){ animation-delay: .15s; } #acarbot .ab-typing span:nth-child(3){ animation-delay: .3s; }
@keyframes ab-bounce { 0%,60%,100%{ transform: translateY(0); opacity:.5 } 30%{ transform: translateY(-6px); opacity:1 } }

/* Hizli yanitlar */
#acarbot .ab-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 14px 10px; }
#acarbot .ab-quick button {
  background: #fff; border: 1.5px solid #e3e6f0; color: var(--ab-purple); border-radius: 18px;
  padding: 7px 13px; font-size: 13px; cursor: pointer; transition: all .18s; font-weight: 600;
}
#acarbot .ab-quick button:hover { background: var(--ab-purple); color: #fff; border-color: var(--ab-purple); }

/* KVKK notu */
#acarbot .ab-kvkk { font-size: 11px; color: #8a93a6; padding: 0 16px 8px; line-height: 1.45; }

/* Inline iletisim formu */
#acarbot .ab-form { position: relative; padding: 10px 14px 12px; border-top: 1px solid #eef0f5; background: #fff; display: none; }
#acarbot .ab-form.show { display: block; }
#acarbot .ab-form h4 { margin: 0 0 4px; font-size: 13px; color: var(--ab-navy); padding-right: 26px; }
#acarbot .ab-form .ab-form-close {
  position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; padding: 0;
  background: transparent; border: none; color: #9aa1b0; font-size: 24px; line-height: 1; cursor: pointer;
  border-radius: 50%; transition: background .15s, color .15s;
}
#acarbot .ab-form .ab-form-close:hover { background: #f1f2f6; color: #1f2937; }
#acarbot .ab-form .ab-form-hint { font-size: 11.5px; color: #8a93a6; margin: 0 0 8px; line-height: 1.4; }
#acarbot .ab-form .ab-form-err { font-size: 12.5px; color: #e23744; background: #fdecee; border: 1px solid #f7c6cc; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; }
#acarbot .ab-form input { width: 100%; border: 1.5px solid #e3e6f0; border-radius: 10px; padding: 9px 11px; font-size: 13px; margin-bottom: 7px; outline: none; }
#acarbot .ab-form input:focus { border-color: var(--ab-purple); }
#acarbot .ab-form .ab-frow { display: flex; gap: 7px; }
#acarbot .ab-form button { width: 100%; background: var(--ab-grad); color: #fff; border: none; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
#acarbot .ab-form .ab-skip { background: none; color: #8a93a6; font-weight: 500; padding: 6px; margin-top: 2px; }

/* Kalici Teklif Al CTA cubugu */
#acarbot .ab-actions { padding: 9px 12px 2px; background: #fff; }
#acarbot .ab-actions .ab-cta {
  width: 100%; border: none; border-radius: 12px; padding: 10px 12px; cursor: pointer;
  background: linear-gradient(135deg, #6245fe 0%, #ff7cb0 100%); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 5px 14px rgba(98,69,254,.30); transition: filter .18s, transform .18s;
}
#acarbot .ab-actions .ab-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
#acarbot .ab-actions .ab-cta svg { width: 17px; height: 17px; fill: #fff; }

/* Giris alani */
#acarbot .ab-foot { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #eef0f5; background: #fff; }
#acarbot .ab-foot textarea {
  flex: 1; resize: none; border: 1.5px solid #e3e6f0; border-radius: 22px; padding: 10px 14px;
  font-size: 14px; line-height: 1.4; max-height: 96px; outline: none; font-family: inherit;
}
#acarbot .ab-foot textarea:focus { border-color: var(--ab-purple); }
#acarbot .ab-foot .ab-send {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; border: none; cursor: pointer;
  background: var(--ab-grad); display: flex; align-items: center; justify-content: center;
}
#acarbot .ab-foot .ab-send svg { width: 19px; height: 19px; fill: #fff; }
#acarbot .ab-foot .ab-send:disabled { opacity: .5; cursor: default; }
#acarbot .ab-powered { text-align: center; font-size: 10.5px; color: #aab1c2; padding: 0 0 7px; background:#fff; }
#acarbot .ab-powered a { color: var(--ab-purple); text-decoration: none; }

/* Mobil */
@media (max-width: 600px) {
  #acarbot { right: 14px; bottom: 14px; }
  /* Tam ekran: viewport'a sabitle. NOT: top+bottom birlikte verilirse height yok sayilir;
     bu yuzden bottom verilmez, height:100dvh (iOS 100vh tasma hatasini cozer) kullanilir.
     JS (visualViewport) klavye acilinca yuksekligi ayrica ayarlar. */
  #acarbot .ab-window {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    height: 100vh; height: 100dvh; max-height: none;
    border-radius: 0;
  }
  /* Acikken launcher balonunu gizle (tam ekran pencerenin uzerine binmesin) */
  #acarbot.ab-open .ab-launcher { display: none; }
  #acarbot .ab-launcher { width: 56px; height: 56px; }
  /* Baslik guvenli alanda kalsin; kapatma tusu rahat tiklanir olsun */
  #acarbot .ab-head { padding-top: calc(15px + env(safe-area-inset-top, 0px)); }
  #acarbot .ab-head .ab-close { font-size: 30px; padding: 4px 8px; opacity: 1; }
  #acarbot .ab-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* iOS: input'a odaklaninca otomatik zoom'u engelle (>=16px sart) */
  #acarbot .ab-foot textarea,
  #acarbot .ab-form input { font-size: 16px; }
}
