/* =====================================================================
   Burntree Technology — WhatsApp chat widget
   Prefix: bt-wa-   |   Charcoal + teal   |   No gradients, subtle motion
   All colors are CSS variables on .bt-wa-root → edit them in one place.
   ===================================================================== */

.bt-wa-root {
  /* ---- EDIT COLORS HERE ---- */
  --bt-wa-charcoal: #111827;
  --bt-wa-teal: #0F766E;
  --bt-wa-teal-dark: #115E59;
  --bt-wa-white: #FFFFFF;
  --bt-wa-border: #E5E7EB;
  --bt-wa-text: #374151;
  --bt-wa-muted: #9CA3AF;

  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990; /* below WP admin bar (99999), above page content */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Floating button ---------- */
.bt-wa-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-left: auto; /* keep button hugging the right edge */
  border: 0;
  border-radius: 50%;
  background: var(--bt-wa-teal);
  color: var(--bt-wa-white);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.18);
  transition: background .15s ease, transform .15s ease;
}
.bt-wa-toggle:hover { background: var(--bt-wa-teal-dark); transform: translateY(-2px); }
.bt-wa-toggle:focus-visible { outline: 3px solid var(--bt-wa-teal); outline-offset: 3px; }

/* Soft attention pulse (purely decorative) */
.bt-wa-toggle__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--bt-wa-teal);
  animation: bt-wa-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes bt-wa-pulse {
  0%   { transform: scale(1);   opacity: .55; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- Chat preview popout ---------- */
.bt-wa-popout {
  position: absolute;
  right: 0;
  bottom: 74px; /* sits just above the 60px button */
  width: 300px;
  max-width: calc(100vw - 40px);
  background: var(--bt-wa-white);
  border: 1px solid var(--bt-wa-border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.16);
  overflow: hidden;
  /* hidden by default; shown when .bt-wa-open is on the root */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  pointer-events: none;
}
.bt-wa-root.bt-wa-open .bt-wa-popout {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.bt-wa-popout__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: var(--bt-wa-charcoal);
  color: var(--bt-wa-white);
}
.bt-wa-popout__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--bt-wa-teal);
  color: var(--bt-wa-white);
}
.bt-wa-popout__id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.bt-wa-popout__id strong { font-size: .95rem; }
.bt-wa-popout__status { font-size: .72rem; color: var(--bt-wa-muted); }
.bt-wa-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--bt-wa-white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.bt-wa-close:hover { background: rgba(255, 255, 255, .14); }

.bt-wa-popout__body { padding: 16px 16px 4px; }
.bt-wa-popout__title { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: var(--bt-wa-charcoal); }
.bt-wa-popout__msg { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--bt-wa-text); }

.bt-wa-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 16px 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--bt-wa-teal);
  color: var(--bt-wa-white);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease;
}
.bt-wa-start:hover { background: var(--bt-wa-teal-dark); color: var(--bt-wa-white); }
.bt-wa-start__icon { display: inline-grid; place-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .bt-wa-root { right: 14px; }
  .bt-wa-toggle { width: 54px; height: 54px; }
  .bt-wa-popout { width: 270px; bottom: 66px; }
}
/* Lift the widget above the theme's sticky mobile CTA bar (shows <=768px)
   so the two don't overlap. Adjust 78px if your sticky bar is taller. */
@media (max-width: 768px) {
  .bt-wa-root { bottom: 78px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .bt-wa-toggle__pulse { animation: none; }
  .bt-wa-popout, .bt-wa-toggle { transition: none; }
}
