/* Asistente virtual — burbuja de chat flotante.
   Usa las variables de site.css (--ink, --paper, --celeste, --r-lg): no
   define paleta propia, para no desentonar entre light/dark ni entre
   páginas. Vive en su propio archivo, igual que el resto del sitio separa
   "banda de novedad" en su página: es un componente que se puede apagar
   sacando un <link> y un <script>, sin tocar nada más. */

.asistente-burbuja {
  position: fixed;
  right: clamp(16px, 4vw, 28px);
  bottom: clamp(16px, 4vw, 28px);
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  /* Ámbar de señalización: es el color que la marca ya usa para "prestá
     atención" (banda de novedades), y es el único que se ve fuerte tanto
     sobre el hero oscuro como sobre las secciones claras del sitio. */
  background: var(--ambar);
  color: var(--ink-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(217, 130, 43, .45);
  transition: transform .18s var(--ease, ease), box-shadow .18s var(--ease, ease);
}
.asistente-burbuja:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(217, 130, 43, .55); }
.asistente-burbuja svg { width: 26px; height: 26px; }
.asistente-burbuja[data-abierto="true"] svg.icono-chat { display: none; }
.asistente-burbuja[data-abierto="false"] svg.icono-cerrar { display: none; }

.asistente-panel {
  position: fixed;
  right: clamp(12px, 4vw, 28px);
  bottom: calc(clamp(16px, 4vw, 28px) + 70px);
  z-index: 60;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 140px));
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-lg, 10px);
  box-shadow: 0 20px 56px rgba(11, 14, 19, .32);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .16s var(--ease, ease), transform .16s var(--ease, ease);
}
.asistente-panel[data-abierto="true"] {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.asistente-panel__header {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.asistente-panel__header strong { font-family: var(--display); font-size: 15px; }
.asistente-panel__header span { display: block; font-size: 12px; opacity: .7; }

.asistente-panel__cuerpo {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper-2);
}

.asistente-msg {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.asistente-msg--bot {
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-bottom-left-radius: 3px;
}
.asistente-msg--user {
  align-self: flex-end;
  background: var(--celeste-ink, var(--celeste));
  color: #fff;
  border-bottom-right-radius: 3px;
}
.asistente-msg--escribiendo { opacity: .6; font-style: italic; }

.asistente-form-derivar {
  align-self: stretch;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.asistente-form-derivar p { font-size: 13px; margin: 0 0 2px; color: var(--grafito); }
.asistente-form-derivar input {
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-light);
  background: var(--paper);
  color: var(--ink);
}
.asistente-form-derivar button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px;
  border-radius: 6px;
  border: none;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.asistente-form-derivar button:disabled { opacity: .5; cursor: default; }
.asistente-derivado-ok { font-size: 13px; color: var(--grafito); align-self: flex-start; }

.asistente-panel__pie {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line-light);
  background: var(--paper);
}
.asistente-panel__pie textarea {
  flex: 1;
  resize: none;
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-light);
  background: var(--paper-2);
  color: var(--ink);
  max-height: 80px;
}
.asistente-panel__pie button {
  border: none;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  width: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.asistente-panel__pie button:disabled { opacity: .4; cursor: default; }

@media (max-width: 420px) {
  .asistente-panel { bottom: calc(16px + 68px); height: min(72vh, 560px); }
}
