/**
 * BLPbot — Asistente Virtual BLP Chile
 * Interfaz alineada a la identidad de la marca: azul corporativo, verde de
 * acento y las tipografías Barlow del sitio, para que el asistente se lea como
 * parte de la web y no como una herramienta pegada encima.
 */

:root {
  --blpbot-navy: #002d92;
  --blpbot-navy-deep: #001233;
  --blpbot-navy-mid: #001f66;
  --blpbot-green: #4faf4f;
  --blpbot-green-deep: #3d9440;
  --blpbot-green-soft: #e8f5e9;
  --blpbot-ink: #101a2e;
  --blpbot-muted: #64748b;
  --blpbot-paper: #f4f7fb;
  --blpbot-line: #e2e8f2;
  --blpbot-font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --blpbot-font-head: "Barlow Condensed", "Barlow", -apple-system, sans-serif;
  --blpbot-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════
   BOTÓN FLOTANTE
   ══════════════════════════════════════════ */
.blpbot-button {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 64px;
  height: 64px;
  background: linear-gradient(145deg, var(--blpbot-navy) 0%, var(--blpbot-navy-deep) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  z-index: 9998;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(79, 175, 79, 0.35),
    0 10px 28px rgba(0, 18, 51, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.32s var(--blpbot-ease), box-shadow 0.32s var(--blpbot-ease);
}

/* Halo verde que respira: señala que el asistente está disponible. */
.blpbot-button::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--blpbot-green);
  opacity: 0;
  animation: blpbot-halo 3.4s var(--blpbot-ease) infinite;
  pointer-events: none;
}

@keyframes blpbot-halo {
  0% { transform: scale(0.94); opacity: 0.5; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { opacity: 0; }
}

.blpbot-button:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(79, 175, 79, 0.6),
    0 16px 34px rgba(0, 18, 51, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.blpbot-button:focus-visible {
  outline: 3px solid var(--blpbot-green);
  outline-offset: 3px;
}

/* Abierto: se apaga el halo y el botón se repliega un poco. */
.blpbot-button.active::after { display: none; }
.blpbot-button.active { transform: scale(0.92); }

.blpbot-button-logo {
  width: 40px;
  height: auto;
  display: block;
  transition: transform 0.32s var(--blpbot-ease);
}

.blpbot-button svg {
  width: 26px;
  height: 26px;
  color: #fff;
}

.blpbot-button:hover .blpbot-button-logo { transform: scale(1.06); }

.blpbot-notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--blpbot-green);
  color: #fff;
  border-radius: 11px;
  font-family: var(--blpbot-font);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 18, 51, 0.3);
}

/* ══════════════════════════════════════════
   ETIQUETA DE AYUDA
   ══════════════════════════════════════════ */
.blpbot-help-message {
  position: fixed;
  bottom: 42px;
  right: 104px;
  background: #fff;
  color: var(--blpbot-ink);
  padding: 10px 18px;
  border-radius: 30px;
  font-family: var(--blpbot-font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 9997;
  border: 1px solid var(--blpbot-line);
  box-shadow: 0 8px 22px rgba(0, 18, 51, 0.14);
  transition: opacity 0.3s var(--blpbot-ease), transform 0.3s var(--blpbot-ease);
}

.blpbot-help-message::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid var(--blpbot-line);
  border-top: 1px solid var(--blpbot-line);
  transform: translateY(-50%) rotate(45deg);
}

/* ══════════════════════════════════════════
   VENTANA DEL CHAT
   ══════════════════════════════════════════ */
/* Fondo atenuado. La ventana pasó de estar anclada abajo a la derecha a ir
   centrada, y sin este velo compite visualmente con la página que queda
   detrás — que es justo lo que dificulta seguir la conversación. */
.blpbot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 32, 0.55);
  z-index: 9998;
  animation: blpbot-velo 0.3s var(--blpbot-ease);
}

