/* Floating WhatsApp / Call buttons + chatbot (standalone: not touched by `npm run build`) */
.fw-stack {
  position: fixed;
  left: 18px;
  bottom: 22px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fw-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(23, 38, 88, 0.28);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
}
.fw-btn:hover {
  transform: translateY(-3px) scale(1.05);
}
.fw-wa {
  background: #25d366;
}
.fw-call {
  background: #172658;
}
.fw-wa::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #25d366;
  animation: fwPulse 2s infinite;
  pointer-events: none;
}
@keyframes fwPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.fw-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 96;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #be4a87;
  box-shadow: 0 12px 28px rgba(190, 74, 135, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s;
}
.fw-chat-launcher:hover {
  background: #9d3a6e;
  transform: scale(1.06);
}
.fw-chat-launcher .fw-ico-x {
  display: none;
}
.fw-chat-launcher.open .fw-ico-chat {
  display: none;
}
.fw-chat-launcher.open .fw-ico-x {
  display: block;
}

/* keep the back-to-top button clear of the chat launcher */
.back-to-top {
  bottom: 96px !important;
}

.fw-chat {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 97;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(23, 38, 88, 0.28);
  overflow: hidden;
  font-family: "Montserrat", system-ui, sans-serif;
  animation: fwIn 0.22s ease;
}
.fw-chat[hidden] {
  display: none;
}
@keyframes fwIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.fw-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #172658, #be4a87);
  color: #fff;
}
.fw-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.fw-chat-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.fw-chat-title strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fw-chat-title span {
  font-size: 12px;
  opacity: 0.9;
}
.fw-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 4px;
}
.fw-chat-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
}
.fw-chat-close:hover {
  background: rgba(255, 255, 255, 0.18);
}
.fw-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f6f7fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fw-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  color: #172658;
}
.fw-msg.bot {
  background: #fff;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(23, 38, 88, 0.06);
  align-self: flex-start;
}
.fw-msg.user {
  background: #be4a87;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.fw-msg a {
  color: #be4a87;
  font-weight: 600;
  text-decoration: underline;
}
.fw-msg.user a {
  color: #fff;
}
.fw-msg ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.fw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.fw-actions a {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #172658;
}
.fw-actions a.wa {
  background: #25d366;
}
.fw-actions a.pk {
  background: #be4a87;
}
.fw-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}
.fw-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b7bdd3;
  animation: fwBlink 1s infinite;
}
.fw-typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.fw-typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes fwBlink {
  0%,
  80%,
  100% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}
.fw-chips {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid #e5e8f1;
  scrollbar-width: thin;
}
.fw-chips:empty {
  display: none;
}
.fw-chips button {
  flex: none;
  border: 1px solid #be4a87;
  background: #fff;
  color: #be4a87;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.fw-chips button:hover {
  background: #be4a87;
  color: #fff;
}
.fw-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e5e8f1;
}
.fw-chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e8f1;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.fw-chat-form input:focus {
  border-color: #be4a87;
}
.fw-chat-form button {
  width: 42px;
  border: 0;
  border-radius: 12px;
  background: #be4a87;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fw-chat-form button:hover {
  background: #172658;
}
.fw-chat-note {
  margin: 0;
  padding: 0 12px 8px;
  background: #fff;
  font-size: 10.5px;
  color: #7d86a3;
  text-align: center;
}

@media (max-width: 575px) {
  .fw-stack {
    left: 12px;
    bottom: 16px;
  }
  .fw-btn {
    width: 50px;
    height: 50px;
  }
  .fw-chat-launcher {
    right: 12px;
    bottom: 16px;
    width: 54px;
    height: 54px;
  }
  .back-to-top {
    bottom: 84px !important;
    right: 16px;
  }
  .fw-chat {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    bottom: 80px;
    height: calc(100vh - 100px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .fw-wa::after,
  .fw-chat {
    animation: none;
  }
}
