/* AI site assistant widget */
.site-chat {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 1000;
  font-family: var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
}

.site-chat__toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, var(--gold, #c9a227), #e8c547);
  color: var(--navy, #0a1628);
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(10, 22, 40, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-chat__toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(10, 22, 40, 0.28);
}

.site-chat__icon--close {
  display: none;
}

.site-chat.is-open .site-chat__icon--open {
  display: none;
}

.site-chat.is-open .site-chat__icon--close {
  display: block;
}

.site-chat__panel {
  position: absolute;
  bottom: calc(58px + 12px);
  right: 0;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 6rem));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(10, 22, 40, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(10, 22, 40, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.site-chat__panel[hidden] {
  display: none !important;
}

.site-chat__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  background: linear-gradient(135deg, var(--navy, #0a1628), #152a45);
  color: #fff;
}

.site-chat__header-text strong {
  display: block;
  font-size: 0.95rem;
}

.site-chat__header-text span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 0.2rem;
}

.site-chat__close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  padding: 0 0.25rem;
}

.site-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  max-height: 340px;
}

.site-chat__msg {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.site-chat__msg p {
  margin: 0 0 0.65rem;
}

.site-chat__msg p:last-child {
  margin-bottom: 0;
}

.site-chat__link {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: var(--gold, #c9a227);
  color: var(--navy, #0a1628) !important;
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.site-chat__link:hover {
  background: #e8c547;
  transform: translateY(-1px);
}

.site-chat__msg--bot {
  align-self: flex-start;
  background: #f0f3f8;
  color: var(--text, #1a2332);
  border-bottom-left-radius: 4px;
}

.site-chat__msg--user {
  align-self: flex-end;
  background: var(--navy, #0a1628);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.site-chat__msg--typing {
  opacity: 0.7;
  font-style: italic;
}

.site-chat__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(10, 22, 40, 0.08);
  background: #fafbfc;
}

.site-chat__input {
  flex: 1;
  border: 1px solid rgba(10, 22, 40, 0.12);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  outline: none;
}

.site-chat__input:focus {
  border-color: var(--gold, #c9a227);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.site-chat__send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--gold, #c9a227);
  color: var(--navy, #0a1628);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.site-chat__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .site-chat {
    right: 1rem;
    bottom: 1rem;
  }

  .site-chat__panel {
    width: calc(100vw - 2rem);
  }
}
