/*--------------------------------------------------------------
# Sales Chatbot
--------------------------------------------------------------*/
.chatbot {
  --chatbot-accent: var(--color-primary, #feb900);
  --chatbot-dark: var(--color-secondary, #52565e);
  --chatbot-text: var(--color-default, #364d59);
  --chatbot-bg: #fff;
  --chatbot-muted: #f1f3f5;
  --chatbot-user: #fff6d9;
  position: fixed;
  left: 15px;
  bottom: 15px;
  z-index: 99998;
  font-family: var(--font-default);
}

.chatbot-toggle {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--chatbot-accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, background 0.2s;
}

.chatbot-toggle:hover,
.chatbot-toggle:focus-visible {
  transform: scale(1.06);
  background: #e5a700;
}

.chatbot.is-open .chatbot-toggle {
  display: none;
}

.chatbot-panel {
  display: flex;
  flex-direction: column;
  width: min(370px, calc(100vw - 30px));
  height: min(560px, calc(100vh - 30px));
  background: var(--chatbot-bg);
  color: var(--chatbot-text);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.chatbot-panel[hidden] {
  display: none;
}

.chatbot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--chatbot-dark);
  color: #fff;
}

.chatbot-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--chatbot-accent);
  font-size: 18px;
}

.chatbot-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.chatbot-heading strong {
  font-size: 15px;
}

.chatbot-heading span {
  font-size: 12px;
  opacity: 0.8;
}

.chatbot-end,
.chatbot-close {
  border: 0;
  background: transparent;
  color: #fff;
  opacity: 0.85;
}

.chatbot-end {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  white-space: nowrap;
}

.chatbot-end:hover,
.chatbot-close:hover {
  opacity: 1;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
}

.chatbot-message {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.chatbot-message a {
  color: inherit;
  text-decoration: underline;
}

.chatbot-assistant {
  align-self: flex-start;
  background: var(--chatbot-muted);
  border-start-start-radius: 4px;
}

.chatbot-user {
  align-self: flex-end;
  background: var(--chatbot-user);
  border-start-end-radius: 4px;
}

.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa0a6;
  animation: chatbot-dot 1.2s infinite ease-in-out;
}

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

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

@keyframes chatbot-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 0;
  background: #fafafa;
}

.chatbot-suggestions[hidden] {
  display: none;
}

.chatbot-suggestions button {
  border: 1px solid var(--chatbot-accent);
  background: #fff;
  color: var(--chatbot-text);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
}

.chatbot-suggestions button:hover {
  background: var(--chatbot-user);
}

.chatbot-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #e9ecef;
  background: #fff;
}

.chatbot-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: hidden;
  outline: none;
}

.chatbot-form textarea:focus {
  border-color: var(--chatbot-accent);
}

.chatbot-form button {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--chatbot-accent);
  color: #fff;
}

.chatbot-form button:disabled,
.chatbot-form textarea:disabled {
  opacity: 0.6;
}

[dir="rtl"] .chatbot-form button i {
  display: inline-block;
  transform: scaleX(-1);
}

.chatbot-notice {
  margin: 0;
  padding: 0 14px 8px;
  font-size: 11px;
  color: #6c757d;
  background: #fff;
}

@media (max-width: 575px) {
  .chatbot.is-open {
    left: 0;
    bottom: 0;
  }

  .chatbot.is-open .chatbot-panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
}
