/* SUPPORT CHAT WIDGET */
#chat-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--buy); color: #fff; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
#chat-bubble:hover { background: var(--buy-light); }
#chat-unread-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}
#chat-panel {
  position: fixed; bottom: 92px; right: 24px; z-index: 999;
  width: 340px; max-width: calc(100vw - 32px); height: 440px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
#chat-panel-header {
  background: var(--buy); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px;
}
#chat-panel-close { cursor: pointer; opacity: 0.8; }
#chat-panel-close:hover { opacity: 1; }
#chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.chat-msg-customer { align-self: flex-end; align-items: flex-end; }
.chat-msg-admin { align-self: flex-start; align-items: flex-start; }
.chat-msg-bubble {
  padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4;
  word-break: break-word;
}
.chat-msg-customer .chat-msg-bubble { background: var(--buy); color: #fff; border-bottom-right-radius: 3px; }
.chat-msg-admin .chat-msg-bubble { background: var(--surface2); color: var(--text); border-bottom-left-radius: 3px; }
.chat-msg-time { font-size: 10px; color: var(--muted); margin-top: 3px; }
#chat-input-row {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border);
}
#chat-input {
  flex: 1; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px;
}
#chat-input-row button {
  padding: 9px 16px; border-radius: 6px; border: none;
  background: var(--buy); color: #fff; font-weight: 600; cursor: pointer; font-size: 13px;
}
#chat-input-row button:hover { background: var(--buy-light); }
@media (max-width: 480px) {
  #chat-panel { width: calc(100vw - 24px); right: 12px; bottom: 84px; }
  #chat-bubble { right: 16px; bottom: 16px; }
}

#chat-prechat input {
  padding: 9px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px;
}
#chat-start-btn {
  padding: 10px; border-radius: 6px; border: none;
  background: var(--buy); color: #fff; font-weight: 600; cursor: pointer; font-size: 13px;
}
#chat-start-btn:hover { background: var(--buy-light); }
