/* Chat con Legito (usa la paleta y tipografías de styles.css) */
.chat-abrir {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  font: inherit; font-size: 16px; font-weight: bold; cursor: pointer;
  background: var(--amarillo); color: var(--negro);
  border: 2px solid var(--negro); border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  transition: background .15s;
}
.chat-abrir:hover { background: #e6d600; }
.chat-abrir:focus-visible { outline: 3px solid var(--rojo); outline-offset: 2px; }

.chat-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 95; padding: 0;
  display: flex; flex-direction: column;
  width: min(380px, calc(100% - 32px));
  height: min(560px, calc(100dvh - 32px));
  background: #fff; color: var(--negro);
  border: 1px solid var(--borde); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  overflow: hidden;
}
.chat-encabezado {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--negro); color: #fff;
  padding: 8px 8px 8px 16px;
}
.chat-encabezado h2 { font-size: 18px; }
.chat-encabezado p { font-size: 13px; color: rgba(255,255,255,.8); }
.chat-cerrar {
  min-width: 44px; min-height: 44px;
  background: none; border: 0; color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer;
}
.chat-cerrar:focus-visible { outline: 3px solid var(--amarillo); outline-offset: -3px; }

.chat-mensajes {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; background: var(--gris-claro);
}
.chat-burbuja {
  max-width: 85%; padding: 10px 14px; border-radius: 12px;
  font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-burbuja.legito { align-self: flex-start; background: #fff; border: 1px solid var(--borde); border-bottom-left-radius: 4px; }
.chat-burbuja.cliente { align-self: flex-end; background: var(--amarillo); border-bottom-right-radius: 4px; }
.chat-burbuja.error { border-left: 4px solid var(--rojo); }
.chat-burbuja.escribiendo { color: var(--gris); font-style: italic; }

.chat-sugerencias { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chat-sugerencias button {
  min-height: 44px; padding: 8px 14px; text-align: left;
  font: inherit; font-size: 15px; cursor: pointer;
  background: #fff; color: var(--negro);
  border: 2px solid var(--negro); border-radius: 999px;
}
.chat-sugerencias button:hover { background: var(--amarillo); }

.chat-form {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--borde); background: #fff;
}
.chat-form input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 16px;
  border: 1px solid var(--borde); border-radius: 6px;
}
.chat-form input:focus { outline: 2px solid var(--negro); outline-offset: 1px; }
.chat-form .btn { min-height: 48px; border: 0; cursor: pointer; font-family: inherit; padding: 12px 16px; }
.chat-form .btn:disabled { opacity: .6; cursor: default; }

/* Celular: el chat ocupa toda la pantalla */
@media (max-width: 479px) {
  .chat-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
}
