/* ==========================================================================
   Asistente del sitio
   ========================================================================== */

.asis-boton {
  position: fixed;
  right: clamp(1rem, 2.5vw, 1.8rem);
  bottom: calc(clamp(1rem, 2.5vw, 1.8rem) + 66px);
  z-index: 90;
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--verde);
  color: var(--paper);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
  transition: transform .2s ease;
}

.asis-boton svg { width: 27px; height: 27px; }
.asis-boton:hover { transform: scale(1.06); }

.asis-panel {
  position: fixed;
  right: clamp(1rem, 2.5vw, 1.8rem);
  bottom: calc(clamp(1rem, 2.5vw, 1.8rem) + 130px);
  z-index: 95;
  width: min(370px, calc(100vw - 2rem));
  max-height: min(600px, calc(100vh - 190px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}

.asis-panel[hidden] { display: none; }

.asis-cabeza {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  background: var(--verde);
  color: var(--paper);
}

.asis-cabeza img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.asis-cabeza div { flex: 1; min-width: 0; }
.asis-cabeza b { display: block; font-family: var(--sans); font-size: .9rem; font-weight: 600; }
.asis-cabeza span { font-size: .72rem; opacity: .8; }

.asis-cerrar {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: .2rem .3rem;
  opacity: .8;
}

.asis-cuerpo {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: var(--paper);
}

.asis-msg {
  max-width: 85%;
  padding: .6rem .8rem;
  font-size: .86rem;
  line-height: 1.45;
  border-radius: 14px;
}

.asis-bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.asis-yo { align-self: flex-end; background: var(--verde); color: var(--paper); border-bottom-right-radius: 4px; }

.asis-ops { display: flex; flex-wrap: wrap; gap: .4rem; }

.asis-op {
  border: 1px solid var(--verde);
  background: transparent;
  color: var(--verde);
  border-radius: 999px;
  padding: .36rem .75rem;
  font-size: .78rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.asis-op:hover { background: var(--verde); color: var(--paper); }

.asis-fichas { display: flex; flex-direction: column; gap: .45rem; }

.asis-ficha {
  display: flex;
  gap: .65rem;
  align-items: center;
  width: 100%;
  padding: .45rem;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.asis-ficha:hover { border-color: var(--verde); }
.asis-ficha img { width: 64px; height: 48px; object-fit: cover; flex: none; }
.asis-ficha span { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.asis-ficha b { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.asis-ficha i { font-style: normal; font-size: .7rem; color: var(--muted); }
.asis-ficha em { font-style: normal; font-size: .82rem; font-weight: 700; color: var(--verde); font-variant-numeric: tabular-nums; }

.asis-resumen {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: .7rem .8rem;
  font-family: var(--sans);
  font-size: .76rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
  margin: 0;
}

.asis-pie { display: flex; gap: .4rem; padding: .7rem; border-top: 1px solid var(--line); background: var(--surface); }

.asis-pie input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .45rem .85rem;
  font-size: .82rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
}

.asis-pie input:focus { outline: 2px solid var(--verde); outline-offset: 1px; }

.asis-pie button {
  border: 0;
  border-radius: 50%;
  width: 36px; height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--verde);
  color: var(--paper);
  cursor: pointer;
}

.asis-pie button svg { width: 17px; height: 17px; }

@media (max-width: 520px) {
  .asis-boton { width: 48px; height: 48px; bottom: calc(clamp(1rem, 2.5vw, 1.8rem) + 58px); }
  .asis-boton svg { width: 24px; height: 24px; }
  .asis-panel { bottom: calc(clamp(1rem, 2.5vw, 1.8rem) + 114px); max-height: calc(100vh - 170px); }
}

/* el mensaje de confirmación se marca en verde para que no se confunda
   con una tarea pendiente */
.asis-msg.asis-ok {
  border-color: var(--verde);
  border-left: 3px solid var(--verde);
  font-weight: 600;
}
