/* DecorCenter storefront chat widget */
#chat-widget-root {
  --cw-accent: #8b6914;
  --cw-bg: #fff;
  --cw-text: #1a1a1a;
  --cw-muted: #666;
  --cw-border: #e5e5e5;
  --cw-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: inherit;
}

.chat-widget-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--cw-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--cw-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-panel {
  display: none;
  flex-direction: column;
  width: min(360px, calc(100vw - 40px));
  height: min(520px, calc(100vh - 100px));
  background: var(--cw-bg);
  border-radius: 12px;
  box-shadow: var(--cw-shadow);
  overflow: hidden;
  margin-bottom: 12px;
}

.chat-widget-panel.open {
  display: flex;
}

.chat-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--cw-accent);
  color: #fff;
}

.chat-widget-header strong {
  font-size: 15px;
}

.chat-widget-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.chat-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #fafafa;
}

.chat-widget-msg {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-widget-msg.customer {
  margin-left: auto;
  background: var(--cw-accent);
  color: #fff;
}

.chat-widget-msg.ai,
.chat-widget-msg.staff {
  background: #fff;
  border: 1px solid var(--cw-border);
  color: var(--cw-text);
}

.chat-widget-msg.system {
  background: transparent;
  color: var(--cw-muted);
  font-size: 12px;
  text-align: center;
  max-width: 100%;
}

.chat-widget-compose {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--cw-border);
  background: #fff;
}

.chat-widget-input {
  flex: 1;
  border: 1px solid var(--cw-border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  resize: none;
  min-height: 38px;
  max-height: 100px;
}

.chat-widget-send {
  border: none;
  border-radius: 8px;
  background: var(--cw-accent);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
}

.chat-widget-status {
  font-size: 11px;
  opacity: 0.9;
}

.chat-widget-root-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

@media (max-width: 480px) {
  #chat-widget-root {
    right: 12px;
    bottom: 12px;
  }
}
