/* NAJ AI Assistant widget — everything scoped under #najbot-root */
#najbot-root {
  --najbot-primary: #1a1a1a;
  --najbot-accent: #c8102e;
  --najbot-bg: #ffffff;
  --najbot-soft: #f3f3f4;
  --najbot-text: #1d1d1f;
  --najbot-muted: #6b6b70;
  position: fixed;
  bottom: 20px;
  z-index: 999990;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--najbot-text);
}
#najbot-root.najbot-right { right: 20px; }
#najbot-root.najbot-left { left: 20px; }
#najbot-root *, #najbot-root *::before, #najbot-root *::after { box-sizing: border-box; }
#najbot-root button { font: inherit; cursor: pointer; }

.najbot-launcher {
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--najbot-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transition: transform .15s ease;
  margin-left: auto;
}
.najbot-left .najbot-launcher { margin-left: 0; }
.najbot-launcher:hover { transform: scale(1.06); }
.najbot-launcher:focus-visible { outline: 3px solid var(--najbot-accent); outline-offset: 3px; }

.najbot-panel {
  display: none;
  position: absolute; bottom: 72px;
  width: 370px; height: min(600px, calc(100vh - 110px));
  background: var(--najbot-bg);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  overflow: hidden;
  flex-direction: column;
}
.najbot-right .najbot-panel { right: 0; }
.najbot-left .najbot-panel { left: 0; }
.najbot-open .najbot-panel { display: flex; animation: najbot-in .18s ease-out; }
@keyframes najbot-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.najbot-header {
  background: var(--najbot-primary); color: #fff;
  padding: 14px 12px 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--najbot-accent);
}
.najbot-title strong { display: block; font-size: 15px; }
.najbot-sub { font-size: 12px; opacity: .75; }
.najbot-head-btns { display: flex; gap: 4px; }
.najbot-icon-btn {
  background: transparent; border: 0; color: #fff; opacity: .85;
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.najbot-icon-btn:hover { opacity: 1; background: rgba(255,255,255,.12); }

.najbot-body {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  background: #fafafa;
  overscroll-behavior: contain;
}
.najbot-msg { display: flex; margin: 0 0 10px; }
.najbot-user { justify-content: flex-end; }
.najbot-bubble {
  max-width: 85%; padding: 9px 13px; border-radius: 14px;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.najbot-assistant .najbot-bubble { background: var(--najbot-bg); border: 1px solid #e6e6e8; border-bottom-left-radius: 4px; }
.najbot-user .najbot-bubble { background: var(--najbot-primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.najbot-bubble a { color: var(--najbot-accent); text-decoration: underline; }
.najbot-li { display: block; padding-left: 14px; position: relative; }
.najbot-li::before { content: "•"; position: absolute; left: 2px; }

.najbot-typing .najbot-bubble { display: flex; gap: 4px; padding: 13px 14px; }
.najbot-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #b5b5ba;
  animation: najbot-dot 1.2s infinite ease-in-out;
}
.najbot-typing span:nth-child(2) { animation-delay: .15s; }
.najbot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes najbot-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.najbot-cards { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.najbot-card {
  display: flex; gap: 10px; align-items: center;
  background: var(--najbot-bg); border: 1px solid #e6e6e8; border-radius: 12px;
  padding: 8px; text-decoration: none !important; color: inherit !important;
  transition: border-color .15s, box-shadow .15s;
}
.najbot-card:hover { border-color: var(--najbot-accent); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.najbot-card img { width: 64px; height: 76px; object-fit: cover; border-radius: 8px; flex: none; background: var(--najbot-soft); }
.najbot-card-info { min-width: 0; }
.najbot-card-name { font-weight: 600; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.najbot-card-price { font-size: 13px; margin-top: 3px; color: var(--najbot-text); }
.najbot-sale { background: var(--najbot-accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 6px; text-transform: uppercase; }
.najbot-card-cta { display: inline-block; margin-top: 3px; font-size: 12px; color: var(--najbot-accent); font-weight: 600; }

.najbot-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.najbot-chip {
  border: 1px solid var(--najbot-primary); background: var(--najbot-bg); color: var(--najbot-primary);
  border-radius: 999px; padding: 6px 12px; font-size: 13px;
}
.najbot-chip:hover { background: var(--najbot-primary); color: #fff; }

.najbot-livechat {
  display: block; margin: 0 0 12px; border: 0; border-radius: 10px;
  background: var(--najbot-accent); color: #fff; font-weight: 600; padding: 10px 14px; width: 100%;
}

.najbot-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid #eee; background: var(--najbot-bg); }
.najbot-input {
  flex: 1; resize: none; border: 1px solid #d9d9dd; border-radius: 12px;
  padding: 9px 12px; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
  max-height: 110px; outline: none; background: #fff; color: var(--najbot-text);
}
.najbot-input:focus { border-color: var(--najbot-primary); }
.najbot-send {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  background: var(--najbot-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.najbot-send:disabled { opacity: .5; cursor: default; }
.najbot-foot { font-size: 11px; color: var(--najbot-muted); text-align: center; padding: 0 10px 8px; background: var(--najbot-bg); }

@media (max-width: 480px) {
  #najbot-root { bottom: 14px; }
  #najbot-root.najbot-right { right: 14px; }
  #najbot-root.najbot-left { left: 14px; }
  .najbot-open .najbot-panel {
    position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; bottom: auto;
  }
  .najbot-open .najbot-launcher { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .najbot-open .najbot-panel, .najbot-typing span, .najbot-launcher { animation: none; transition: none; }
}
