/* AVTOBAKU AI Messenger — widget styles */
#avtobaku-ai-root, #avtobaku-ai-root * { box-sizing: border-box; }
#avtobaku-ai-root {
  --ab-ai-ink: #18212b;
  --ab-ai-muted: #687482;
  --ab-ai-red: #d62828;
  --ab-ai-border: #e7ebef;
  --ab-ai-bg: #ffffff;
  --ab-ai-soft: #f4f6f8;
  font-family: Tahoma, Arial, sans-serif;
  color: var(--ab-ai-ink);
  position: relative;
  z-index: 2147483000;
}
.ab-ai-launcher {
  position: fixed; right: 24px; bottom: 24px;
  width: 64px; height: 64px; border: 0; border-radius: 50%;
  background: var(--ab-ai-red); color: #fff; cursor: pointer;
  box-shadow: 0 10px 30px rgba(15,23,42,.24);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ab-ai-launcher:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15,23,42,.3); }
.ab-ai-launcher svg { width: 29px; height: 29px; }
.ab-ai-launcher-label {
  position: fixed; right: 98px; bottom: 39px; background: #fff;
  border: 1px solid var(--ab-ai-border); border-radius: 20px;
  padding: 9px 14px; font-size: 13px; font-weight: 700;
  box-shadow: 0 5px 18px rgba(15,23,42,.09); white-space: nowrap;
}
.ab-ai-window {
  position: fixed; right: 24px; bottom: 102px; width: 380px; height: min(620px, calc(100vh - 130px));
  min-height: 440px; background: var(--ab-ai-bg); border: 1px solid rgba(20,30,40,.08);
  border-radius: 20px; box-shadow: 0 18px 60px rgba(15,23,42,.22);
  display: none; overflow: hidden; flex-direction: column;
}
.ab-ai-window.ab-ai-open { display: flex; animation: abAiIn .18s ease-out; }
@keyframes abAiIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.ab-ai-header {
  min-height: 76px; padding: 15px 17px; display: flex; align-items: center; gap: 12px;
  color: #fff; background: linear-gradient(120deg, #18212b, #263746);
}
.ab-ai-avatar {
  width: 43px; height: 43px; border-radius: 14px; flex: 0 0 43px;
  display: grid; place-items: center; background: var(--ab-ai-red); color: white;
  font-size: 17px; font-weight: 800; letter-spacing: -.5px;
}
.ab-ai-heading { min-width: 0; flex: 1; }
.ab-ai-title { font-size: 15px; line-height: 1.25; font-weight: 800; }
.ab-ai-subtitle { margin-top: 5px; font-size: 11px; color: #d1d9e0; }
.ab-ai-online { display: inline-block; width: 7px; height: 7px; background: #43d18b; border-radius: 50%; margin-right: 5px; }
.ab-ai-close {
  width: 34px; height: 34px; border: 0; border-radius: 10px; color: #fff;
  background: rgba(255,255,255,.12); cursor: pointer; font-size: 22px; line-height: 1;
}
.ab-ai-messages {
  flex: 1; overflow-y: auto; padding: 17px 14px 12px; background: #fbfcfd;
  scroll-behavior: smooth;
}
.ab-ai-welcome { margin: 0 0 14px; padding: 13px 14px; border-radius: 4px 15px 15px 15px; background: #fff; border: 1px solid var(--ab-ai-border); font-size: 13px; line-height: 1.55; }
.ab-ai-quick { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.ab-ai-quick button {
  border: 1px solid #ead4d4; background: #fff; color: #9e2020; border-radius: 18px;
  padding: 8px 10px; font: 12px Tahoma, Arial, sans-serif; cursor: pointer;
}
.ab-ai-quick button:hover { background: #fff3f3; }
.ab-ai-msg { max-width: 88%; margin: 9px 0; padding: 11px 13px; border-radius: 14px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ab-ai-msg-user { margin-left: auto; color: #fff; background: #263746; border-bottom-right-radius: 4px; }
.ab-ai-msg-bot { margin-right: auto; color: #25313d; background: #fff; border: 1px solid var(--ab-ai-border); border-bottom-left-radius: 4px; }
.ab-ai-typing { color: var(--ab-ai-muted); font-size: 12px; padding: 4px 2px 10px; }
.ab-ai-compose { padding: 12px; background: #fff; border-top: 1px solid var(--ab-ai-border); }
.ab-ai-form { display: flex; align-items: flex-end; gap: 8px; }
.ab-ai-input {
  flex: 1; min-width: 0; min-height: 44px; max-height: 110px; resize: vertical;
  border: 1px solid #dce2e8; border-radius: 13px; padding: 12px;
  outline: none; font: 13px Tahoma, Arial, sans-serif; color: var(--ab-ai-ink);
}
.ab-ai-input:focus { border-color: #9daab6; box-shadow: 0 0 0 3px rgba(38,55,70,.08); }
.ab-ai-send {
  flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 13px;
  background: var(--ab-ai-red); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.ab-ai-send:disabled { opacity: .55; cursor: wait; }
.ab-ai-send svg { width: 19px; height: 19px; }
.ab-ai-footnote { margin-top: 8px; color: #929ba5; text-align: center; font-size: 10px; line-height: 1.4; }
@media (max-width: 520px) {
  .ab-ai-launcher { right: 16px; bottom: 16px; width: 58px; height: 58px; }
  .ab-ai-launcher-label { right: 84px; bottom: 32px; }
  .ab-ai-window { right: 0; bottom: 0; width: 100%; height: 100dvh; max-height: 100dvh; min-height: 0; border-radius: 0; }
  .ab-ai-header { padding-top: max(15px, env(safe-area-inset-top)); }
  .ab-ai-compose { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}


/* Compact product results: keep the AI's explanatory text visible. */
.ab-ai-product-group {
  width: min(96%, 420px);
  margin: 8px 0 12px 0;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}
.ab-ai-product-heading {
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 8px;
}
.ab-ai-product-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 210px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}
.ab-ai-product-card {
  padding: 9px 10px;
  border: 1px solid #edf0f2;
  border-radius: 9px;
  background: #fafafa;
  font-size: 12px;
  line-height: 1.4;
}
.ab-ai-product-name {
  display: block;
  color: #20252b;
  font-size: 13px;
  font-weight: 700;
}
.ab-ai-product-meta {
  margin-top: 3px;
  color: #6b7280;
  font-size: 11px;
}
.ab-ai-product-link {
  display: inline-block;
  margin-top: 6px;
  color: #b51f27 !important;
  font-weight: 700;
  text-decoration: none;
  font-size: 12px;
}
.ab-ai-product-link:hover {
  text-decoration: underline;
}

/* Optional catalog thumbnails */
.ab-ai-product-image { display:block; width:100%; max-width:110px; height:76px; object-fit:contain; margin:0 0 7px; border-radius:7px; background:#fff; }
