/* ============================================================
   CHAT WIDGET + WHATSAPP FAB COMPONENT
   ============================================================ */

/* WhatsApp */
.wa-fab {
  position: fixed; bottom: 26px; right: 26px; z-index: 800;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.35);
  transition: transform .25s, box-shadow .25s;
}
.wa-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(37,211,102,.5); }
.wa-fab svg { width: 26px; height: 26px; }

/* Chat FAB */
.chat-fab {
  position: fixed; bottom: 88px; right: 26px; z-index: 800;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid rgba(37,99,235,.35);
  color: var(--c-blue-light);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(37,99,235,.15);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.chat-fab:hover { border-color: var(--c-blue); transform: scale(1.08); box-shadow: 0 6px 24px rgba(37,99,235,.25); }
.chat-fab svg { width: 22px; height: 22px; }

/* Chat Window */
.chat-window {
  position: fixed; bottom: 154px; right: 26px; z-index: 801;
  width: 350px; border-radius: 16px; overflow: hidden;
  background: var(--bg-2); border: 1px solid rgba(37,99,235,.25);
  box-shadow: 0 20px 60px rgba(0,0,0,.65), 0 0 0 1px var(--border);
  display: none; flex-direction: column;
  animation: cwIn .3s var(--ease);
}
.chat-window.cw-open { display: flex; }
@keyframes cwIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.cw-head {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(6,182,212,.06));
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.cw-head-av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-blue), var(--c-cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .7rem; color: #fff; flex-shrink: 0;
}
.cw-head-name { font-weight: 700; font-size: .88rem; color: var(--text-1); }
.cw-head-status { font-size: .7rem; color: var(--c-green); }
.cw-close { margin-left: auto; color: var(--text-3); font-size: .9rem; padding: 4px; transition: color .2s; }
.cw-close:hover { color: var(--text-1); }

.cw-msgs {
  padding: 14px; overflow-y: auto; max-height: 280px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.cw-msg {
  max-width: 88%; padding: 9px 13px; border-radius: 10px;
  font-size: .82rem; line-height: 1.55;
}
.cw-msg-bot { background: rgba(255,255,255,.05); border: 1px solid var(--border); align-self: flex-start; color: var(--text-1); }
.cw-msg-user { background: var(--c-blue); color: #fff; font-weight: 500; align-self: flex-end; }

.cw-dots { display: flex; gap: 4px; align-items: center; }
.cw-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: cwDot 1.2s infinite; }
.cw-dots span:nth-child(2) { animation-delay: .2s; }
.cw-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes cwDot { 0%,100%{opacity:.3;transform:translateY(0)} 50%{opacity:1;transform:translateY(-4px)} }

.cw-quickreplies { padding: 8px 14px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.cw-qr {
  padding: 5px 11px; border: 1px solid var(--border-2); border-radius: 100px;
  font-size: .63rem; font-weight: 600; letter-spacing: .04em; color: var(--text-3);
  transition: border-color .2s, color .2s;
}
.cw-qr:hover { border-color: var(--c-blue); color: var(--c-blue-light); }

.cw-input-row { padding: 10px; display: flex; gap: 7px; border-top: 1px solid var(--border); }
.cw-input-row input {
  flex: 1; background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; color: var(--text-1);
  font-family: var(--fb); font-size: .82rem; outline: none;
  transition: border-color .2s;
}
.cw-input-row input:focus { border-color: var(--c-blue); }
.cw-input-row input::placeholder { color: var(--text-4); }
.cw-send {
  width: 36px; height: 36px; background: var(--c-blue); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; transition: background .2s;
}
.cw-send:hover { background: var(--c-blue-light); }
.cw-send svg { width: 15px; height: 15px; }
