/* Authentique Autos Chatbot Widget */
#aa-chatbot-root {
  --aa-dark:   #0f172a;
  --aa-panel:  #1e293b;
  --aa-gold:   #c9a227;
  --aa-text:   #f1f5f9;
  --aa-muted:  rgba(241,245,249,.5);
  --aa-border: rgba(255,255,255,.1);
  --aa-input:  rgba(255,255,255,.08);
  --aa-radius: 16px;
}

#aa-chat-btn {
  position: fixed;
  bottom: 88px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--aa-gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  transition: transform .2s, opacity .2s;
}
#aa-chat-btn:hover { transform: scale(1.08); }
#aa-chat-btn.aa-right { right: 24px; }
#aa-chat-btn.aa-left  { left:  24px; }
#aa-chat-btn svg { width: 24px; height: 24px; fill: #0f172a; }
#aa-chat-btn .aa-pulse {
  position: absolute;
  top: 2px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

#aa-chat-window {
  position: fixed;
  bottom: 156px;
  width: 360px;
  height: 540px;
  background: var(--aa-dark);
  border-radius: var(--aa-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
}
#aa-chat-window.aa-right { right: 24px; }
#aa-chat-window.aa-left  { left:  24px; }
#aa-chat-window.aa-hidden {
  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
}

.aa-header {
  background: var(--aa-dark);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--aa-border);
  flex-shrink: 0;
}
.aa-logo {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--aa-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--aa-dark);
  flex-shrink: 0; letter-spacing: -.5px;
}
.aa-header-info { flex: 1; min-width: 0; }
.aa-header-name { font-size: 13.5px; font-weight: 600; color: var(--aa-text); }
.aa-header-sub  { font-size: 11px; color: var(--aa-muted); margin-top: 1px; }
.aa-online { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.aa-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--aa-muted); padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.aa-close-btn:hover { color: var(--aa-text); }
.aa-close-btn svg { width: 18px; height: 18px; }

.aa-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
}
.aa-messages::-webkit-scrollbar { width: 3px; }
.aa-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.aa-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 92%; }
.aa-msg.aa-bot  { align-self: flex-start; }
.aa-msg.aa-user { align-self: flex-end; flex-direction: row-reverse; }
.aa-av {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--aa-gold); color: var(--aa-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.aa-bubble {
  padding: 9px 13px; font-size: 13px; line-height: 1.55;
  word-break: break-word; max-width: 100%;
}
.aa-bot  .aa-bubble { background: var(--aa-panel); color: var(--aa-text); border-radius: 4px 14px 14px 14px; }
.aa-user .aa-bubble { background: var(--aa-gold); color: var(--aa-dark); border-radius: 14px 14px 4px 14px; font-weight: 500; }

.aa-typing { display: flex; gap: 3px; align-items: center; padding: 9px 13px; }
.aa-typing span {
  width: 5px; height: 5px; border-radius: 50%; background: #64748b;
  animation: aa-bounce 1.2s infinite;
}
.aa-typing span:nth-child(2) { animation-delay: .2s; }
.aa-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aa-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-4px)} }

/* Quick chips */
.aa-chips {
  padding: 6px 12px 8px; display: flex; gap: 5px; flex-wrap: wrap;
  border-top: 1px solid var(--aa-border); background: var(--aa-dark); flex-shrink: 0;
}
.aa-chip {
  font-size: 11.5px; border: 1px solid rgba(201,162,39,.4);
  border-radius: 14px; padding: 4px 11px; cursor: pointer;
  background: transparent; color: var(--aa-gold); font-family: inherit;
  transition: all .15s; white-space: nowrap;
}
.aa-chip:hover { background: var(--aa-gold); color: var(--aa-dark); }

