#ps-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,0.45);
  z-index: 9999;
  animation: ps-pulse 2.5s infinite;
  transition: transform 0.2s;
}
#ps-chat-btn:hover { transform: scale(1.04); animation: none; }
#ps-chat-btn svg { width: 22px; height: 22px; }

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

#ps-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,0.18);
  display: none;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  font-family: inherit;
}



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

#ps-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
.ps-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.ps-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,0.06);
}
.ps-msg.user {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.ps-msg.typing { color: #94a3b8; font-style: italic; }

#ps-lead-form {
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f0f9ff;
  flex-shrink: 0;
}
#ps-lead-form p { margin: 0 0 8px; font-size: 13px; color: #1e293b; font-weight: 600; }
#ps-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;
}
#ps-lead-form input:focus { border-color: #2563eb; }
#ps-lead-send {
  width: 100%;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
#ps-lead-send:hover { background: #1d4ed8; }

#ps-chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}
#ps-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  height: 40px;
  outline: none;
}
#ps-chat-input:focus { border-color: #2563eb; }
#ps-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;
}
#ps-chat-send:hover { background: #1d4ed8; }
#ps-chat-send:disabled { background: #93c5fd; cursor: not-allowed; }
#ps-chat-send svg { width: 16px; height: 16px; color: #fff; }

@media (max-width: 480px) {
  #ps-chat-window {
    position: fixed;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0;
    transform: none !important;
  }
  #ps-chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  #ps-chat-input-row { flex-shrink: 0; }
  #ps-chat-btn { bottom: 16px; left: 16px; }
  body.chatbot-open { overflow: hidden !important; position: fixed; width: 100%; }
}

.ps-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;
}
#ps-lead-form p {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #64748b;
}
#ps-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;
}
#ps-lead-skip:hover { background: #f1f5f9; color: #64748b; }

#ps-lead-product {
  padding: 10px 16px 0;
  display: none;
  background: transparent !important;
}
.ps-product-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 10px 14px;
}
.ps-product-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.ps-product-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
}
.ps-product-price {
  color: #2563eb;
  font-weight: 700;
}
.ps-product-avail {
  color: #16a34a;
}

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

@media (max-width: 480px) {
  .ps-lead-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #fff !important;
    background: #2563eb !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    display: block !important;
  }
  .ps-product-box {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
  }
  #ps-lead-skip {
    width: 100% !important;
    background: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 8px !important;
    font-size: 12.5px !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    margin-top: 6px !important;
    display: block !important;
  }
}

/* Burbulas */
#ps-bubble {
  position: fixed;
  bottom: 90px;
  left: 24px;
  max-width: 260px;
  background: var(--ps-bubble-bg, #fff);
  border: 0.5px solid #e2e8f0;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 9997;
  display: none;
  animation: ps-bubble-in 0.3s ease;
}
#ps-bubble.show { display: block; }
@keyframes ps-bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#ps-bubble-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
#ps-bubble-photo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
#ps-bubble-photo-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
#ps-bubble-content { flex: 1; }
#ps-bubble-name {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 3px;
}
#ps-bubble-msg {
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
  margin-bottom: 8px;
}
#ps-bubble-start {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
#ps-bubble-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
@media (max-width: 480px) {
  #ps-bubble {
    bottom: 80px;
    left: 12px;
    right: 12px;
    max-width: none;
  }
}
