/**
 * WaCta Widget Stylesheet v0.1.0
 * Standalone — all classes prefixed with wacta- for WordPress compatibility.
 * (c) KanZansio.Digital
 */

/* ═══════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════ */
.wacta-root {
  --wacta-surface-solid: #ffffff;
  --wacta-green: #25d366;
  --wacta-green-deep: #128c7e;
  --wacta-green-night: #075e54;
  --wacta-green-soft: #dcf8c6;
  --wacta-blue: #00a3c4;
  --wacta-blue-deep: #183b56;
  --wacta-focus: #00b2ff;
  --wacta-shadow-lg: 0 18px 40px rgba(7, 24, 30, 0.10);
  --wacta-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --wacta-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════
   ROOT CONTAINER
   ═══════════════════════════════════════ */
.wacta-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wacta-root *,
.wacta-root *::before,
.wacta-root *::after {
  box-sizing: border-box;
}

.wacta-root * {
  pointer-events: auto;
}

.wacta-root button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.wacta-root input,
.wacta-root textarea {
  font: inherit;
  color: inherit;
}

.wacta-root svg {
  display: block;
  max-width: 100%;
}

/* ═══════════════════════════════════════
   LAUNCHER WRAPPER
   ═══════════════════════════════════════ */
.wacta-launcher-wrap {
  position: fixed;
  bottom: 24px;
  z-index: 92;
  font-size: 16px;
  animation: wacta-launcher-in 0.5s var(--wacta-ease-out-back) 1.2s both;
}

.wacta-launcher-wrap.is-left {
  left: 24px;
}

.wacta-launcher-wrap.is-right {
  right: 24px;
}

@keyframes wacta-launcher-in {
  from { opacity: 0; transform: translateY(28px) scale(0.7); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════
   LAUNCHER BUTTONS
   ═══════════════════════════════════════ */
.wacta-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  cursor: pointer;
}

.wacta-launcher-circle,
.wacta-launcher-pill {
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(135deg, var(--wacta-green), var(--wacta-green-deep));
  box-shadow:
    0 0.7em 1.6em rgba(37, 211, 102, 0.32),
    0 0.2em 0.5em rgba(7, 24, 30, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wacta-launcher-circle:hover,
.wacta-launcher-pill:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 0.9em 1.8em rgba(37, 211, 102, 0.4),
    0 0.3em 0.6em rgba(7, 24, 30, 0.1);
}

.wacta-launcher-circle:active,
.wacta-launcher-pill:active {
  transform: translateY(0) scale(0.98);
}

.wacta-launcher-circle {
  width: 3.6em;
  height: 3.6em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: wacta-launcher-pulse 3s infinite;
}

.wacta-launcher-circle svg {
  width: 1.7em;
  height: 1.7em;
}

.wacta-launcher-pill {
  min-height: 3.6em;
  padding: 0.5em 0.5em 0.5em 1em;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  animation: wacta-launcher-pulse 3s infinite;
}

.wacta-launcher-pill strong {
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.wacta-launcher-icon {
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
}

.wacta-launcher-icon svg {
  width: 1.3em;
  height: 1.3em;
}

@keyframes wacta-launcher-pulse {
  0%   { box-shadow: 0 0.7em 1.6em rgba(37, 211, 102, 0.32), 0 0 0 0 rgba(37, 211, 102, 0.42); }
  70%  { box-shadow: 0 0.7em 1.6em rgba(37, 211, 102, 0.32), 0 0 0 1em rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0.7em 1.6em rgba(37, 211, 102, 0.32), 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ═══════════════════════════════════════
   WIDGET WRAPPER
   ═══════════════════════════════════════ */
.wacta-widget-wrap {
  position: fixed;
  bottom: 24px;
  z-index: 93;
  width: min(360px, calc(100% - 32px));
  font-size: 14px;
  display: none;
}

.wacta-widget-wrap.is-left {
  left: 24px;
}

.wacta-widget-wrap.is-right {
  right: 24px;
}

.wacta-widget-wrap.is-open {
  display: block;
  animation: wacta-slide-up 0.35s var(--wacta-ease-out-back);
}

.wacta-widget-wrap.is-closing {
  display: block;
  animation: wacta-slide-down 0.25s var(--wacta-ease-out-expo) forwards;
  pointer-events: none;
}

@keyframes wacta-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wacta-slide-down {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(16px) scale(0.96); }
}

/* ═══════════════════════════════════════
   WIDGET CARD
   ═══════════════════════════════════════ */
.wacta-widget-card {
  width: 100%;
  border-radius: 0.9em;
  overflow: hidden;
  background: var(--wacta-surface-solid);
  box-shadow:
    0 0.9em 2.4em rgba(0, 0, 0, 0.15),
    0 0.3em 0.8em rgba(0, 0, 0, 0.06);
}

/* ── Header ── */
.wacta-widget-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7em;
  padding: 0.9em 1em;
  color: #ffffff;
  background: #075e54;
}

.wacta-widget-card-header--popup {
  background: linear-gradient(135deg, #00a3c4, #183b56);
  padding: 1.1em 1.2em;
}

.wacta-widget-head {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-width: 0;
}

.wacta-avatar {
  width: 2.5em;
  height: 2.5em;
  min-width: 2.5em;
  min-height: 2.5em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.wacta-avatar svg {
  display: block;
  width: 1.2em;
  height: 1.2em;
  min-width: 1.2em;
  min-height: 1.2em;
}

.wacta-widget-head strong {
  display: block;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.2;
}

.wacta-widget-head div > span {
  display: block;
  margin-top: 0.15em;
  font-size: 0.8em;
  line-height: 1.3;
  opacity: 0.85;
}

.wacta-close-dot {
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.1em;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wacta-close-dot:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── Card Body ── */
.wacta-widget-card-body {
  padding: 0.9em;
  display: grid;
  gap: 0.7em;
}

.wacta-widget-card-body--chat {
  background-color: #e5ddd5;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(10, 45, 49, 0.018) 0 8px,
      transparent 8px 16px
    );
  padding: 0.9em;
}

.wacta-widget-card-body--form {
  background-color: #efeae2;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(10, 45, 49, 0.018) 0 8px,
      transparent 8px 16px
    );
}

/* ═══════════════════════════════════════
   CHAT BUBBLES & THREAD
   ═══════════════════════════════════════ */
.wacta-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.55em;
  max-height: 18em;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 140, 126, 0.28) transparent;
  padding-right: 0.3em;
}

.wacta-chat-thread::-webkit-scrollbar {
  width: 4px;
}

.wacta-chat-thread::-webkit-scrollbar-thumb {
  background: rgba(18, 140, 126, 0.28);
  border-radius: 999px;
}

@keyframes wacta-chat-bubble-in {
  from { opacity: 0; transform: translateY(0.5em) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.wacta-chat-thread > .wacta-chat-bubble {
  animation: wacta-chat-bubble-in 0.25s var(--wacta-ease-out-back);
}

.wacta-chat-bubble {
  max-width: 82%;
  padding: 0.5em 0.75em;
  border-radius: 0.55em;
  font-size: 0.92em;
  line-height: 1.4;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
  word-break: break-word;
}

.wacta-chat-bubble--agent {
  align-self: flex-start;
  background: #ffffff;
  border-top-left-radius: 0;
  color: #111b21;
}

.wacta-chat-bubble--user {
  align-self: flex-end;
  background: #dcf8c6;
  border-top-right-radius: 0;
  color: #111b21;
}

.wacta-chat-time {
  display: block;
  margin-top: 0.25em;
  font-size: 0.65em;
  /* WCAG AA: #5b5b5b sobre #ffffff = 7.0:1 (era #7d7d7d = 4.48:1, fallaba en texto pequeño) */
  color: #5b5b5b;
  text-align: right;
}

/* ── Typing indicator ── */
.wacta-chat-typing {
  align-self: flex-start;
  max-width: 82%;
  padding: 0.5em 0.75em;
  border-radius: 0.55em;
  border-top-left-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 2.2em;
  background: #ffffff;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

/* hidden attribute (necesario porque display: inline-flex sobrescribiría [hidden] del UA) */
.wacta-chat-typing[hidden] {
  display: none !important;
}

.wacta-chat-typing span {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: #9aa0a6;
  opacity: 0.45;
  animation: wacta-typing-bounce 1.2s ease-in-out infinite;
}

.wacta-chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.wacta-chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes wacta-typing-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-0.3em);
    opacity: 0.95;
  }
}

/* ── Composer ── */
.wacta-chat-composer {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.6em;
  background: #f0f0f0;
  margin: 0 -0.9em -0.9em;
}

.wacta-chat-input {
  flex: 1;
  height: 2.2em;
  border-radius: 999px;
  background: #ffffff;
  border: 0;
  padding: 0 0.9em;
  font: inherit;
  font-size: 0.88em;
  color: #111b21;
  outline: none;
}

.wacta-chat-input::placeholder {
  /* WCAG AA: #6b7780 sobre #ffffff = 4.69:1 (era #8696a0 = 4.04:1) */
  color: #6b7780;
}

.wacta-chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wacta-chat-send {
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.wacta-chat-send svg {
  fill: #667781;
  width: 1.2em;
  height: 1.2em;
}

/* ── Credit bar ── */
.wacta-widget-credit {
  padding: 0.45em 0.75em 0.35em;
  background: #f7f7f7;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  /* WCAG AA: #5a6c75 sobre #f7f7f7 = 4.84:1 (era #667781 = 4.46:1) */
  color: #5a6c75;
  font-size: 0.66em;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════
   FORM
   ═══════════════════════════════════════ */
.wacta-form {
  display: grid;
  gap: 0.55em;
}

.wacta-field,
.wacta-area {
  font-size: 0.92em;
  border: 1px solid #d8e0e5;
  border-radius: 0.6em;
  background: #ffffff;
  color: #0a2d31;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wacta-field::placeholder,
.wacta-area::placeholder {
  color: rgba(10, 45, 49, 0.42);
}

.wacta-field:focus,
.wacta-area:focus {
  border-color: rgba(18, 140, 126, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.wacta-field:hover,
.wacta-area:hover {
  border-color: rgba(18, 140, 126, 0.28);
}

.wacta-field {
  min-height: 2.7em;
  padding: 0.7em 0.8em;
}

.wacta-area {
  min-height: 4.2em;
  padding: 0.7em 0.8em;
  resize: vertical;
}

.wacta-action {
  min-height: 2.8em;
  border: 0;
  border-radius: 0.7em;
  display: grid;
  place-items: center;
  font: inherit;
  font-weight: 800;
  font-size: 0.95em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--wacta-green), var(--wacta-green-deep));
  box-shadow: 0 0.6em 1.2em rgba(18, 140, 126, 0.22);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wacta-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.8em 1.6em rgba(18, 140, 126, 0.28);
}

/* ═══════════════════════════════════════
   POPUP CARD
   ═══════════════════════════════════════ */
.wacta-popup-card {
  overflow: hidden;
  border-radius: 1.1em;
  background: var(--wacta-surface-solid);
  box-shadow:
    0 1.2em 3em rgba(15, 23, 42, 0.22),
    0 0.3em 0.8em rgba(15, 23, 42, 0.08);
}

.wacta-popup-card .wacta-action {
  background: linear-gradient(135deg, #00a3c4, #183b56);
  box-shadow: 0 0.7em 1.4em rgba(24, 59, 86, 0.22);
}

.wacta-popup-card .wacta-action:hover {
  box-shadow: 0 0.9em 1.8em rgba(24, 59, 86, 0.28);
}

.wacta-popup-body {
  padding: 1em;
  display: grid;
  gap: 0.7em;
  background: #f0f9fa;
}

/* Popup layer (modal overlay) */
.wacta-popup-layer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 14px;
}

.wacta-popup-layer.is-open {
  display: flex;
  animation: wacta-fade 0.3s var(--wacta-ease-out-expo);
}

.wacta-popup-layer > .wacta-popup-card {
  width: min(400px, 100%);
  animation: wacta-pop 0.4s var(--wacta-ease-out-back);
}

/* ═══════════════════════════════════════
   REDIRECT CHIP
   ═══════════════════════════════════════ */
.wacta-redirect-chip {
  padding: 0.7em 1.1em;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.92em;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--wacta-green), var(--wacta-green-deep));
  box-shadow:
    0 0.7em 1.4em rgba(37, 211, 102, 0.32),
    0 0.2em 0.5em rgba(7, 24, 30, 0.08);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wacta-redirect-chip:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0.9em 1.8em rgba(37, 211, 102, 0.4),
    0 0.3em 0.6em rgba(7, 24, 30, 0.1);
}

.wacta-redirect-chip svg {
  width: 1em;
  height: 1em;
}

/* ═══════════════════════════════════════
   EMERGENT WINDOW
   ═══════════════════════════════════════ */
.wacta-emergent-layer {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 14px;
}

.wacta-emergent-layer.is-open {
  display: flex;
  animation: wacta-fade 0.35s var(--wacta-ease-out-expo);
}

.wacta-emergent-layer > .wacta-emergent-card {
  width: min(640px, 100%);
  animation: wacta-pop 0.45s var(--wacta-ease-out-back);
}

.wacta-emergent-layer > .wacta-emergent-card-compact {
  width: min(340px, 100%);
}

.wacta-emergent-card {
  position: relative;
  z-index: 1;
  border-radius: 1.1em;
  overflow: hidden;
  background: var(--wacta-surface-solid);
  box-shadow:
    0 1.3em 3.5em rgba(15, 23, 42, 0.24),
    0 0.3em 0.8em rgba(15, 23, 42, 0.08);
}

.wacta-emergent-card-compact {
  display: block;
  max-width: 24em;
}

.wacta-emergent-card-split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.wacta-emergent-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7em;
  padding: 0.9em 1em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--wacta-green-night), var(--wacta-green-deep));
}

.wacta-emergent-card-body {
  padding: 0.9em;
  display: grid;
  gap: 0.7em;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
}

.wacta-emergent-media {
  min-height: 15em;
  padding: 1.4em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.65em;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(150deg, var(--wacta-green) 0%, var(--wacta-green-deep) 48%, var(--wacta-green-night) 100%);
}

.wacta-emergent-media::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -20%;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.wacta-emergent-media::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 50%;
  height: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 70%);
  pointer-events: none;
}