/* Input row */
.aa-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  background: var(--aa-dark); border-top: 1px solid var(--aa-border); flex-shrink: 0;
}
.aa-input {
  flex: 1; background: var(--aa-input); border: 1px solid var(--aa-border);
  border-radius: 18px; padding: 8px 14px; font-size: 13px;
  color: var(--aa-text); outline: none; font-family: inherit;
}
.aa-input::placeholder { color: rgba(255,255,255,.28); }
.aa-input:focus { border-color: rgba(201,162,39,.5); }
.aa-send {
  width: 34px; height: 34px; border-radius: 50%; background: var(--aa-gold);
  color: var(--aa-dark); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity .15s;
}
.aa-send:hover { opacity: .85; }
.aa-send:disabled { opacity: .4; cursor: not-allowed; }
.aa-send svg { width: 16px; height: 16px; }

/* Vehicle cards */
.aa-cards {
  display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 4px;
}
.aa-cards::-webkit-scrollbar { height: 3px; }
.aa-cards::-webkit-scrollbar-thumb { background: rgba(201,162,39,.3); border-radius: 3px; }
.aa-card {
  background: #1e3a5f; border: 1px solid rgba(201,162,39,.25);
  border-radius: 10px; overflow: hidden; flex-shrink: 0; width: 180px;
}
.aa-card-img {
  width: 100%; height: 80px; object-fit: cover; display: block;
  background: linear-gradient(135deg,#0f172a,#1e3a5f);
}
.aa-card-img-placeholder {
  width: 100%; height: 80px; background: linear-gradient(135deg,#0f172a,#1e3a5f);
  display: flex; align-items: center; justify-content: center; font-size: 1.75rem; color: rgba(201,162,39,.35);
}
.aa-card-body { padding: 9px 10px; }
.aa-card-title { font-size: 12px; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aa-card-sub   { font-size: 11px; color: #64748b; margin-top: 1px; margin-bottom: 5px; }
.aa-card-price { font-size: 14px; font-weight: 700; color: var(--aa-gold); }
.aa-card-btns  { display: flex; gap: 5px; margin-top: 7px; }
.aa-card-btn {
  font-size: 11px; border-radius: 6px; padding: 4px 8px; cursor: pointer;
  font-family: inherit; flex: 1; text-align: center; text-decoration: none;
  display: block; transition: all .15s;
}
.aa-card-btn-outline {
  border: 1px solid rgba(201,162,39,.4); background: transparent; color: var(--aa-gold);
}
.aa-card-btn-outline:hover { background: var(--aa-gold); color: var(--aa-dark); border-color: var(--aa-gold); }
.aa-card-btn-solid {
  background: var(--aa-gold); color: var(--aa-dark); border: 1px solid var(--aa-gold); font-weight: 600;
}
.aa-card-btn-solid:hover { opacity: .85; }

/* Lead capture form */
.aa-lead-form {
  background: var(--aa-panel); border-radius: 10px; padding: 12px;
  margin-top: 4px; width: 100%;
}
.aa-lead-form p { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.aa-lead-input,
#aa-chatbot-root .aa-lead-input,
#aa-chatbot-root input.aa-lead-input {
  all: unset;
  display: block !important;
  width: 100% !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  border-radius: 8px !important;
  padding: 8px 11px !important;
  font-size: 13px !important;
  color: #f1f5f9 !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  margin-bottom: 7px !important;
  outline: none !important;
}
#aa-chatbot-root input.aa-lead-input::placeholder { color: rgba(255,255,255,.35) !important; }
#aa-chatbot-root input.aa-lead-input:focus { border-color: rgba(201,162,39,.6) !important; }
.aa-lead-submit {
  width: 100%; background: var(--aa-gold); color: var(--aa-dark); border: none;
  border-radius: 8px; padding: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: opacity .15s;
}
.aa-lead-submit:hover { opacity: .85; }
.aa-lead-submit:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 420px) {
  #aa-chat-window { width: calc(100vw - 24px); right: 12px !important; left: 12px !important; bottom: 140px; }
  #aa-chat-btn { bottom: 76px; }
}
