/* ==========================================================================
   Catalogo Wha · assistant.css
   Asistente inteligente del catálogo (widget web). Solo lo carga catalogo.html.
   ========================================================================== */

.asst-fab {
  position: fixed;
  inset-block-end: 88px;
  inset-inline-end: 20px;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #5B1A80, #8B5CF6);
  color: #fff; font-size: 1.5rem;
  display: grid; place-items: center;
  box-shadow: 0 14px 34px rgba(91, 26, 128, .35);
  z-index: 85; cursor: pointer;
  transition: transform .18s;
}
.asst-fab:hover { transform: scale(1.06); }
.asst-fab .asst-dot {
  position: absolute; top: 2px; inset-inline-end: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}

.asst-panel {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  width: min(390px, calc(100vw - 24px));
  height: min(600px, calc(100vh - 40px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(30, 12, 60, .28);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 95;
  transform: translateY(14px) scale(.98);
  opacity: 0; pointer-events: none;
  transition: transform .2s, opacity .2s;
}
.asst-panel.show { transform: none; opacity: 1; pointer-events: auto; }

.asst-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #5B1A80, #7C3AED);
  color: #fff;
}
.asst-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-weight: 800;
}
.asst-title { line-height: 1.2; }
.asst-title b { display: block; font-size: .96rem; }
.asst-title small { font-size: .76rem; opacity: .85; }
.asst-head .icon-btn { margin-inline-start: auto; color: #fff; }
.asst-head .icon-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

.asst-msgs {
  flex: 1; overflow-y: auto; padding: 16px;
  background: #f7f4fc;
  display: flex; flex-direction: column; gap: 10px;
}
.asst-msg { max-width: 84%; padding: 10px 13px; border-radius: 16px; font-size: .9rem; line-height: 1.45; white-space: pre-line; }
.asst-msg.bot { background: #fff; border: 1px solid var(--line); border-start-start-radius: 6px; align-self: flex-start; }
.asst-msg.user { background: var(--brand); color: #fff; border-start-end-radius: 6px; align-self: flex-end; }
.asst-msg .prod { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.asst-msg .prod b { color: var(--brand); }
.asst-msg.user .prod b { color: #fff; }
.asst-msg a { color: var(--brand); font-weight: 700; text-decoration: underline; }

.asst-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; background: #f7f4fc; }
.asst-chip {
  border: 1px solid var(--line-2); background: #fff; border-radius: 999px;
  padding: 7px 13px; font-size: .82rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.asst-chip:hover { border-color: var(--brand); color: var(--brand); }

.asst-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.asst-form input {
  flex: 1; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 11px 16px; font-size: .92rem;
}
.asst-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,26,128,.1); }
.asst-form button {
  border: 0; border-radius: 50%; width: 44px; height: 44px;
  background: var(--brand); color: #fff; font-size: 1.05rem; cursor: pointer;
}
.asst-form button:disabled { opacity: .5; }

.asst-typing span {
  display: inline-block; width: 6px; height: 6px; margin-inline-end: 3px;
  border-radius: 50%; background: var(--muted); animation: asstBounce 1.2s infinite;
}
.asst-typing span:nth-child(2) { animation-delay: .15s; }
.asst-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes asstBounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 560px) {
  .asst-panel {
    inset-block-end: 0; inset-inline-end: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    border-radius: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .asst-panel, .asst-fab { transition: none; }
}
