/* ── AutosOnSale Chatbot Widget ─────────────────────────────────────────── */

#aos-chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #1a1a2e;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.30);
  z-index: 9999;
  transition: background 0.2s, transform 0.2s;
}
#aos-chat-fab:hover { background: #e94560; transform: scale(1.07); }
#aos-chat-fab .aos-fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e94560;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ── Chat window ─────────────────────────────────────────────────────────── */
#aos-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: 540px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.20);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(.35,.9,.4,1), opacity 0.22s;
}
#aos-chat-window.aos-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#aos-chat-header {
  background: #1a1a2e;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}
#aos-chat-header .aos-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #e94560;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
#aos-chat-header .aos-title { font-weight: 700; font-size: 14px; line-height: 1.2; }
#aos-chat-header .aos-subtitle { font-size: 11px; color: rgba(255,255,255,0.7); }
#aos-chat-close {
  margin-left: auto;
  background: none; border: none; color: rgba(255,255,255,0.8);
  cursor: pointer; font-size: 22px; line-height: 1; padding: 0;
}
#aos-chat-close:hover { color: #fff; }

/* Messages area */
#aos-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#aos-chat-messages::-webkit-scrollbar { width: 4px; }
#aos-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Bubbles */
.aos-msg {
  max-width: 84%;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 13px;
  border-radius: 16px;
  word-break: break-word;
}
.aos-msg.bot {
  background: #f3f4f6;
  color: #1a1a2e;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.aos-msg.user {
  background: #1a1a2e;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.aos-msg a { color: #e94560; font-weight: 600; text-decoration: underline; }
.aos-msg a:hover { color: #1a1a2e; }
.aos-msg strong { font-weight: 700; }

/* Typing indicator */
.aos-typing {
  display: flex; gap: 4px; align-items: center;
  padding: 10px 14px;
  background: #f3f4f6;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}
.aos-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  animation: aos-bounce 1.1s infinite ease-in-out;
}
.aos-typing span:nth-child(2) { animation-delay: 0.18s; }
.aos-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes aos-bounce {
  0%,80%,100% { transform: translateY(0); }
  40%         { transform: translateY(-6px); }
}

/* Quick-reply chips */
.aos-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 14px 8px;
  flex-shrink: 0;
}
.aos-chip {
  background: #f3f4f6;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1a1a2e;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.aos-chip:hover { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

/* Input bar */
#aos-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
#aos-chat-input {
  flex: 1;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  resize: none;
  max-height: 80px;
  font-family: inherit;
  transition: border-color 0.15s;
}
#aos-chat-input:focus { border-color: #1a1a2e; }
#aos-chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #1a1a2e;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  transition: background 0.15s;
}
#aos-chat-send:hover { background: #e94560; }
#aos-chat-send:disabled { background: #ccc; cursor: default; }

/* Mobile responsive */
@media (max-width: 480px) {
  #aos-chat-window { width: calc(100vw - 24px); right: 12px; bottom: 88px; }
  #aos-chat-fab    { right: 16px; bottom: 20px; }
}