.wacta-trigger-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.4em 0.7em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.75em;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 1;
}

.wacta-emergent-media h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 10ch;
  font-size: 1.9em;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.wacta-emergent-media p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 28ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88em;
  line-height: 1.5;
}

.wacta-emergent-media.wacta-is-light-bg { color: #1a1a1a; }
.wacta-emergent-media.wacta-is-light-bg p { color: rgba(0, 0, 0, 0.7); }
.wacta-emergent-media.wacta-is-light-bg .wacta-trigger-chip {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}
.wacta-emergent-card-split:has(.wacta-emergent-media.wacta-is-light-bg) > .wacta-close-dot {
  background: rgba(0, 0, 0, 0.15) !important;
  color: #1a1a1a !important;
}

.wacta-emergent-media.wacta-is-dark-bg h3,
.wacta-emergent-media.wacta-is-dark-bg p { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }

/* ═══════════════════════════════════════
   SHARED ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes wacta-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wacta-pop {
  from { opacity: 0; transform: translateY(20px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════
   FOCUS STYLES
   ═══════════════════════════════════════ */
.wacta-root button:focus-visible,
.wacta-root input:focus-visible,
.wacta-root textarea:focus-visible {
  outline: 2px solid var(--wacta-focus);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════
   SVG DEFINITIONS (hidden sprite)
   ═══════════════════════════════════════ */
.wacta-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .wacta-launcher-wrap {
    bottom: 28px;
  }

  .wacta-launcher-wrap.is-left {
    left: 16px;
  }

  .wacta-launcher-wrap.is-right {
    right: 16px;
  }

  .wacta-widget-wrap {
    bottom: 28px;
    width: calc(100% - 32px);
  }

  .wacta-widget-wrap.is-left {
    left: 16px;
  }

  .wacta-widget-wrap.is-right {
    right: 16px;
  }
}

@media (max-width: 640px) {
  .wacta-emergent-card-split {
    grid-template-columns: 1fr;
  }

  .wacta-emergent-media {
    min-height: 9em;
    padding: 1.1em;
  }

  .wacta-emergent-media h3 {
    font-size: 1.5em;
  }

  .wacta-emergent-layer > .wacta-emergent-card {
    width: 100%;
  }

  .wacta-popup-layer > .wacta-popup-card {
    width: 100%;
  }
}

/* ═══════════════════════════════════════
   BADGE (notification dot)
   ═══════════════════════════════════════ */
.wacta-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.7em;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: wacta-badge-in 0.4s var(--wacta-ease-out-back);
  pointer-events: none;
}

