/*
 * XmartPro.ai - Website Chat Widget
 * Lightweight, framework-agnostic.
 */

#cmsChatbotRoot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100100;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.cms-chatbot-toggle {
  border: 0;
  outline: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
  background: #1f2d3d;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cms-chatbot-toggle i {
  font-size: 18px;
}

.cms-chatbot-panel {
  width: 360px;
  max-width: calc(100vw - 36px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.22);
  margin-bottom: 12px;
  display: none;
}

.cms-chatbot-panel.is-open {
  display: flex;
  flex-direction: column;
}


/* Brand row inside header */
.cms-chatbot-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.cms-chatbot-logo{
  width:34px;
  height:34px;
  border-radius:8px;
  object-fit:cover;
  flex:0 0 auto;
  background:#0b1220;
}
.cms-chatbot-brand-text{
  min-width:0;
}

.cms-chatbot-header {
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cms-chatbot-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.cms-chatbot-subtitle {
  opacity: 0.85;
  font-size: 12px;
}

.cms-chatbot-close {
  border: 0;
  outline: none;
  cursor: pointer;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 0 6px;
}

.cms-chatbot-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f8fafc;
}

.cms-msg {
  display: flex;
  margin: 10px 0;
}

.cms-msg.user {
  justify-content: flex-end;
}

.cms-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.cms-msg.user .cms-bubble {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.cms-msg.assistant .cms-bubble {
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom-left-radius: 6px;
}

.cms-chatbot-input {
  padding: 10px;
  background: #fff;
  border-top: 1px solid rgba(15,23,42,0.08);
  display: flex;
  gap: 8px;
}

.cms-chatbot-textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(15,23,42,0.18);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  outline: none;
  height: 42px;
  max-height: 120px;
}

.cms-chatbot-send {
  border: 0;
  outline: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 0 14px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
}

.cms-chatbot-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cms-chatbot-footnote {
  padding: 8px 12px;
  font-size: 11px;
  color: rgba(15,23,42,0.75);
  background: #fff;
  border-top: 1px solid rgba(15,23,42,0.06);
}

@media (max-width: 520px) {
  #cmsChatbotRoot {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
  .cms-chatbot-panel {
    width: 100%;
  }
  .cms-chatbot-toggle {
    width: 100%;
    justify-content: center;
  }
}
