/* ============================================================
   REPLAYBOT — Widget de chat
   ============================================================ */

.bot-window {
  position: fixed; right: 22px; bottom: 160px; z-index: 95;
  width: min(380px, calc(100vw - 40px)); height: min(600px, calc(100vh - 200px));
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(20px) scale(0.96); opacity: 0; pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  transform-origin: bottom right;
}
.bot-window.open { transform: none; opacity: 1; pointer-events: auto; }

.bot-head { background: linear-gradient(120deg, var(--teal-800), var(--teal-600)); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.bot-head .av { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.bot-head .av img { width: 30px; height: 30px; }
.bot-head .t { flex: 1; }
.bot-head .t b { display: block; font-family: var(--font-display); font-size: 1rem; }
.bot-head .t span { font-size: 0.76rem; opacity: 0.9; display: flex; align-items: center; gap: 5px; }
.bot-head .t .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.bot-close { color: #fff; opacity: 0.8; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; transition: 0.2s; }
.bot-close:hover { background: rgba(255,255,255,0.15); opacity: 1; }

.bot-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f2f6f5; }
.bot-msg { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; animation: msg-in 0.25s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.bot-msg.bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.bot-msg.user { align-self: flex-end; background: var(--teal-700); color: #fff; border-bottom-right-radius: 4px; }
.bot-msg a { color: var(--teal-700); font-weight: 600; text-decoration: underline; }
.bot-msg.bot a { color: var(--teal-700); }
.bot-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border-radius: 16px; border-bottom-left-radius: 4px; }
.bot-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.bot-typing span:nth-child(2) { animation-delay: 0.2s; }
.bot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; } }

.bot-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.bot-quick button { padding: 9px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--teal-200); color: var(--teal-800); font-size: 0.84rem; font-weight: 600; transition: 0.2s; }
.bot-quick button:hover { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }

.bot-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 10px; background: #fff; }
.bot-foot input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 12px 16px; font-size: 0.9rem; }
.bot-foot input:focus { outline: none; border-color: var(--teal-600); }
.bot-foot .send { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--teal-700); color: #fff; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.bot-foot .send:hover { background: var(--teal-800); }
.bot-foot .send svg { width: 20px; height: 20px; fill: #fff; }

/* Tarjeta de vendedor dentro del chat */
.bot-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); padding: 12px; display: flex; flex-direction: column; gap: 9px; align-self: stretch; border: 1px solid var(--line); }
.bot-card .agent { display: flex; align-items: center; gap: 10px; }
.bot-card .agent .av { width: 38px; height: 38px; border-radius: 50%; background: var(--teal-100); color: var(--teal-800); font-weight: 700; font-family: var(--font-display); display: flex; align-items: center; justify-content: center; }
.bot-card .agent b { display: block; font-size: 0.92rem; }
.bot-card .agent span { font-size: 0.76rem; color: var(--muted); }
.bot-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bot-card .actions a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.bot-card .actions .wa { background: #25d366; color: #fff; }
.bot-card .actions .mail { background: var(--teal-50); color: var(--teal-800); }