@keyframes wacta-badge-in {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ═══════════════════════════════════════
   WELCOME BUBBLE
   ═══════════════════════════════════════ */
.wacta-welcome-bubble {
  position: fixed;
  bottom: 88px;
  z-index: 92;
  max-width: 240px;
  padding: 0.65em 0.9em;
  border-radius: 0.7em;
  background: var(--wacta-surface-solid);
  color: #111b21;
  font-size: 0.88em;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5em;
  animation: wacta-welcome-in 0.4s var(--wacta-ease-out-back);
  pointer-events: auto;
}

.wacta-welcome-bubble.is-right {
  right: 24px;
}

.wacta-welcome-bubble.is-left {
  left: 24px;
}

.wacta-welcome-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--wacta-surface-solid);
  transform: rotate(45deg);
  box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.06);
}

.wacta-welcome-bubble.is-right::after {
  right: 20px;
}

.wacta-welcome-bubble.is-left::after {
  left: 20px;
}

.wacta-welcome-close {
  flex: 0 0 auto;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  display: grid;
  place-items: center;
  font-size: 0.85em;
  line-height: 1;
  color: #667781;
  cursor: pointer;
}

.wacta-welcome-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

@keyframes wacta-welcome-in {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════
   SCHEDULE INDICATOR
   ═══════════════════════════════════════ */
.wacta-schedule-bar {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.35em 1em;
  background: rgba(7, 94, 84, 0.08);
  font-size: 0.75em;
  color: #075e54;
}

.wacta-status-dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  flex: 0 0 auto;
}

.wacta-status-online {
  background: #25d366;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.25);
}

.wacta-status-offline {
  background: #9aa0a6;
}

.wacta-status-label {
  font-weight: 600;
}

/* ═══════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .wacta-launcher-wrap {
    animation: none;
  }

  .wacta-launcher-circle,
  .wacta-launcher-pill {
    animation: none;
  }

  .wacta-widget-wrap.is-open {
    animation: none;
  }

  .wacta-widget-wrap.is-closing {
    animation: none;
    display: none;
  }

  .wacta-chat-thread > .wacta-chat-bubble {
    animation: none;
  }

  .wacta-badge {
    animation: none;
  }

  .wacta-welcome-bubble {
    animation: none;
  }
}
