/* ============================================================
   Widget del chatbot — plugin wa-leads-panel, shortcode [cotizador_wa]
   Extraído 1:1 de wa_shortcode() en wp-content/plugins/wa-leads-panel/wa-leads-panel.php
   ============================================================ */
#wa-float-btn, #wa-chat-box, #wa-chat-box * { box-sizing: border-box; font-family: 'Nunito', sans-serif; }
#wa-float-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 999999;
  background: #2563eb; color: #fff; border-radius: 999px;
  padding: 12px 20px 12px 14px; display: flex; align-items: center;
  gap: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 24px rgba(37,99,235,0.5);
  transition: transform .2s, box-shadow .2s; user-select: none;
}
#wa-float-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(37,99,235,0.6); }
#wa-float-btn img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #fff; }
#wa-chat-box {
  position: fixed; bottom: 84px; right: 20px; width: 100%; max-width: 420px;
  height: 80vh; max-height: 660px; background: #fff; border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18); display: none;
  flex-direction: column; overflow: hidden; z-index: 999998; animation: waSlide .25s ease;
}
#wa-chat-box.wa-open { display: flex !important; }
@keyframes waSlide {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#wa-chat-header { display: flex; align-items: center; gap: 11px; padding: 14px 16px; background: #2563eb; flex-shrink: 0; }
#wa-header-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
#wa-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
#wa-header-text { flex: 1; }
#wa-header-text strong { display: block; color: #fff; font-size: 14px; font-weight: 800; }
#wa-header-text span { color: rgba(255,255,255,.8); font-size: 12px; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
#wa-status-dot { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; display: inline-block; }
#wa-close-btn { background: rgba(255,255,255,.18); border: none; border-radius: 50%; width: 28px; height: 28px; color: #fff; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .2s; }
#wa-close-btn:hover { background: rgba(255,255,255,.32); }
#wa-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 11px; background: #f9fafb; }
#wa-messages::-webkit-scrollbar { width: 4px; }
#wa-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.wa-msg-bot, .wa-msg-user { max-width: 82%; font-size: 16px; line-height: 1.5; word-wrap: break-word; animation: waFade .3s ease forwards; opacity: 0; }
@keyframes waFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.wa-msg-bot { align-self: flex-start; background: #e5e7eb; color: #111827; padding: 10px 13px; border-radius: 18px 18px 18px 0; }
.wa-msg-bot .wa-txt { flex: 1; }
.wa-msg-user { align-self: flex-end; background: #2563eb; color: #fff; padding: 10px 13px; border-radius: 18px 18px 0 18px; }
.wa-msg-success { background: #d1fae5 !important; color: #065f46 !important; }
.wa-typing .wa-txt { display: flex; align-items: center; gap: 4px; padding: 3px 0; min-height: 18px; }
.wa-typing .wa-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; display: inline-block; animation: waBounce 1.2s infinite ease-in-out; }
.wa-typing .wa-dot:nth-child(2) { animation-delay: .2s; }
.wa-typing .wa-dot:nth-child(3) { animation-delay: .4s; }
@keyframes waBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
#wa-input-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #fff; border-top: 1px solid #f1f5f9; flex-shrink: 0; }
#wa-text-input { flex: 1; padding: 10px 15px; font-family: 'Nunito', sans-serif; font-size: 16px; border: 1px solid #d1d5db; border-radius: 999px; outline: none; color: #111827; transition: border-color .2s; }
#wa-text-input:focus { border-color: #2563eb; }
#wa-text-input::placeholder { color: #9ca3af; }
#wa-text-input:disabled { opacity: .5; }
#wa-send-btn { width: 38px; height: 38px; flex-shrink: 0; background: #2563eb; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
#wa-send-btn:hover { background: #1d4ed8; }
#wa-send-btn:disabled { opacity: .4; cursor: not-allowed; }
#wa-send-btn svg { width: 15px; height: 15px; fill: #fff; }
@media (max-width: 600px) {
  #wa-chat-box { left: 10px; right: 10px; width: auto; max-width: none; bottom: 78px; }
  #wa-float-btn { bottom: 20px !important; left: 50% !important; right: auto !important; transform: translateX(-50%) !important; width: 90% !important; justify-content: center; border-radius: 16px; }
}
