/* ==========================================================================
   Asistente flotante
   ========================================================================== */

.chat-launcher {
  position: fixed; right: var(--sp-md); bottom: var(--sp-md); z-index: 600;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--amber); color: var(--teal-deeper);
  display: grid; place-items: center;
  border: none; cursor: pointer;
  box-shadow: 0 14px 30px -10px rgba(217,139,43,.6);
  transition: transform var(--dur-fast) var(--ease-out);
}
.chat-launcher:hover { transform: scale(1.06); }
.chat-launcher svg { width: 26px; height: 26px; }
.chat-launcher .icon-close { display: none; }
.chat-launcher.is-open .icon-chat { display: none; }
.chat-launcher.is-open .icon-close { display: block; }
.chat-launcher .ping {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--terracotta); border: 2px solid var(--ivory);
}
.chat-launcher.is-open .ping { display: none; }

.chat-panel {
  position: fixed; right: var(--sp-md); bottom: calc(var(--sp-md) + 74px);
  z-index: 599;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 140px));
  background: var(--ivory);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -20px rgba(13,44,43,.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(.97);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out), visibility 0s var(--dur-med);
}
.chat-panel.is-open {
  transform: none; opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out), visibility 0s;
}

.chat-head {
  background: var(--teal); color: var(--on-dark);
  padding: var(--sp-md);
  display: flex; align-items: center; gap: .75rem;
}
.chat-head img { width: 38px; height: 38px; border-radius: 50%; }
.chat-head strong { display: block; font-size: var(--step-sm); }
.chat-head span { font-size: var(--step-2xs); color: var(--on-dark-soft); display: flex; align-items: center; gap: .4em; }
.chat-head span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #7BD389; }

.chat-body {
  flex: 1; overflow-y: auto; padding: var(--sp-md);
  display: flex; flex-direction: column; gap: .65rem;
}
.chat-msg {
  max-width: 88%;
  padding: .7em 1em;
  border-radius: 14px;
  font-size: var(--step-xs);
  line-height: 1.5;
}
.chat-msg.bot { background: var(--bg-card); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-msg.user { background: var(--teal); color: var(--ivory); border-bottom-right-radius: 4px; align-self: flex-end; }

.chat-chips {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: 0 var(--sp-md) var(--sp-sm);
}
.chat-chip {
  border: 1.5px solid rgba(107,74,58,.2);
  background: #fff;
  border-radius: var(--radius-pill);
  padding: .5em 1em;
  font-size: var(--step-2xs); font-weight: 600;
  cursor: pointer;
}
.chat-chip:hover { border-color: var(--amber); }

.chat-foot {
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid rgba(107,74,58,.12);
}
.chat-foot a {
  display: flex; align-items: center; justify-content: center; gap: .5em;
  background: #25D366; color: #fff; font-weight: 700;
  padding: .8em 1em; border-radius: var(--radius-pill);
  font-size: var(--step-xs);
}
.chat-foot a svg { width: 18px; height: 18px; }
