/* Canlı destek widget v10 */
.cs-root {
  --cs-a: #e11d48;
  --cs-a2: #be123c;
  --cs-ink: #0f172a;
  --cs-muted: #64748b;
  --cs-line: #e2e8f0;
  --cs-bg: #fff1f2;
  --cs-safe-b: env(safe-area-inset-bottom, 0px);
  --cs-safe-t: env(safe-area-inset-top, 0px);
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  right: auto;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 1005;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  pointer-events: none;
}
.cs-root.is-open {
  z-index: 2147483000;
  inset: 0;
  right: 0; left: 0; top: 0; bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  pointer-events: auto;
}
.cs-root * { box-sizing: border-box; }
.cs-root button, .cs-root input, .cs-root textarea, .cs-root .cs-panel, .cs-root .cs-fab-wrap, .cs-root label {
  pointer-events: auto;
}
body.cs-chat-acik { overflow: hidden !important; }

.cs-fab-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 0;
  right: auto;
  bottom: 0;
  animation: cs-fab-in .45s cubic-bezier(.2, .9, .3, 1) both;
}
.cs-fab-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: var(--cs-a2);
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, .4);
  white-space: nowrap;
  line-height: 1.2;
}
.cs-fab {
  position: relative;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, #f43f5e, #e11d48);
  box-shadow: 0 8px 22px rgba(225, 29, 72, .5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}
.cs-fab::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(225, 29, 72, .45);
  animation: cs-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
.cs-fab:hover { transform: scale(1.06); }
.cs-fab:active { transform: scale(.95); }
.cs-fab svg { width: 26px; height: 26px; position: relative; z-index: 1; }
.cs-fab__x { display: none; font-size: 26px; font-weight: 300; line-height: 1; z-index: 1; position: relative; }
.cs-root.is-open .cs-fab-wrap { display: none; }

.cs-fab__badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px;
  background: #0f172a; color: #fff;
  font-size: 11px; font-weight: 800;
  display: none; align-items: center; justify-content: center;
  border: 2px solid #fff; z-index: 2;
}
.cs-fab.has-badge .cs-fab__badge { display: inline-flex; }

@keyframes cs-pulse {
  0% { transform: scale(.92); opacity: .65; }
  70%, 100% { transform: scale(1.28); opacity: 0; }
}
@keyframes cs-fab-in {
  from { opacity: 0; transform: translateY(14px) scale(.85); }
  to { opacity: 1; transform: none; }
}
@keyframes cs-sheet {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes cs-slide-up {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.cs-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.45); z-index: 1;
  opacity: 0; transition: opacity .25s;
}
.cs-root.is-open .cs-backdrop {
  display: block; opacity: 1;
}

.cs-panel {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 92px;
  width: min(400px, calc(100vw - 20px));
  height: min(640px, calc(100dvh - 110px));
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .06);
  z-index: 2;
}
.cs-panel.open {
  display: flex;
  animation: cs-slide-up .32s cubic-bezier(.2, .9, .3, 1) both;
}

