/**
 * DinamikPOS — global satış asistanı widget (premium, minimal)
 * Beyaz / siyah / yumuşak gri; gölgeler yumuşak, köşeler yuvarlak.
 */
#sales-chat-widget,
#sales-chat-widget * {
  box-sizing: border-box;
}

#sales-chat-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #0a0a0a;
  -webkit-font-smoothing: antialiased;
}

#sales-chat-widget .panel {
  width: min(392px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 110px));
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#sales-chat-widget .panel[hidden] {
  display: none !important;
}

/* class "header" kullanılmaz: nav.css .header site üst çubuğu ile çakışır */
#sales-chat-widget .sales-chat-widget-head {
  padding: 16px 18px;
  background: #fafafa;
  border-bottom: 1px solid #ebebeb;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: #0a0a0a;
}

#sales-chat-widget .sales-chat-widget-head span.sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: #737373;
  letter-spacing: 0;
}

#sales-chat-widget .btn-icon {
  background: #f0f0f0;
  border: none;
  color: #404040;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

#sales-chat-widget .btn-icon:hover {
  background: #e5e5e5;
  color: #0a0a0a;
}

#sales-chat-widget .messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#sales-chat-widget .msg {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 18px;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 14px;
}

#sales-chat-widget .msg.user {
  align-self: flex-end;
  background: #0a0a0a;
  color: #fff;
  border-bottom-right-radius: 6px;
}

#sales-chat-widget .msg.ai {
  align-self: flex-start;
  background: #fff;
  color: #0a0a0a;
  border: 1px solid #e8e8e8;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#sales-chat-widget .msg.error {
  align-self: stretch;
  max-width: 100%;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 13px;
}

#sales-chat-widget .loading-row {
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8e8e8;
  color: #737373;
  font-size: 13px;
}

#sales-chat-widget .loading-row.active {
  display: flex;
}

#sales-chat-widget .dots {
  display: flex;
  gap: 4px;
}

#sales-chat-widget .dots span {
  width: 6px;
  height: 6px;
  background: #404040;
  border-radius: 50%;
  animation: dinamik-chat-dots 1.2s infinite ease-in-out;
}

#sales-chat-widget .dots span:nth-child(2) {
  animation-delay: 0.15s;
}
#sales-chat-widget .dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dinamik-chat-dots {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

#sales-chat-widget .lead-gate {
  padding: 10px 12px;
  border-top: 1px solid #ebebeb;
  background: #fafafa;
  flex-shrink: 0;
}
#sales-chat-widget .lead-gate[hidden] {
  display: none !important;
}
#sales-chat-widget .lead-gate-hint {
  margin: 0 0 8px 0;
  font-size: 12px;
  line-height: 1.45;
  color: #737373;
}
#sales-chat-widget .btn-lead-gate {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  color: #0a0a0a;
  border: 1px solid #d4d4d4;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
#sales-chat-widget .btn-lead-gate:hover:not(:disabled) {
  background: #f5f5f5;
}
#sales-chat-widget .btn-lead-gate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#sales-chat-widget .lead-strip {
  padding: 10px 12px;
  border-top: 1px solid #ebebeb;
  background: #fff;
  flex-shrink: 0;
}
#sales-chat-widget .lead-strip[hidden] {
  display: none !important;
}
#sales-chat-widget .lead-strip-title {
  font-size: 12px;
  font-weight: 600;
  color: #737373;
  margin-bottom: 8px;
}
#sales-chat-widget .lead-strip .lead-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#sales-chat-widget .lead-strip input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
}
#sales-chat-widget .lead-strip input:focus {
  outline: none;
  border-color: #a3a3a3;
}
#sales-chat-widget .btn-lead {
  margin-top: 4px;
  width: 100%;
  padding: 10px 12px;
  background: #0a0a0a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
#sales-chat-widget .btn-lead:hover:not(:disabled) {
  background: #262626;
}
#sales-chat-widget .btn-lead:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#sales-chat-widget .composer {
  padding: 12px 14px;
  border-top: 1px solid #ebebeb;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
#sales-chat-widget .composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 11px 13px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  font: inherit;
  outline: none;
  background: #fafafa;
}
#sales-chat-widget .composer textarea:focus {
  border-color: #a3a3a3;
  background: #fff;
}
#sales-chat-widget .composer textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
#sales-chat-widget .btn-send {
  min-height: 44px;
  padding: 0 18px;
  background: #0a0a0a;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}
#sales-chat-widget .btn-send:hover:not(:disabled) {
  background: #262626;
}
#sales-chat-widget .btn-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Launcher — kompakt, dikkat çekici, yumuşak gölge */
#sales-chat-widget .launcher {
  min-width: 132px;
  height: 52px;
  padding: 0 18px;
  border-radius: 26px;
  background: #0a0a0a;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
#sales-chat-widget .launcher .launcher-ico {
  font-size: 18px;
  line-height: 1;
  opacity: 0.95;
}
#sales-chat-widget .launcher:hover {
  background: #171717;
}
#sales-chat-widget .launcher[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  #sales-chat-widget {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  #sales-chat-widget .panel {
    width: 100%;
    height: min(86vh, 580px);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* pos-website: floating WhatsApp (bottom-right) — chat launcher stays bottom-right, WA moves left */
body.has-sales-chat-widget .global-whatsapp-cta {
  right: auto;
  left: 18px;
}
@media (max-width: 768px) {
  body.has-sales-chat-widget .global-whatsapp-cta {
    left: 12px;
    right: 12px;
  }
  body.has-sales-chat-widget #sales-chat-widget {
    bottom: 88px;
  }
}
