/* Widget flutuante de atendimento */
.wa {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.wa-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(368px, calc(100vw - 28px));
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  color: #111b21;
  box-shadow: 0 18px 50px rgba(20, 16, 12, 0.28);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.wa.is-open .wa-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.wa-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(180deg, #128c7e 0%, #075e54 100%);
  color: #fff;
}

.wa-head-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
}

.wa-name {
  margin: 0;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.wa-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.wa-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.28);
}

.wa-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.wa-close:hover { background: rgba(255, 255, 255, 0.14); }

.wa-body {
  padding: 16px 14px 8px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(7, 94, 84, 0.08) 0.7px, transparent 0.7px);
  background-size: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  align-self: flex-start;
  max-width: 92%;
  padding: 10px 12px 8px;
  background: #fff;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.08);
}

.bubble p {
  margin: 0;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #111b21;
}

.bubble time {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 11px;
  color: #8696a0;
}

.wa-foot {
  padding: 12px 14px 14px;
  background: #f7f7f7;
}

.wa-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.28);
}

.wa-cta:hover { filter: brightness(1.05); }

.wa-note {
  margin: 8px 0 0;
  text-align: center;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 12px;
  color: #667781;
}

.wa-toggle {
  position: relative;
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(20, 16, 12, 0.28);
  transition: transform 0.2s ease;
}

.wa-toggle:hover { transform: scale(1.06); }

.wa-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  border: 2px solid #fff;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.wa.is-open .wa-badge { display: none; }

.wa-toggle:focus-visible,
.wa-close:focus-visible,
.wa-cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .wa { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .wa-toggle { width: 58px; height: 58px; }
  .wa.is-open .wa-panel {
    max-height: min(62dvh, 520px);
  }
  .wa-body { overflow: auto; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-panel, .wa-toggle { transition: none; }
}
