/* Animated WhatsApp greeting bubble displayed above the existing tracked button. */
.wa-chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 154px;
  z-index: 97;
  width: min(320px, calc(100vw - 48px));
  padding: 20px 48px 20px 22px;
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: 22px 22px 4px 22px;
  background: rgba(15, 19, 34, 0.96);
  color: #f8fafc;
  box-shadow:
    0 18px 48px -18px rgba(0, 0, 0, 0.7),
    0 0 26px rgba(37, 211, 102, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform-origin: bottom right;
  transition:
    opacity 0.3s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.3s;
}

.smartme-js .wa-chat-bubble {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.94);
}

.smartme-js .wa-chat-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.smartme-js .wa-chat-bubble.is-dismissed {
  display: none;
}

.wa-chat-bubble::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(37, 211, 102, 0.28);
  border-bottom: 1px solid rgba(37, 211, 102, 0.28);
  background: #0f1322;
  transform: rotate(45deg);
}

.wa-chat-bubble-greeting,
.wa-chat-bubble-message {
  position: relative;
  z-index: 1;
  display: block;
}

.wa-chat-bubble-greeting {
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.wa-chat-wave {
  display: inline-block;
  margin-left: 2px;
  transform-origin: 72% 72%;
  animation: waChatWave 2.8s ease-in-out 1s infinite;
}

@keyframes waChatWave {
  0%,
  55%,
  100% {
    transform: rotate(0deg);
  }
  62% {
    transform: rotate(18deg);
  }
  69% {
    transform: rotate(-10deg);
  }
  76% {
    transform: rotate(16deg);
  }
  83% {
    transform: rotate(-6deg);
  }
  90% {
    transform: rotate(8deg);
  }
}

.wa-chat-bubble-message {
  color: #dbe4ef;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.wa-chat-bubble-close {
  position: absolute;
  top: 11px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #94a3b8;
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wa-chat-bubble-close:hover,
.wa-chat-bubble-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: rotate(4deg);
  outline: none;
}

body.theme-light .wa-chat-bubble {
  border-color: rgba(30, 58, 138, 0.12);
  background: rgba(255, 255, 255, 0.97);
  color: #0f172a;
  box-shadow:
    0 18px 48px -18px rgba(30, 58, 138, 0.3),
    0 0 24px rgba(37, 211, 102, 0.1);
}

body.theme-light .wa-chat-bubble::after {
  border-color: rgba(30, 58, 138, 0.12);
  background: #ffffff;
}

body.theme-light .wa-chat-bubble-greeting {
  color: #0f172a;
}

body.theme-light .wa-chat-bubble-message {
  color: #334155;
}

body.theme-light .wa-chat-bubble-close {
  color: #64748b;
}

body.theme-light .wa-chat-bubble-close:hover,
body.theme-light .wa-chat-bubble-close:focus-visible {
  background: rgba(30, 58, 138, 0.08);
  color: #0f172a;
}

body.chattra-landing-page .wa-chat-bubble {
  display: none !important;
}

@media (max-width: 1024px) {
  .wa-chat-bubble {
    right: 16px;
    bottom: 228px;
    width: min(300px, calc(100vw - 32px));
    padding: 18px 44px 18px 20px;
    border-radius: 20px 20px 4px 20px;
  }

  .wa-chat-bubble-greeting {
    font-size: 18px;
  }

  .wa-chat-bubble-message {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .wa-chat-bubble {
    right: 14px;
    bottom: 219px;
    width: min(300px, calc(100vw - 28px));
  }
}

@media (max-width: 360px) {
  .wa-chat-bubble {
    bottom: 214px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-chat-bubble,
  .wa-chat-bubble-close,
  .wa-chat-wave {
    animation: none !important;
    transition: none !important;
  }
}