@keyframes blpbot-velo {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* El centrado va con `inset: 0; margin: auto` y NO con translate(-50%,-50%):
   así `transform` queda libre para la animación de entrada, que si no
   pisaría el centrado y dejaría la ventana descuadrada. Requiere que ancho
   y alto sean definidos, que es el caso. */
.blpbot-container {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(780px, 94vw);
  height: min(760px, 88vh);
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  z-index: 9999;
  flex-direction: column;
  border: 1px solid var(--blpbot-line);
  box-shadow:
    0 2px 6px rgba(0, 18, 51, 0.06),
    0 30px 80px rgba(0, 18, 51, 0.32);
  font-family: var(--blpbot-font);
  animation: blpbot-entrada 0.4s var(--blpbot-ease);
  transform-origin: center;
}

@keyframes blpbot-entrada {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Encabezado ── */
.blpbot-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px;
  background: linear-gradient(135deg, var(--blpbot-navy) 0%, var(--blpbot-navy-deep) 100%);
  flex-shrink: 0;
}

/* Filo verde superior: el mismo acento que usa el header del sitio. */
.blpbot-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blpbot-green) 0%, rgba(79, 175, 79, 0) 78%);
}

.blpbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.blpbot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  overflow: hidden;
  padding: 5px;
}

.blpbot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.blpbot-header-text { min-width: 0; }

.blpbot-title {
  font-family: var(--blpbot-font-head);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blpbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 1px;
}

.blpbot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blpbot-green);
  box-shadow: 0 0 0 0 rgba(79, 175, 79, 0.7);
  animation: blpbot-latido 2.4s infinite;
  flex-shrink: 0;
}

@keyframes blpbot-latido {
  0% { box-shadow: 0 0 0 0 rgba(79, 175, 79, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(79, 175, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 175, 79, 0); }
}

.blpbot-header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.blpbot-new-chat-btn,
.blpbot-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.22s var(--blpbot-ease), color 0.22s var(--blpbot-ease);
}

.blpbot-new-chat-btn:hover,
.blpbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.blpbot-new-chat-btn:focus-visible,
.blpbot-close-btn:focus-visible {
  outline: 2px solid var(--blpbot-green);
  outline-offset: 1px;
}

/* ══════════════════════════════════════════
   FORMULARIO DE BIENVENIDA
   ══════════════════════════════════════════ */
.blpbot-user-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff 0%, var(--blpbot-paper) 100%);
}

.blpbot-form-content { padding: 26px 28px 30px; }

.blpbot-form-header { text-align: center; margin-bottom: 24px; }

.blpbot-form-logo {
  width: 128px;
  height: auto;
  margin: 0 auto 18px;
  display: block;
}

.blpbot-form-header h3 {
  font-family: var(--blpbot-font-head);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--blpbot-navy-mid);
  margin: 0 0 8px;
  line-height: 1.15;
}

.blpbot-form-header p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--blpbot-muted);
  margin: 0;
}

.blpbot-form-group { margin-bottom: 15px; }

.blpbot-form-group label {
  display: block;
  font-family: var(--blpbot-font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blpbot-navy-mid);
  margin-bottom: 7px;
}

.blpbot-form-group input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--blpbot-line);
  border-radius: 11px;
  font-family: var(--blpbot-font);
  font-size: 15px;
  color: var(--blpbot-ink);
  background: #fff;
  transition: border-color 0.22s var(--blpbot-ease), box-shadow 0.22s var(--blpbot-ease);
}

.blpbot-form-group input::placeholder { color: #a8b4c6; }

.blpbot-form-group input:focus {
  outline: none;
  border-color: var(--blpbot-green);
  box-shadow: 0 0 0 4px rgba(79, 175, 79, 0.15);
}

.blpbot-form-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px 20px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blpbot-navy) 0%, var(--blpbot-navy-mid) 100%);
  color: #fff;
  font-family: var(--blpbot-font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 45, 146, 0.28);
  transition: transform 0.22s var(--blpbot-ease), box-shadow 0.22s var(--blpbot-ease);
}

.blpbot-form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 45, 146, 0.36);
}

.blpbot-form-submit:focus-visible {
  outline: 3px solid var(--blpbot-green);
  outline-offset: 2px;
}

.blpbot-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ══════════════════════════════════════════
   MENSAJES
   ══════════════════════════════════════════ */
.blpbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  background: var(--blpbot-paper);
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.blpbot-messages::-webkit-scrollbar { width: 6px; }
.blpbot-messages::-webkit-scrollbar-track { background: transparent; }
.blpbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e5;
  border-radius: 3px;
}
.blpbot-messages::-webkit-scrollbar-thumb:hover { background: #aebbd0; }

/* Cada fila se encoge al tamaño de su burbuja y se ancla a su lado:
   el asistente a la izquierda, el usuario a la derecha. */
/* El tope en píxeles importa ahora que la ventana es ancha: al 87% de 780px
   la línea pasaría de 100 caracteres y se vuelve incómoda de seguir. El
   límite deja la medida en una longitud legible sin desperdiciar el ancho. */
.blpbot-message {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  max-width: min(87%, 580px);
  animation: blpbot-mensaje 0.34s var(--blpbot-ease);
}

.blpbot-message-assistant { align-self: flex-start; }

@keyframes blpbot-mensaje {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.blpbot-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--blpbot-navy) 0%, var(--blpbot-navy-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  overflow: hidden;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 18, 51, 0.18);
}

