/* ===== Live chat widget: floating WhatsApp-style button + FAQ panel ===== */

.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 998; /* just under the navbar's 999 */
}

.chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: #25d366; /* WhatsApp green — this button's whole job is to open WhatsApp */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s ease;
}

.chat-toggle:hover {
  transform: scale(1.06);
}

.chat-toggle svg {
  width: 28px;
  height: 28px;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 320px;
  max-width: calc(100vw - 40px);
  max-height: 70vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-panel-header {
  background: var(--accent);
  color: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 120px;
}

.chat-message {
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  max-width: 85%;
}

.chat-message-bot {
  background: var(--card);
  align-self: flex-start;
}

.chat-message-user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
}

.chat-link-cta,
.chat-whatsapp-cta {
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}

.chat-whatsapp-cta {
  color: #128c4a;
  border-color: rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.08);
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
}

.chat-quick-reply {
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.chat-quick-reply:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.chat-form .form-control {
  flex: 1;
  padding: 0.55rem 0.75rem;
}

.chat-whatsapp-footer {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.6rem;
  color: #128c4a;
  background: rgba(37, 211, 102, 0.08);
  text-decoration: none;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 32px);
    right: -4px;
  }
}
