/* Scoped to main (not html/body) so it doesn't break the sticky header:
   overflow-x on an ancestor of a position:sticky element breaks sticky,
   and setting overflow-x alone on html/body forces overflow-y to compute
   as auto, turning body into a scroll container. */
main {
  overflow-x: hidden;
}

/* Sticky header scroll fade */
.site-header {
  background-color: hsl(var(--background) / 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.is-scrolled {
  background-color: hsl(var(--background) / 0.97);
  box-shadow: 0 1px 12px rgb(0 0 0 / 0.08);
}

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-x-left] {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal-x-left].is-visible {
  opacity: 1;
  transform: translateX(0);
}
[data-reveal-x-right] {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal-x-right].is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile menu */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 4rem 0 0 0;
  z-index: 40;
  background: hsl(var(--background));
  border-top: 1px solid hsl(var(--border));
  overflow-y: auto;
}
.mobile-nav.is-open {
  display: block;
}
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.25rem;
}
.mobile-nav a {
  font-size: 1.125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}
.mobile-nav a.active {
  color: hsl(var(--primary));
}

/* Chat popup */
.chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  height: 4rem;
  width: 4rem;
  border-radius: 9999px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 15px rgb(0 0 0 / 0.2));
  transition: transform 0.2s ease;
}
.chat-toggle:hover {
  transform: scale(1.05);
}
.chat-toggle img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.chat-toggle .chat-dot {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  height: 1rem;
  width: 1rem;
  background: #22c55e;
  border: 2px solid hsl(var(--background));
  border-radius: 9999px;
  z-index: 10;
}

.chat-panel {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  z-index: 50;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(600px, calc(100vh - 8rem));
  background: hsl(var(--card));
  border-radius: 1.25rem;
  box-shadow: 0 20px 40px rgb(0 0 0 / 0.25);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.chat-panel.is-open {
  display: flex;
}
.chat-panel-header {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chat-panel-header img {
  height: 2.75rem;
  width: 2.75rem;
  border-radius: 9999px;
  object-fit: contain;
  background: hsl(var(--primary-foreground) / 0.1);
}
.chat-panel-header .chat-title {
  flex: 1;
}
.chat-panel-header h3 {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
}
.chat-panel-header p {
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0;
}
.chat-panel-close {
  background: none;
  border: none;
  color: hsl(var(--primary-foreground));
  cursor: pointer;
  padding: 0.25rem;
  line-height: 0;
}
.chat-panel-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}
.chat-panel-body > p {
  color: hsl(var(--primary));
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.chat-field {
  margin-bottom: 0.75rem;
}
.chat-field input,
.chat-field textarea {
  width: 100%;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  font-size: 16px;
  color: hsl(var(--foreground));
}
.chat-field textarea {
  min-height: 100px;
  resize: vertical;
}
.chat-field input::placeholder,
.chat-field textarea::placeholder {
  color: hsl(var(--primary) / 0.7);
}
.chat-submit {
  width: 100%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 0.5rem;
  padding: 0.85rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.25rem;
}
.chat-submit:hover {
  background: hsl(var(--primary) / 0.9);
}

/* Form status messages */
.form-status {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}
.form-status.is-visible {
  display: block;
}
.form-status.success {
  background: hsl(142 76% 94%);
  color: hsl(142 60% 25%);
}
.form-status.error {
  background: hsl(0 84% 96%);
  color: hsl(0 70% 40%);
}
.form-status .fallback-phone {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Reviews section */
.static-reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.static-review-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.5rem;
}
.static-review-card .stars {
  color: #fbbf24;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}
.static-review-card p {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}
.static-review-card .reviewer {
  font-weight: 600;
  color: hsl(var(--foreground));
}

@media (max-width: 767px) {
  header nav.hidden.md\:flex { display: none; }
}