.blpbot-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.blpbot-message-avatar svg { width: 17px; height: 17px; }

.blpbot-message-content {
  padding: 11px 15px;
  font-size: 14.8px;
  line-height: 1.6;
  border-radius: 15px;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.blpbot-message-assistant .blpbot-message-content {
  background: #fff;
  color: var(--blpbot-ink);
  border: 1px solid var(--blpbot-line);
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 18, 51, 0.05);
}

.blpbot-message-user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.blpbot-message-user .blpbot-message-content {
  background: linear-gradient(135deg, var(--blpbot-green) 0%, var(--blpbot-green-deep) 100%);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(61, 148, 64, 0.28);
}

.blpbot-message-content p { margin: 0 0 8px; }
.blpbot-message-content p:last-child { margin-bottom: 0; }

/* ─── Tarjeta de producto ───
   Se muestra colapsada (foto chica + nombre). Al tocar la cabecera se
   despliega la foto grande, la descripción y las características. */
.blpbot-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.blpbot-product {
  border: 1px solid var(--blpbot-line);
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.25s var(--blpbot-ease), box-shadow 0.25s var(--blpbot-ease);
}

.blpbot-product.is-open,
.blpbot-product:hover {
  border-color: var(--blpbot-green);
  box-shadow: 0 6px 18px rgba(61, 148, 64, 0.16);
}

.blpbot-product-head {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px;
  border: 0;
  background: var(--blpbot-paper);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.blpbot-product-img {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 9px;
  background: var(--blpbot-line);
}

.blpbot-product-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.blpbot-product-badge {
  font-family: var(--blpbot-font-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blpbot-green-deep);
}

.blpbot-product-name {
  font-family: var(--blpbot-font-head);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--blpbot-navy-mid);
}

.blpbot-product-toggle {
  font-size: 12px;
  color: var(--blpbot-muted);
}

.blpbot-product-toggle::after {
  content: " ▾";
  display: inline-block;
  transition: transform 0.25s var(--blpbot-ease);
}

.blpbot-product.is-open .blpbot-product-toggle::after { transform: rotate(180deg); }

/* Colapsada: el cuerpo no ocupa espacio ni recibe foco */
.blpbot-product-body {
  display: none;
  padding: 0 11px 11px;
}

.blpbot-product.is-open .blpbot-product-body { display: block; }

.blpbot-product-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  margin: 11px 0;
  background: var(--blpbot-line);
}

.blpbot-product-desc {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--blpbot-muted);
}

.blpbot-specs {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 9px;
  overflow: hidden;
}

.blpbot-spec {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  background: var(--blpbot-paper);
  font-size: 13px;
}

.blpbot-spec-label { color: var(--blpbot-muted); }

.blpbot-spec-value {
  font-weight: 600;
  color: var(--blpbot-ink);
  text-align: right;
}

.blpbot-product-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--blpbot-navy) 0%, var(--blpbot-navy-mid) 100%);
  color: #fff;
  font-family: var(--blpbot-font-head);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s var(--blpbot-ease), box-shadow 0.2s var(--blpbot-ease);
}

.blpbot-product-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 45, 146, 0.32);
}

.blpbot-product-link svg { width: 15px; height: 15px; }

.blpbot-product-head:focus-visible,
.blpbot-product-link:focus-visible {
  outline: 2px solid var(--blpbot-green);
  outline-offset: 2px;
}
.blpbot-message-content strong { font-weight: 700; }

.blpbot-message-assistant .blpbot-message-content a {
  color: var(--blpbot-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* El botón de la ficha va sobre fondo azul: gana a la regla de enlaces */
.blpbot-message-assistant .blpbot-message-content a.blpbot-product-link {
  color: #fff;
  text-decoration: none;
}

.blpbot-message-content ul,
.blpbot-message-content ol { margin: 6px 0 6px 18px; padding: 0; }
.blpbot-message-content li { margin-bottom: 4px; list-style: inherit; }

.blpbot-product-image {
  max-width: 100%;
  border-radius: 10px;
  margin-top: 9px;
  display: block;
}

/* ── Indicador de escritura ── */
.blpbot-typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 2px;
}

.blpbot-typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blpbot-green);
  animation: blpbot-escribiendo 1.3s infinite ease-in-out;
}

