/**
 * DCM Outdoor — sitewide chat widget (charlestonoutdoorliving.com)
 * Uses site.css tokens when present; hardcoded fallbacks included.
 */

.dcm-chat-launcher {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 2147483000;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid var(--gold, #C89B35);
  border-radius: 50%;
  background: var(--green, #0F5C4A);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.dcm-chat-launcher:hover {
  background: var(--gold, #C89B35);
  color: var(--ink, #141A13);
  transform: scale(1.04);
}

.dcm-chat-launcher svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.dcm-chat-launcher[aria-expanded="true"] {
  background: var(--ink, #141A13);
  border-color: var(--ink, #141A13);
}

.dcm-chat-panel {
  position: fixed;
  bottom: 5.25rem;
  right: 1.25rem;
  z-index: 2147483001;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 7rem));
  background: var(--mist, #F9F8F5);
  border: 1px solid var(--border, #E0DDD7);
  border-radius: var(--r, 10px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.12));
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
}

.dcm-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dcm-chat-header {
  padding: 1rem 1.15rem;
  background: var(--green, #0F5C4A);
  color: #fff;
  border-radius: var(--r, 10px) var(--r, 10px) 0 0;
}

.dcm-chat-header__title {
  font-family: var(--font-head, 'Playfair Display', Georgia, serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.dcm-chat-header__sub {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold, #C89B35);
  margin: 0.2rem 0 0;
}

.dcm-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 12rem;
}

.dcm-chat-msg {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.55;
  border-radius: var(--r, 10px);
}

.dcm-chat-msg--bot {
  align-self: flex-start;
  background: var(--stone, #F5F3EF);
  color: var(--text, #3A3D36);
  border-left: 2px solid var(--gold, #C89B35);
}

.dcm-chat-msg--user {
  align-self: flex-end;
  background: var(--green, #0F5C4A);
  color: #fff;
}

.dcm-chat-msg--system {
  align-self: center;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-lt, #717569);
  padding: 0.25rem;
}

.dcm-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
}

.dcm-chat-chip {
  font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border, #E0DDD7);
  border-radius: var(--r, 10px);
  background: #fff;
  color: var(--green, #0F5C4A);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dcm-chat-chip:hover {
  background: var(--green, #0F5C4A);
  color: #fff;
}

.dcm-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border, #E0DDD7);
}

.dcm-chat-input {
  flex: 1;
  font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border, #E0DDD7);
  border-radius: var(--r, 10px);
  background: #fff;
  color: var(--ink, #141A13);
}

.dcm-chat-input:focus {
  outline: none;
  border-color: var(--green, #0F5C4A);
}

.dcm-chat-send {
  font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  border: none;
  border-radius: var(--r, 10px);
  background: var(--gold, #C89B35);
  color: var(--ink, #141A13);
  cursor: pointer;
  white-space: nowrap;
}

.dcm-chat-send:hover {
  background: var(--gold-dk, #A07A1A);
}

.dcm-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dcm-chat-link {
  color: var(--green-mid, #1A7A60);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .dcm-chat-panel,
  .dcm-chat-launcher {
    transition: none;
  }
}

@media (max-width: 480px) {
  .dcm-chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 0;
  }

  .dcm-chat-launcher {
    bottom: 1rem;
    right: 1rem;
  }
}
