/* ==========================================================================
   SOTREX · Botón flotante de WhatsApp
   Colores y forma ORIGINALES del widget de WhatsApp (Xobito): verde
   #47B772, texto blanco, fondo de chat #EFEAE2. No se cambian por los
   colores de la marca SOTREX: la gente reconoce WhatsApp por su verde.
   Solo la tipografía se hereda del sitio.
   ========================================================================== */

.sx-wa {
  --wa-green: #47B772;
  --wa-green-hover: #3FA466;
  --wa-text: #FFFFFF;
  --wa-chat-bg: #EFEAE2;
  --wa-bubble: #FFFFFF;
  --wa-ink: #111111;
  --wa-muted: #8A8F98;

  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--body, "Gantari", -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}

/* Fase 0: se muestra también en móvil (es la acción principal y no hay barra fija inferior).
   Se quitó la regla que lo ocultaba por debajo de 768 px. */

/* ---------- Botón redondo ---------- */
.sx-wa__toggle {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--wa-green);
  color: var(--wa-text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  cursor: pointer;
  text-decoration: none;
}
.sx-wa__toggle:hover { background: var(--wa-green-hover); }
.sx-wa__toggle .sx-wa__icon { width: 32px; height: 32px; }
.sx-wa__icon { flex: none; }

.sx-wa__toggle:focus-visible,
.sx-wa__close:focus-visible,
.sx-wa__cta:focus-visible,
.sx-wa__alt a:focus-visible {
  outline: 3px solid #26272C;
  outline-offset: 3px;
}

/* ---------- Panel ---------- */
.sx-wa__panel {
  width: 300px;
  max-width: calc(100vw - 48px);
  margin-bottom: 14px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--wa-bubble);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .16);
}
.sx-wa__panel[hidden] { display: none; }

.sx-wa__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--wa-green);
  color: var(--wa-text);
}
.sx-wa__avatar {
  flex: none;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
  font-weight: 700;
  font-size: 17px;
}
.sx-wa__who { flex: 1; min-width: 0; }
.sx-wa__team { margin: 0; font-weight: 700; font-size: 15px; }
.sx-wa__hours { margin: 1px 0 0; font-size: 12px; opacity: .85; }

.sx-wa__close {
  flex: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: var(--wa-text);
  cursor: pointer;
}
.sx-wa__close svg { width: 14px; height: 14px; }

.sx-wa__body { padding: 16px; background: var(--wa-chat-bg); }

.sx-wa__greeting {
  max-width: 88%;
  margin: 0;
  padding: 11px 14px 9px;
  border-radius: 4px 14px 14px 14px;
  background: var(--wa-bubble);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
  font-size: 14px;
  line-height: 1.5;
  color: var(--wa-ink);
}

.sx-wa__cta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 999px;
  background: var(--wa-green);
  color: var(--wa-text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}
.sx-wa__cta:hover { background: var(--wa-green-hover); }
.sx-wa__cta .sx-wa__icon { width: 17px; height: 17px; }

.sx-wa__alt {
  margin: 14px 0 0;
  font-size: 13px;
  color: #3B4A54;
  text-align: center;
}
.sx-wa__alt a { color: #075E54; font-weight: 700; }