.blpbot-typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.blpbot-typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes blpbot-escribiendo {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ══════════════════════════════════════════
   BARRA DE ENTRADA
   ══════════════════════════════════════════ */
.blpbot-input-container {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 13px 14px;
  background: #fff;
  border-top: 1px solid var(--blpbot-line);
  flex-shrink: 0;
}

.blpbot-input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--blpbot-line);
  border-radius: 22px;
  font-family: var(--blpbot-font);
  font-size: 14.8px;
  line-height: 1.45;
  color: var(--blpbot-ink);
  background: var(--blpbot-paper);
  resize: none;
  max-height: 108px;
  overflow-y: auto;
  transition: border-color 0.22s var(--blpbot-ease), box-shadow 0.22s var(--blpbot-ease), background 0.22s var(--blpbot-ease);
}

.blpbot-input::placeholder { color: #9aa8bd; }

.blpbot-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--blpbot-green);
  box-shadow: 0 0 0 4px rgba(79, 175, 79, 0.14);
}

.blpbot-voice-btn,
.blpbot-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.22s var(--blpbot-ease), background 0.22s var(--blpbot-ease), box-shadow 0.22s var(--blpbot-ease);
}

.blpbot-voice-btn {
  background: var(--blpbot-paper);
  border: 1.5px solid var(--blpbot-line);
  color: var(--blpbot-muted);
}

.blpbot-voice-btn:hover {
  background: var(--blpbot-green-soft);
  border-color: var(--blpbot-green);
  color: var(--blpbot-green-deep);
}

.blpbot-voice-btn.recording {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
  animation: blpbot-latido-rec 1.4s infinite;
}

@keyframes blpbot-latido-rec {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.blpbot-send-btn {
  background: linear-gradient(135deg, var(--blpbot-green) 0%, var(--blpbot-green-deep) 100%);
  color: #fff;
  box-shadow: 0 5px 15px rgba(61, 148, 64, 0.32);
}

.blpbot-send-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(61, 148, 64, 0.42);
}

.blpbot-send-btn:active { transform: scale(0.94); }

.blpbot-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.blpbot-voice-btn:focus-visible,
.blpbot-send-btn:focus-visible {
  outline: 3px solid var(--blpbot-navy);
  outline-offset: 2px;
}

/* ── Grabación ── */
.blpbot-recording-indicator {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  flex-shrink: 0;
}

.blpbot-recording-animation { display: flex; align-items: center; }

.blpbot-recording-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  animation: blpbot-rec 1.2s infinite;
}

@keyframes blpbot-rec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.blpbot-recording-text {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #b91c1c;
}

