/* ============ CHAT BURBUJA — RICARDO ============ */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 150;
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold) 60%, #b9822e);
  color: #0a0a0a; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(217,164,65,.45);
  transition: transform .25s ease, box-shadow .25s ease;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 38px rgba(217,164,65,.6); }
.chat-fab svg { width: 28px; height: 28px; }
.chat-fab .fab-close { display: none; font-size: 26px; font-weight: 700; line-height: 1; }
.chat-fab.open .fab-chat { display: none; }
.chat-fab.open .fab-close { display: block; }

.chat-panel {
  position: fixed; right: 18px; bottom: 90px; z-index: 150;
  width: min(360px, calc(100vw - 36px));
  max-height: min(560px, calc(100svh - 120px));
  display: flex; flex-direction: column;
  background: #0d0d0c; border: 1px solid rgba(217,164,65,.35); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.7), 0 0 40px rgba(217,164,65,.12);
  overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.97); pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
.chat-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: #141005; border-bottom: 1px solid rgba(217,164,65,.25);
}
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 35%, var(--gold-soft), var(--gold) 55%, #7a5416);
  color: #0a0a0a; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
}
.chat-head div { flex: 1; }
.chat-head strong { display: block; font-family: var(--font-display); letter-spacing: .06em; font-size: 1rem; }
.chat-head small { color: var(--muted); font-size: .75rem; }
.chat-close {
  background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer;
  line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.chat-close:hover { color: var(--gold-soft); background: rgba(255,255,255,.05); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px; min-height: 180px;
}
.chat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: .9rem; line-height: 1.55;
}
.chat-msg.bot {
  align-self: flex-start; background: #161513; border: 1px solid rgba(217,164,65,.22);
  border-bottom-left-radius: 4px; color: var(--text);
}
.chat-msg.user {
  align-self: flex-end; background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #0a0a0a; font-weight: 500; border-bottom-right-radius: 4px;
}
.chat-msg .msg-btn {
  display: inline-block; margin-top: 8px; padding: 8px 16px; border-radius: 20px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #0a0a0a;
  font-weight: 700; font-size: .8rem; text-decoration: none; font-family: var(--font-display);
  letter-spacing: .08em; text-transform: uppercase;
}
.chat-msg .msg-link { color: var(--gold-soft); font-weight: 600; }

.chat-chips {
  display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto;
  border-top: 1px solid rgba(255,255,255,.06); background: #0a0a09;
}
.chat-chips button {
  flex-shrink: 0; background: rgba(217,164,65,.1); border: 1px solid rgba(217,164,65,.4);
  color: var(--gold-soft); font-size: .78rem; font-weight: 600; padding: 8px 14px;
  border-radius: 20px; cursor: pointer; font-family: var(--font-body); white-space: nowrap;
  transition: background .2s;
}
.chat-chips button:hover { background: rgba(217,164,65,.25); }

.chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); background: #0a0a09; }
.chat-form input {
  flex: 1; background: #161513; border: 1px solid rgba(255,255,255,.1); border-radius: 22px;
  padding: 10px 16px; color: var(--text); font-size: .9rem; font-family: var(--font-body);
  outline: none; min-width: 0;
}
.chat-form input:focus { border-color: var(--gold); }
.chat-form button {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #0a0a0a;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}

@media (min-width: 640px) {
  .chat-fab { right: 26px; bottom: 26px; }
  .chat-panel { right: 26px; bottom: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-fab, .chat-panel { transition: none; }
}

/* Indicador "Ricardo está escribiendo…" */
.chat-msg.bot.typing { display: inline-flex; gap: 4px; align-items: center; padding: 10px 14px; }
.chat-msg.bot.typing .tdot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-soft, #d4af37);
  animation: tdot-bounce 1.2s infinite ease-in-out;
}
.chat-msg.bot.typing .tdot:nth-child(2) { animation-delay: 0.15s; }
.chat-msg.bot.typing .tdot:nth-child(3) { animation-delay: 0.3s; }
@keyframes tdot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-msg.bot.typing .tdot { animation: none; opacity: 0.8; }
}
