/* Floating lead assistant — sitewide */

.sa-chatbot-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.125rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(232, 119, 34, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.sa-chatbot-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(232, 119, 34, 0.5);
}
.sa-chatbot-fab svg { flex-shrink: 0; }
.sa-chatbot-fab-label { display: none; }
@media (min-width: 480px) {
  .sa-chatbot-fab-label { display: inline; }
}

.sa-chatbot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 89;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 7rem));
  background: #fff;
  border-radius: 1rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 24px 64px rgba(11, 37, 69, 0.18);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
.sa-chatbot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.sa-chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.125rem;
  background: var(--navy);
  color: #fff;
  border-radius: 1rem 1rem 0 0;
}
.sa-chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sa-chatbot-header-info img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
}
.sa-chatbot-header strong {
  display: block;
  font-size: 0.875rem;
}
.sa-chatbot-header span {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.65);
}
.sa-chatbot-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
}
.sa-chatbot-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.sa-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.sa-chatbot-msg {
  max-width: 92%;
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.55;
}
.sa-chatbot-msg--bot {
  align-self: flex-start;
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.sa-chatbot-msg--user {
  align-self: flex-end;
  background: var(--navy);
  color: #fff;
}
.sa-chatbot-msg a {
  color: var(--accent);
  font-weight: 600;
}
.sa-chatbot-msg--bot a { color: var(--accent); }

.sa-chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0 1rem 0.75rem;
}
.sa-chatbot-chip {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.sa-chatbot-chip:hover {
  border-color: var(--accent);
  background: rgba(232, 119, 34, 0.06);
}

.sa-chatbot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--gray-100);
}
.sa-chatbot-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: opacity 0.15s;
}
.sa-chatbot-action--wa {
  background: #25d366;
  color: #fff;
  grid-column: 1 / -1;
}
.sa-chatbot-action--contact {
  background: var(--navy);
  color: #fff;
}
.sa-chatbot-action--trial {
  background: var(--accent);
  color: #fff;
}
.sa-chatbot-action:hover { opacity: 0.92; }

.sa-chatbot-typing {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0;
}
.sa-chatbot-typing span {
  width: 6px;
  height: 6px;
  background: var(--gray-400);
  border-radius: 50%;
  animation: sa-chat-bounce 1.2s infinite;
}
.sa-chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.sa-chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sa-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

@media (max-width: 479px) {
  .sa-chatbot-fab {
    bottom: 1rem;
    right: 1rem;
    padding: 0.875rem;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    justify-content: center;
  }
  .sa-chatbot-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
  }
}
