.site-chat-toggle {
  position: fixed;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
  background: linear-gradient(135deg, #111827, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.site-chat-toggle:hover { transform: translateY(-2px); box-shadow: 0 18px 46px rgba(0,0,0,.22); }
.site-chat-toggle-right { right: 20px; }
.site-chat-toggle-left { left: 20px; }
.site-chat-toggle-icon { font-size: 24px; line-height: 1; }

.site-chat-widget {
  position: fixed;
  bottom: 92px;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 560px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0,0,0,.22);
  display: none;
  flex-direction: column;
  z-index: 9999;
  border: 1px solid rgba(17,24,39,.08);
}
.site-chat-widget-right { right: 20px; }
.site-chat-widget-left { left: 20px; }
.site-chat-widget.is-open { display: flex; }

.site-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #111827;
  color: #fff;
}
.site-chat-title-wrap { display: flex; align-items: center; gap: 10px; }
.site-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.site-chat-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.site-chat-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.site-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
}
.site-chat-message {
  display: flex;
  margin-bottom: 12px;
}
.site-chat-message-user { justify-content: flex-end; }
.site-chat-message-bot { justify-content: flex-start; }
.site-chat-bubble {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 15px;
  line-height: 1.45;
  font-size: 14px;
  word-wrap: break-word;
}
.site-chat-message-user .site-chat-bubble {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 6px;
}
.site-chat-message-bot .site-chat-bubble {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
}
.site-chat-message.is-typing .site-chat-bubble { opacity: .75; font-style: italic; }

.site-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.site-chat-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  outline: none;
  font-size: 14px;
}
.site-chat-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.site-chat-send {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  background: #111827;
  color: #fff;
  white-space: nowrap;
  font-weight: 600;
}
.site-chat-form.is-loading .site-chat-send,
.site-chat-form.is-loading .site-chat-input { opacity: .7; pointer-events: none; }

@media (max-width: 576px) {
  .site-chat-widget {
    right: 12px !important;
    left: 12px !important;
    bottom: 86px;
    width: auto;
    height: 70vh;
    max-height: 620px;
  }
  .site-chat-toggle-right,
  .site-chat-toggle-left {
    right: 16px;
    left: auto;
  }
}
.site-chat-message.is-typing .site-chat-bubble {
  min-width: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-chat-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.site-chat-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  display: inline-block;
  animation: siteChatTyping 1.2s infinite ease-in-out;
}

.site-chat-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.site-chat-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes siteChatTyping {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.site-chat-message.is-typing .site-chat-bubble {
  min-width: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-chat-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.site-chat-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  display: inline-block;
  animation: siteChatTyping 1.2s infinite ease-in-out;
}

.site-chat-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.site-chat-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes siteChatTyping {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.site-chat-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 86%;
}

.site-chat-product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.site-chat-product-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.site-chat-product-price {
  font-size: 14px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 8px;
}

.site-chat-product-link {
  display: inline-block;
  font-size: 13px;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid rgba(17,24,39,.25);
}

.site-chat-product-link:hover {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.site-chat-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 86%;
}

.site-chat-product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.site-chat-product-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.site-chat-product-price {
  font-size: 14px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 8px;
}

.site-chat-product-link {
  display: inline-block;
  font-size: 13px;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid rgba(17,24,39,.25);
}

.site-chat-product-link:hover {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.site-chat-message.is-typing .site-chat-bubble {
  min-width: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-chat-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.site-chat-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  display: inline-block;
  animation: siteChatTyping 1.2s infinite ease-in-out;
}

.site-chat-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.site-chat-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes siteChatTyping {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.site-chat-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 86%;
}

.site-chat-product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.site-chat-product-image-wrap {
  margin-bottom: 10px;
}

.site-chat-product-image {
  display: block;
  width: 100%;
  max-width: 110px;
  height: auto;
  border-radius: 10px;
}

.site-chat-product-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.site-chat-product-price {
  font-size: 14px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 6px;
}

.site-chat-product-stock {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.site-chat-product-desc {
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
  margin-bottom: 8px;
}

.site-chat-product-link {
  display: inline-block;
  font-size: 13px;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid rgba(17,24,39,.25);
}

.site-chat-product-link:hover {
  color: #2563eb;
  border-bottom-color: #2563eb;
}