/* ════════════════════════════════════════════════════
   SALES CHATBOT — shared widget (extracted from index.html)
════════════════════════════════════════════════════ */
.chat-btn {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 500;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--teal);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate);
  box-shadow: 0 4px 28px rgba(52,179,169,.45);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  will-change: transform;
}
.chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 36px rgba(52,179,169,.65);
  background: var(--teal-dark);
}
.chat-btn::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  opacity: 0;
  animation: chat-pulse 2.6s ease-out infinite;
}
@keyframes chat-pulse {
  0%   { transform: scale(0.88); opacity: .65; }
  100% { transform: scale(1.55); opacity: 0; }
}
.chat-btn__dot {
  position: absolute; top: 4px; right: 4px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--warm-white);
  border: 2.5px solid var(--teal);
}
.chat-btn__icon--open  { display: flex; }
.chat-btn__icon--close { display: none; }
.chat-btn.is-open .chat-btn__icon--open  { display: none; }
.chat-btn.is-open .chat-btn__icon--close { display: flex; }
.chat-btn.is-open .chat-btn__dot { display: none; }

.chat-window {
  position: fixed;
  bottom: 102px; right: 28px;
  z-index: 499;
  width: min(520px, calc(100vw - 40px));
  max-height: min(700px, calc(100vh - 140px));
  border-radius: 22px;
  overflow: hidden;
  background: var(--slate);
  box-shadow:
    0 28px 80px rgba(0,0,0,.5),
    0 8px 24px rgba(0,0,0,.3),
    0 0 0 1px rgba(52,179,169,.14);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px) scale(0.93);
  pointer-events: none;
  transition:
    opacity 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, opacity;
}
.chat-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  background: var(--slate-80);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 13px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(52,179,169,.1);
}
.chat-header__avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--slate);
  border: 1.5px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-header__info { flex: 1; }
.chat-header__name {
  font-weight: 700; font-size: 14.5px;
  letter-spacing: -.01em; color: var(--warm-white);
}
.chat-header__status {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: .12em;
  color: var(--teal);
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.chat-header__status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  display: block;
  animation: status-blink 2.2s ease-in-out infinite;
}
@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--slate-80); border-radius: 2px; }

.chat-msg {
  display: flex; flex-direction: column; gap: 3px;
  animation: bubble-in 300ms cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg--agent { align-items: flex-start; }
.chat-msg--user  { align-items: flex-end; }

.chat-bubble {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 17px;
  font-size: 13.5px;
  line-height: 1.58;
}
.chat-msg--agent .chat-bubble {
  background: var(--slate-80);
  color: var(--warm-white);
  border-bottom-left-radius: 4px;
}
.chat-msg--user .chat-bubble {
  background: var(--teal);
  color: var(--slate);
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

.chat-typing-wrap {
  display: flex; align-items: flex-start;
  animation: bubble-in 220ms cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.chat-typing {
  display: flex; align-items: center; gap: 5px;
  padding: 13px 16px;
  background: var(--slate-80);
  border-radius: 17px; border-bottom-left-radius: 4px;
}
.chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .18s; }
.chat-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(.7); opacity: .4; }
  40%            { transform: scale(1);  opacity: 1; }
}

.chat-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 2px 14px 4px;
  animation: bubble-in 300ms 120ms cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.chat-chip {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1.5px solid var(--teal);
  border-radius: 100px;
  color: var(--teal);
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
  white-space: nowrap;
}
.chat-chip:hover { background: var(--teal); color: var(--slate); }

.chat-cta-wrap {
  padding: 4px 14px 2px;
  animation: bubble-in 300ms 200ms cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.chat-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--teal); color: var(--slate);
  font-weight: 700; font-size: 13px; letter-spacing: .01em;
  border-radius: 100px;
  transition: background .18s ease, transform .15s ease;
}
.chat-cta-btn:hover { background: var(--teal-dark); color: var(--warm-white); transform: translateY(-2px); }

.chat-input-row {
  padding: 13px 14px;
  border-top: 1px solid var(--slate-80);
  display: flex; gap: 9px; align-items: center;
  flex-shrink: 0;
  background: var(--slate);
}
.chat-input {
  flex: 1;
  background: var(--slate-80);
  border: 1px solid transparent;
  border-radius: 100px;
  padding: 9px 16px;
  font-family: var(--font-display); font-size: 13.5px;
  color: var(--warm-white);
  outline: none; caret-color: var(--teal);
  transition: border-color .18s ease;
}
.chat-input::placeholder { color: var(--muted); }
.chat-input:focus { border-color: rgba(52,179,169,.5); }
.chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--teal); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate); flex-shrink: 0;
  transition: background .18s ease, transform .15s ease;
}
.chat-send:hover { background: var(--teal-dark); transform: scale(1.08); }

@keyframes bubble-bob {
  0%, 100% { transform: translateY(0) scale(1); }
  30%       { transform: translateY(-9px) scale(1.03); }
  60%       { transform: translateY(-4px) scale(1.01); }
}
@keyframes btn-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  15%       { transform: rotate(-12deg) scale(1.12); }
  30%       { transform: rotate(10deg) scale(1.12); }
  45%       { transform: rotate(-8deg) scale(1.08); }
  60%       { transform: rotate(6deg) scale(1.08); }
  75%       { transform: rotate(-4deg) scale(1.04); }
  88%       { transform: rotate(2deg) scale(1.02); }
}
@keyframes teal-glow-pulse {
  0%, 100% { box-shadow: 0 4px 28px rgba(52,179,169,.45), 0 0 0 0 rgba(52,179,169,.5); }
  50%       { box-shadow: 0 4px 28px rgba(52,179,169,.45), 0 0 0 14px rgba(52,179,169,0); }
}

.chat-idle-bubble {
  position: fixed; bottom: 106px; right: 24px; z-index: 498;
  background: var(--slate); color: var(--warm-white);
  font-size: 15.5px; font-weight: 700; line-height: 1.55;
  padding: 18px 22px 18px 20px; border-radius: 20px; border-bottom-right-radius: 4px;
  box-shadow: 0 16px 56px rgba(0,0,0,.6), 0 0 0 2.5px var(--teal), 0 0 32px rgba(52,179,169,.35);
  max-width: 290px; width: 290px; cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.88);
  pointer-events: none;
  transition: opacity 0.38s ease, transform 0.38s cubic-bezier(0.34,1.56,0.64,1);
}
.chat-idle-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: bubble-bob 2.2s ease-in-out 0.4s infinite;
}
.chat-idle-bubble::before {
  content: '👋';
  display: inline-block;
  margin-right: 8px;
  font-size: 18px;
}
.chat-idle-bubble::after {
  content: ''; position: absolute; bottom: -11px; right: 22px;
  border: 11px solid transparent;
  border-top: 11px solid var(--slate);
  border-bottom: none;
  filter: drop-shadow(0 4px 5px rgba(0,0,0,.3));
}
.chat-btn.is-pinging {
  animation: btn-wiggle 0.65s cubic-bezier(0.36,0.07,0.19,0.97) both,
             teal-glow-pulse 1.4s ease-in-out 700ms 3;
}

@media (max-width: 768px) {
  .chat-btn { bottom: 18px; right: 18px; }
  .chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 86px;
    border-radius: 18px;
    max-height: calc(100vh - 110px);
  }
  .chat-idle-bubble {
    width: calc(100vw - 88px);
    max-width: 270px;
    right: 18px;
    bottom: 90px;
    font-size: 13.5px;
    padding: 14px 16px 14px 14px;
  }
}
@media (max-width: 480px) {
  .chat-window { width: calc(100vw - 12px); right: 6px; }
}
