/* Widget de chat del Asistente Web. Estilos con prefijo aw- para no chocar. */
.aw-root {
  --aw-color: #2b6cb0;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aw-launcher {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--aw-color);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.aw-launcher:hover { filter: brightness(1.05); }

.aw-panel[hidden] { display: none; }
.aw-panel {
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.aw-header {
  background: var(--aw-color);
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.aw-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.aw-mensajes {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aw-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.aw-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e5ea;
  color: #1a202c;
  border-bottom-left-radius: 4px;
}
.aw-user {
  align-self: flex-end;
  background: var(--aw-color);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.aw-cargando { opacity: 0.7; }
.aw-cargando::after {
  content: '●●●';
  display: inline-block;
  animation: aw-puntos 1.2s steps(4, end) infinite;
  letter-spacing: 2px;
}
/* Oculta el texto "…" original y deja solo los puntos animados */
.aw-cargando { font-size: 0; }
.aw-cargando::after { font-size: 14px; }

@keyframes aw-puntos {
  0%   { clip-path: inset(0 67% 0 0); }
  33%  { clip-path: inset(0 34% 0 0); }
  66%  { clip-path: inset(0 1%  0 0); }
  100% { clip-path: inset(0 67% 0 0); }
}

.aw-form {
  display: flex;
  border-top: 1px solid #e2e5ea;
  background: #fff;
}
.aw-input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  background: transparent;
}
.aw-enviar {
  border: none;
  background: none;
  color: var(--aw-color);
  font-size: 18px;
  padding: 0 16px;
  cursor: pointer;
}
.aw-enviar:hover { filter: brightness(0.9); }

/* Barra inferior con el botón de técnico */
.aw-footer {
  background: #fff;
  border-top: 1px solid #f0f0f0;
  padding: 6px 14px;
  text-align: center;
}

.aw-btn-tecnico {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.aw-btn-tecnico:hover {
  color: var(--aw-color);
  background: #f0f4ff;
}

/* Bloque de contacto (botones y formulario de lead) */
.aw-contacto {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f7f8fa;
}

.aw-btn-contacto {
  display: block;
  text-align: center;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--aw-color);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.aw-btn-contacto:hover { filter: brightness(1.08); }

.aw-lead-titulo {
  font-size: 13px;
  color: #444;
  margin: 0;
}

.aw-lead-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dde1e7;
  border-radius: 7px;
  font-size: 13px;
  box-sizing: border-box;
  background: #fff;
  outline: none;
}
.aw-lead-input:focus { border-color: var(--aw-color); }

.aw-btn-lead { width: 100%; }

.aw-lead-ok {
  font-size: 13px;
  color: #2d7a2d;
  text-align: center;
  margin: 4px 0;
}

.aw-lead-error {
  font-size: 12px;
  color: #c0392b;
  margin: 2px 0 0;
}
