/* =============================================================
   chat.css — Burbuja de chat flotante · BARBER & CO
   ============================================================= */

/* ── BURBUJA TOGGLE ─────────────────────────────────────────── */

.chat-toggle {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 58px; height: 58px;
  background: #111111;
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.28);
  z-index: 1100;
  transition: transform .3s cubic-bezier(.34,1.4,.64,1), background .2s;
}
.chat-toggle:hover   { background: #F5C430; transform: scale(1.1); }
.chat-toggle.open    { background: #1A1A1A; }
.chat-toggle svg     { width: 24px; height: 24px; color: #fff; transition: opacity .2s; }
.chat-toggle .ico-chat  { opacity: 1; position: absolute; }
.chat-toggle .ico-close { opacity: 0; position: absolute; }
.chat-toggle.open .ico-chat  { opacity: 0; }
.chat-toggle.open .ico-close { opacity: 1; }

.chat-badge {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #F5C430; border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
.chat-badge.show { display: block; }

/* ── PANEL ──────────────────────────────────────────────────── */

.chat-panel {
  position: fixed;
  bottom: 100px; right: 28px;
  width: 360px;
  background: #2d2258;
  border-radius: 4px;
  box-shadow: 0 12px 56px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  z-index: 1050;
  opacity: 0; pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transition: opacity .25s ease, transform .28s cubic-bezier(.22,.68,0,1.2);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}
.chat-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

/* ── HEADER ─────────────────────────────────────────────────── */

.chat-hdr {
  background: #111111;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 11px;
  flex-shrink: 0;
}
.chat-hdr-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: #F5C430; color: #111111;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  font-family: 'Poppins', sans-serif;
  flex-shrink: 0;
}
.chat-hdr-info   { flex: 1; }
.chat-hdr-name   { font-size: 13px; font-weight: 700; color: #fff; font-family: 'Poppins', sans-serif; letter-spacing: .3px; }
.chat-hdr-status { font-size: 10.5px; color: rgba(255,255,255,0.38); font-family: 'Poppins', sans-serif; }
.chat-hdr-status::before { content: '●'; color: #4ADE80; margin-right: 4px; font-size: 7px; vertical-align: middle; }
.chat-hdr-close  { background: none; border: none; color: rgba(255,255,255,0.35); cursor: pointer; padding: 4px; display: flex; transition: color .2s; }
.chat-hdr-close:hover { color: #fff; }
.chat-hdr-close svg { width: 16px; height: 16px; }

/* ── MENSAJES ────────────────────────────────────────────────── */

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 280px; max-height: 380px;
}
.chat-body::-webkit-scrollbar       { width: 3px; }
.chat-body::-webkit-scrollbar-thumb { background: #EBEBEB; border-radius: 99px; }

.chat-msg      { display: flex; gap: 7px; align-items: flex-end; animation: msgIn .2s ease; }
.chat-msg.user { flex-direction: row-reverse; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: #111111; color: #F5C430;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; font-family: 'Poppins', sans-serif;
}

.chat-bubble {
  max-width: 78%; padding: 9px 13px;
  font-size: 13px; line-height: 1.6; font-family: 'Poppins', sans-serif; font-weight: 300;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.bot  .chat-bubble { background: #2D1555; color: #F0E6FF; border-radius: 2px 10px 10px 10px; }
.chat-msg.user .chat-bubble { background: #cc99ff; color: #fff;    border-radius: 10px 2px 10px 10px; }

/* Typing dots */
.chat-typing { display: flex; gap: 7px; align-items: flex-end; }
.chat-typing.hidden { display: none; }
.typing-dots { background: #2D1555; padding: 12px 16px; border-radius: 2px 10px 10px 10px; display: flex; gap: 5px; align-items: center; }
.typing-dot  { width: 6px; height: 6px; border-radius: 50%; background: #F5C430; animation: bounce 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-7px); }
}

/* ── RESPUESTAS RÁPIDAS ──────────────────────────────────────── */

.chat-quick { padding: 0 14px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.quick-btn {
  padding: 5px 12px; border: 1px solid rgba(204,153,255,0.30); border-radius: 99px;
  font-size: 11px; font-weight: 500; color: rgba(196,160,224,0.65);
  font-family: 'Poppins', sans-serif; background: rgba(204,153,255,0.08); cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  white-space: nowrap;
}
.quick-btn:hover { border-color: #F5C430; color: #F5C430; background: rgba(245,196,48,.06); }

/* ── INPUT ──────────────────────────────────────────────────── */

.chat-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(204,153,255,0.20);
  display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1; border: 1px solid rgba(204,153,255,0.25); border-radius: 2px;
  padding: 9px 12px; font-size: 13px; color: #F0E6FF;
  font-family: 'Poppins', sans-serif; font-weight: 300;
  outline: none; resize: none; max-height: 80px;
  transition: border-color .2s; background: rgba(204,153,255,0.10);
  line-height: 1.5;
}
.chat-input:focus        { border-color: #F5C430; }
.chat-input::placeholder { color: rgba(196,160,224,0.30); }
.chat-send {
  width: 38px; height: 38px; flex-shrink: 0;
  background: #cc99ff; border: none; border-radius: 2px;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; flex-shrink: 0;
}
.chat-send:hover    { background: #F5C430; }
.chat-send:disabled { opacity: .4; cursor: default; }
.chat-send svg      { width: 15px; height: 15px; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 480px) {
  .chat-panel  { width: calc(100vw - 24px); right: 12px; bottom: 88px; }
  .chat-toggle { bottom: 16px; right: 16px; }
}
