/* ── Chatbot WP styles ─────────────────────────────────────── */

#wp-chat-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(37,99,235,.45);
  z-index: 9999;
  animation: wp-pulse 2.5s infinite;
  transition: transform .2s;
}
#wp-chat-btn:hover { transform: scale(1.04); animation: none; }
#wp-chat-btn svg   { width: 22px; height: 22px; }

@keyframes wp-pulse {
  0%   { box-shadow: 0 4px 20px rgba(37,99,235,.45), 0 0 0 0   rgba(37,99,235,.4); }
  70%  { box-shadow: 0 4px 20px rgba(37,99,235,.45), 0 0 0 14px rgba(37,99,235,0); }
  100% { box-shadow: 0 4px 20px rgba(37,99,235,.45), 0 0 0 0   rgba(37,99,235,0); }
}

#wp-chat-window {
  position: fixed;
  bottom: 90px;
  left: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: none;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
#wp-chat-header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.wp-chat-avatar  { font-size: 22px; }
.wp-chat-info    { flex: 1; }
.wp-chat-name    { font-weight: 700; font-size: 14px; }
.wp-chat-status  { font-size: 11px; color: #93c5fd; }
#wp-chat-timer   { font-size: 12px; color: #93c5fd; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
#wp-chat-close   { background: none; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 2px 4px; }
#wp-chat-close:hover { color: #fff; }

/* Messages */
#wp-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  min-height: 0;
}
.wp-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.wp-msg.bot {
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.wp-msg.user {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.wp-msg.typing { color: #94a3b8; font-style: italic; }

/* Highlight + bounce arrow */
.wp-msg-highlight {
  background: #eff6ff !important;
  border: 2px solid #2563eb !important;
  border-bottom-left-radius: 4px;
}
.wp-msg-highlight::after {
  content: '👇';
  display: block;
  text-align: center;
  font-size: 18px;
  margin-top: 6px;
  animation: wp-bounce 1s infinite;
}
@keyframes wp-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(4px); }
}

/* Lead form */
#wp-lead-form {
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f0f9ff;
  flex-shrink: 0;
}
.wp-lead-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  line-height: 1.4;
}
#wp-lead-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
  font-family: inherit;
}
#wp-lead-form input:focus { border-color: #2563eb; }
#wp-lead-send {
  width: 100%;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
#wp-lead-send:hover     { background: #1d4ed8; }
#wp-lead-send:disabled  { background: #93c5fd; cursor: not-allowed; }
#wp-lead-skip {
  display: block;
  width: 100%;
  text-align: center;
  padding: 9px;
  margin-top: 8px;
  font-size: 13px;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  box-sizing: border-box;
  background: none;
  font-family: inherit;
}
#wp-lead-skip:hover { background: #f1f5f9; color: #64748b; }

/* Input row */
#wp-chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
  align-items: flex-end;
}
#wp-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  outline: none;
  overflow-y: auto;
  line-height: 1.4;
}
#wp-chat-input:focus { border-color: #2563eb; }
#wp-chat-send {
  width: 40px;
  height: 40px;
  background: #2563eb;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#wp-chat-send:hover    { background: #1d4ed8; }
#wp-chat-send:disabled { background: #93c5fd; cursor: not-allowed; }
#wp-chat-send { font-size: 20px; line-height: 1; color: #fff !important; }

/* Mobile */
@media (max-width: 480px) {
  #wp-chat-window {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0;
  }
  #wp-chat-messages {
    -webkit-overflow-scrolling: touch;
  }
  #wp-chat-btn { bottom: 16px; left: 16px; }
  body.chatbot-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
  }
}