.blpbot-stop-recording-btn {
  padding: 7px 15px;
  border: none;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-family: var(--blpbot-font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.22s var(--blpbot-ease);
}

.blpbot-stop-recording-btn:hover { background: #b91c1c; }

/* ── Pie ── */
.blpbot-footer {
  padding: 9px;
  text-align: center;
  background: #fff;
  border-top: 1px solid var(--blpbot-line);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: #94a3b8;
  flex-shrink: 0;
}

.blpbot-footer strong {
  color: var(--blpbot-navy);
  font-weight: 700;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
  .blpbot-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    inset: 0;
    margin: 0;
    border-radius: 0;
    border: none;
  }
  /* A pantalla completa la ventana ya tapa la página; el velo sobra. */
  .blpbot-overlay { display: none !important; }
  .blpbot-button { bottom: 18px; right: 18px; width: 58px; height: 58px; }
  .blpbot-button-logo { width: 36px; }
  .blpbot-help-message { display: none; }
  .blpbot-message { max-width: 92%; }
  .blpbot-form-content { padding: 22px 22px 26px; }
}

/* Las alturas reducidas ya las cubre `height: min(760px, 88vh)` del propio
   contenedor, así que la regla que había aquí para portátiles chicos
   (`calc(100vh - 150px)`, pensada para el anclaje inferior) sobra. */

@media (prefers-reduced-motion: reduce) {
  .blpbot-button::after,
  .blpbot-status-dot,
  .blpbot-recording-dot,
  .blpbot-voice-btn.recording { animation: none; }
  .blpbot-container,
  .blpbot-overlay,
  .blpbot-message { animation: none; }
  .blpbot-typing-indicator span { animation-duration: 2.4s; }
}


/* ══════════════════════════════════════════════════════════════════
   REDISEÑO 2026-08 — azul de marca al mando, verde para la acción
   ------------------------------------------------------------------
   Reparto aproximado 70/30: el azul ordena (cabecera, panel de entrada,
   títulos) y el verde marca lo accionable (botones, foco, burbuja del
   visitante, filete del asistente). Antes el verde competía con el azul
   en superficie y el conjunto se veía disparejo.
   La ventana crece a 920px porque las respuestas del asistente son
   largas, y la pantalla de entrada pasa a dos paneles: en una ventana
   ancha, un formulario de dos campos centrado dejaba medio widget vacío.
   Este bloque va al final a propósito: sobrescribe lo anterior sin
   tocarlo, así el diseño previo queda de referencia en el archivo.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --blpbot-blue: #0b2d6b;
  --blpbot-blue-deep: #061a42;
  --blpbot-green-dark: #3d9440;
  --blpbot-tint: #f5f8fc;
  --blpbot-edge: #e3e9f2;
}

/* ── Botón flotante: azul con anillo verde ── */
.blpbot-button {
  width: 62px;
  height: 62px;
  background: linear-gradient(145deg, var(--blpbot-blue) 0%, var(--blpbot-blue-deep) 100%);
  box-shadow: 0 10px 26px rgba(6, 26, 66, .34), 0 0 0 2px rgba(79, 175, 79, .5);
}
.blpbot-button:hover { box-shadow: 0 16px 34px rgba(6, 26, 66, .42), 0 0 0 3px rgba(79, 175, 79, .65); }

/* ── Ventana ── */
.blpbot-container {
  width: min(1080px, 96vw);
  height: min(860px, 92vh);
  border-radius: 20px;
  border: 1px solid var(--blpbot-edge);
  box-shadow: 0 2px 8px rgba(6, 26, 66, .07), 0 34px 90px rgba(6, 26, 66, .32);
}

/* ── Cabecera azul con filo verde ── */
.blpbot-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--blpbot-blue) 0%, var(--blpbot-blue-deep) 100%);
}
.blpbot-header::before { background: var(--blpbot-green); height: 3px; }
.blpbot-avatar { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.26); }
.blpbot-title {
  font-family: var(--blpbot-font-head);
  font-size: 1.16rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
}
.blpbot-status { color: rgba(255,255,255,.75); }
.blpbot-status-dot { background: var(--blpbot-green); box-shadow: 0 0 0 3px rgba(79,175,79,.28); }
.blpbot-new-chat-btn, .blpbot-close-btn {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: 10px;
}
.blpbot-new-chat-btn:hover, .blpbot-close-btn:hover { background: rgba(79,175,79,.85); border-color: transparent; }

/* ── Pantalla de entrada: dos paneles ── */
.blpbot-user-form { background: #fff; padding: 0; }
.blpbot-form-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100%;
}
/* Panel izquierdo: la parte azul del reparto. */
.blpbot-form-side {
  position: relative;
  background: linear-gradient(160deg, var(--blpbot-blue) 0%, var(--blpbot-blue-deep) 100%);
  color: #fff;
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.blpbot-form-side::after {
  content: '';
  position: absolute; top: 0; bottom: 0; right: 0; width: 3px;
  background: var(--blpbot-green);
}
.blpbot-form-logo { width: 132px; height: auto; margin: 0 0 22px; display: block; }
.blpbot-form-side h3 {
  font-family: var(--blpbot-font-head);
  font-size: 1.85rem; font-weight: 800; text-transform: uppercase;
  line-height: 1.1; margin: 0 0 .5rem; color: #fff;
}
.blpbot-form-side > p {
  font-size: .95rem; line-height: 1.6; color: rgba(255,255,255,.76); margin: 0 0 1.5rem;
}
.blpbot-form-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .85rem; }
.blpbot-form-list li { display: flex; align-items: flex-start; gap: .7rem; font-size: .88rem; line-height: 1.45; color: rgba(255,255,255,.9); }
.blpbot-form-list svg { flex-shrink: 0; width: 17px; height: 17px; color: var(--blpbot-green); margin-top: 1px; }