.cs-head {
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, #9f1239 0%, #e11d48 55%, #fb7185 130%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cs-head__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(255,255,255,.85);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.cs-head__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cs-head__avatar--logo {
  background: #fff;
  padding: 6px;
}
.cs-head__avatar--logo .cs-head__logo,
.cs-head__avatar--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.cs-head__online {
  position: absolute; right: 1px; bottom: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #4ade80; border: 2px solid #fff;
}
.cs-head__meta { min-width: 0; flex: 1; }
.cs-head h3 {
  margin: 0; font-size: 13px; font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cs-head p {
  margin: 3px 0 0; font-size: 11px; opacity: .92;
  display: flex; align-items: center; gap: 6px;
}
.cs-head__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #bbf7d0;
}
.cs-head__btn {
  border: 0; background: rgba(255,255,255,.18); color: #fff;
  width: 36px; height: 36px; border-radius: 12px; cursor: pointer;
  font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.cs-hizli {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px 0; background: var(--cs-bg); flex-shrink: 0;
  max-height: 88px; overflow: auto;
}
.cs-hizli button {
  border: 1px solid #fecdd3; background: #fff; color: #be123c;
  border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.cs-chip-link { border:1px solid #fecdd3; background:#fff; color:#be123c; border-radius:999px; padding:6px 10px; font-size:11px; font-weight:700; text-decoration:none; }
.cs-rating { align-self:center; text-align:center; background:#fff; border:1px solid #fecdd3; border-radius:12px; padding:10px; color:#881337; font-size:12px; }
.cs-rating b { display:block; margin-bottom:5px; }
.cs-rating button { border:0; background:transparent; color:#f59e0b; font-size:24px; cursor:pointer; padding:1px 3px; }

.cs-msgs {
  flex: 1; overflow: auto; padding: 14px;
  background: var(--cs-bg);
  display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.cs-msg-wrap { display: flex; flex-direction: column; gap: 3px; max-width: 88%; }
.cs-msg-wrap--in { align-self: flex-start; }
.cs-msg-wrap--out { align-self: flex-end; align-items: flex-end; }
.cs-msg-ad {
  font-size: 10px; font-weight: 800; color: #be123c;
  padding: 0 4px;
}
.cs-msg {
  padding: 11px 13px; border-radius: 16px;
  font-size: 14px; line-height: 1.45; word-break: break-word;
}
.cs-msg--bot, .cs-msg--admin {
  background: #fff; color: var(--cs-ink);
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.cs-msg--ziyaretci {
  background: linear-gradient(145deg, #f43f5e, #e11d48);
  color: #fff; border-bottom-right-radius: 5px;
}
.cs-msg__time {
  display: block; margin-top: 5px; font-size: 10px; opacity: .55; font-weight: 600;
}
.cs-msg__file {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(15,23,42,.06); color: inherit; text-decoration: none;
  font-size: 12px; font-weight: 700; word-break: break-all;
}
.cs-msg--ziyaretci .cs-msg__file { background: rgba(255,255,255,.2); color: #fff; }
.cs-msg__file img { max-width: 180px; border-radius: 8px; display: block; }

.cs-form {
  border-top: 1px solid var(--cs-line);
  padding: 10px 12px;
  padding-bottom: calc(10px + var(--cs-safe-b));
  background: #fff; display: grid; gap: 8px; flex-shrink: 0;
}
.cs-form__kimlik { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs-form__kimlik.is-hidden { display: none; }
.cs-form input[type="text"], .cs-form input[type="email"], .cs-form textarea {
  width: 100%; border: 1px solid var(--cs-line); border-radius: 12px;
  padding: 11px 12px; font: inherit; font-size: 16px;
  color: var(--cs-ink); background: #f8fafc; outline: none;
}
.cs-form textarea { resize: none; min-height: 46px; max-height: 110px; }
.cs-form__row { display: flex; gap: 8px; align-items: flex-end; }
.cs-form__row textarea { flex: 1; }
.cs-attach {
  width: 42px; height: 46px; border: 1px solid var(--cs-line); border-radius: 12px;
  background: #f8fafc; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: #be123c; font-size: 18px; font-weight: 800;
}
.cs-attach input { display: none; }
.cs-send {
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--cs-a); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(225,29,72,.35); flex-shrink: 0;
}
.cs-send svg { width: 20px; height: 20px; }
.cs-send:disabled { opacity: .4; }
.cs-hint { font-size: 11px; color: var(--cs-muted); margin: 0; text-align: center; }
.cs-file-name { font-size: 11px; color: #be123c; font-weight: 700; margin: 0; }
.cs-typing {
  font-size: 12px; color: var(--cs-muted); padding: 0 14px 6px; font-style: italic;
  display: flex; align-items: center; gap: 6px;
}
.cs-typing[hidden] { display: none !important; }
.cs-typing__dots {
  display: inline-block; width: 28px; height: 10px;
  background: radial-gradient(circle, currentColor 1.6px, transparent 1.8px) 0 50% / 8px 100% repeat-x;
  animation: cs-typing-dots .9s linear infinite;
  opacity: .7;
}
@keyframes cs-typing-dots {
  to { background-position: 24px 50%; }
}
.cs-voice {
  width: 42px; height: 46px; border: 1px solid var(--cs-line); border-radius: 12px;
  background: #f8fafc; cursor: pointer; flex-shrink: 0; font-size: 16px;
}
.cs-voice.is-rec { background: #fee2e2; border-color: #f87171; animation: cs-pulse 1s infinite; }
@keyframes cs-pulse { 50% { opacity: .65; } }
.cs-msg__audio { display: block; max-width: 220px; margin-top: 6px; }
.cs-kart {
  margin: 4px 10px 8px; padding: 10px 12px; border-radius: 12px;
  background: #fff; border: 1px solid #e2e8f0; font-size: 13px; max-width: 92%;
}
.cs-kart b { display: block; margin-bottom: 4px; color: #9f1239; }
.cs-kart a { color: #be123c; font-weight: 700; margin-right: 8px; }
.cs-kart--siparis { border-left: 3px solid #e11d48; }
.cs-kart--urun { border-left: 3px solid #0d9488; }

/* Mobil: kırmızı FAB (alt nav üstünde, görünür) + tam ekran panel */
@media (max-width: 768px) {
  .cs-root:not(.is-open) {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto;
    bottom: calc(70px + max(8px, env(safe-area-inset-bottom, 0px)));
    top: auto;
    width: auto;
    height: auto;
    z-index: 1005;
  }
  .cs-fab-wrap {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    align-items: flex-start;
  }
  .cs-fab {
    width: 54px;
    height: 54px;
    background: linear-gradient(145deg, #f43f5e, #be123c);
    box-shadow: 0 8px 24px rgba(190, 18, 60, .55);
  }
  .cs-fab-label {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    background: #9f1239;
  }
  .cs-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    right: 0; bottom: 0; left: 0; top: 0;
    z-index: 3;
  }
  .cs-panel.open { animation: cs-sheet .34s cubic-bezier(.2, .9, .25, 1) both; }
  .cs-head { padding-top: calc(14px + var(--cs-safe-t)); }
  .cs-form__kimlik { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  .cs-fab-label {
    display: inline-block;
    font-size: 12px;
    padding: 5px 12px;
  }
  .cs-root.is-open {
    inset: auto;
    left: max(16px, env(safe-area-inset-left, 0px));
    right: auto;
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    width: auto; height: auto;
    pointer-events: none;
  }
  .cs-root.is-open .cs-fab-wrap { display: flex; pointer-events: auto; }
  .cs-root.is-open .cs-backdrop { display: none; }
}