/* Panel derecho: el formulario, alineado y con aire. */
.blpbot-form-content {
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}
.blpbot-form-tag {
  display: inline-block; align-self: flex-start;
  background: rgba(79,175,79,.12); color: var(--blpbot-green-dark);
  font-family: var(--blpbot-font-head); font-size: .7rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: 4px; margin-bottom: .6rem;
}
.blpbot-form-title {
  font-family: var(--blpbot-font-head);
  font-size: 1.5rem; font-weight: 800; text-transform: uppercase;
  color: var(--blpbot-blue); margin: 0 0 1.3rem; line-height: 1.1;
}
.blpbot-form-group { margin-bottom: 1rem; }
.blpbot-form-group label { color: var(--blpbot-blue); }
.blpbot-form-group input {
  border: 1px solid var(--blpbot-edge);
  border-radius: 11px;
  background: var(--blpbot-tint);
  transition: border-color .2s var(--blpbot-ease), box-shadow .2s var(--blpbot-ease), background .2s var(--blpbot-ease);
}
.blpbot-form-group input:focus {
  background: #fff; border-color: var(--blpbot-green);
  box-shadow: 0 0 0 3px rgba(79,175,79,.16); outline: none;
}
.blpbot-form-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--blpbot-green) 0%, var(--blpbot-green-dark) 100%);
  border-radius: 11px;
  box-shadow: 0 8px 20px rgba(61,148,64,.28);
}
.blpbot-form-submit:hover { box-shadow: 0 12px 26px rgba(61,148,64,.4); }
.blpbot-form-nota { margin: .9rem 0 0; font-size: .76rem; color: var(--blpbot-muted); text-align: center; }

/* ── Conversación ── */
.blpbot-messages { background: var(--blpbot-tint); }
.blpbot-message:not(.blpbot-message-user) .blpbot-message-content {
  background: #fff;
  border: 1px solid var(--blpbot-edge);
  border-left: 3px solid var(--blpbot-green);
  color: var(--blpbot-ink);
  box-shadow: 0 2px 10px rgba(6,26,66,.06);
}
.blpbot-message-user .blpbot-message-content {
  background: linear-gradient(135deg, var(--blpbot-green) 0%, var(--blpbot-green-dark) 100%);
  border: none;
  box-shadow: 0 6px 18px rgba(61,148,64,.26);
}
.blpbot-message-content a { color: var(--blpbot-green-dark); font-weight: 600; }
.blpbot-message-user .blpbot-message-content a { color: #fff; }

/* ── Barra de escritura ── */
.blpbot-input-container { padding: 14px 16px; background: #fff; border-top: 1px solid var(--blpbot-edge); }
.blpbot-input {
  border: 1px solid var(--blpbot-edge); border-radius: 14px; background: var(--blpbot-tint);
  transition: border-color .2s var(--blpbot-ease), box-shadow .2s var(--blpbot-ease), background .2s var(--blpbot-ease);
}
.blpbot-input:focus { background: #fff; border-color: var(--blpbot-green); box-shadow: 0 0 0 3px rgba(79,175,79,.16); outline: none; }
.blpbot-send-btn {
  background: linear-gradient(135deg, var(--blpbot-green) 0%, var(--blpbot-green-dark) 100%);
  color: #fff; box-shadow: 0 6px 16px rgba(61,148,64,.3);
}
.blpbot-send-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(61,148,64,.4); }
.blpbot-voice-btn { border: 1px solid var(--blpbot-edge); background: var(--blpbot-tint); color: var(--blpbot-blue); border-radius: 12px; }
.blpbot-voice-btn:hover { background: var(--blpbot-green); color: #fff; border-color: var(--blpbot-green); }

.blpbot-button:focus-visible, .blpbot-send-btn:focus-visible,
.blpbot-close-btn:focus-visible, .blpbot-new-chat-btn:focus-visible,
.blpbot-form-submit:focus-visible { outline: 3px solid var(--blpbot-green); outline-offset: 2px; }

/* Bajo 720px los dos paneles se apilan y el panel azul se acorta: en un
   teléfono, media pantalla de presentación deja el formulario fuera de vista. */
@media (max-width: 720px) {
  .blpbot-form-split { grid-template-columns: 1fr; }
  .blpbot-form-side { padding: 22px 22px 20px; }
  .blpbot-form-side::after { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 3px; }
  .blpbot-form-logo { width: 104px; margin-bottom: 14px; }
  .blpbot-form-side h3 { font-size: 1.5rem; }
  .blpbot-form-list { display: none; }
  .blpbot-form-content { padding: 22px; }
}
@media (max-width: 768px) {
  .blpbot-container { width: 100%; height: 100%; border-radius: 0; border: none; }
  .blpbot-button { width: 58px; height: 58px; }
}
