/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease),
    border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
}

.btn:hover {
  color: inherit;
}

.btn--primary {
  background: var(--ink);
  color: var(--stone);
}

.btn--primary:hover {
  background: var(--champagne);
  color: var(--ink);
}

.btn--secondary {
  background: transparent;
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
  color: var(--ink);
}

.btn--secondary:hover {
  border-color: var(--champagne);
  color: var(--champagne-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover {
  color: var(--champagne);
}

.btn--champagne {
  background: var(--champagne);
  color: #0c1219;
}

.btn--champagne:hover {
  background: var(--champagne-hover);
}

.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.btn--full {
  width: 100%;
}

/* Cards — listing / interactive units only */
.listing-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease);
  height: 100%;
}

.listing-card:hover {
  box-shadow: var(--shadow);
}

.listing-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stone);
}

.listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.listing-card:hover .listing-card__media img {
  transform: scale(1.04);
}

.listing-card__badge {
  position: absolute;
  top: var(--space-3);
  inset-inline-start: var(--space-3);
  background: var(--ink);
  color: var(--stone);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  z-index: 1;
}

.listing-card__fav {
  position: absolute;
  top: var(--space-3);
  inset-inline-end: var(--space-3);
  z-index: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: none;
}

[data-theme="dark"] .listing-card__fav {
  background: rgba(22, 30, 40, 0.9);
  color: var(--text);
}

.listing-card__fav.is-active {
  color: var(--danger);
}

.listing-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.listing-card__price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text);
  margin: 0;
}

.listing-card__title {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

.listing-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: auto;
  padding-top: var(--space-3);
}

.listing-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Agent card */
.agent-card {
  text-align: center;
  padding: var(--space-6);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.agent-card__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-inline: auto;
  margin-bottom: var(--space-4);
}

.agent-card__role {
  font-size: var(--text-sm);
  color: var(--champagne);
  margin-bottom: var(--space-2);
}

/* Neighborhood strip card */
.hood-card {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  min-height: 280px;
}

.hood-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.hood-card:hover img {
  transform: scale(1.05);
}

.hood-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 18, 25, 0.85), transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-5);
  color: #f7f5f1;
}

.hood-card__overlay h3 {
  color: #f7f5f1;
  margin-bottom: var(--space-1);
  font-size: var(--text-xl);
}

.hood-card__overlay p {
  color: rgba(247, 245, 241, 0.8);
  margin: 0;
  font-size: var(--text-sm);
}

/* Forms */
.form {
  display: grid;
  gap: var(--space-5);
}

.form__row {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 640px) {
  .form__row--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color var(--duration) var(--ease);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--champagne);
}

.field__error {
  font-size: var(--text-xs);
  color: var(--danger);
  min-height: 1.1em;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: var(--danger);
}

/* Toast */
.toast-host {
  position: fixed;
  inset-inline: 0;
  bottom: calc(var(--bottom-nav-h) + var(--space-4));
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .toast-host {
    bottom: var(--space-6);
  }
}

.toast {
  pointer-events: auto;
  background: var(--ink);
  color: var(--stone);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
  max-width: 420px;
  animation: toast-in 0.3s var(--ease);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tabs / filters */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tab {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

.tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--stone);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  align-items: center;
}

.toolbar__search {
  flex: 1 1 200px;
  position: relative;
}

.toolbar__search input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.toolbar__search .icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.toolbar select {
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-4);
}

.faq summary {
  cursor: pointer;
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
  color: var(--text);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details[open] summary {
  color: var(--champagne-hover);
}

.faq details p {
  margin-top: var(--space-3);
  margin-bottom: 0;
}

/* Testimonial */
.testimonial {
  padding: var(--space-6);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.testimonial__quote {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text);
  margin-bottom: var(--space-4);
  line-height: 1.45;
}

.testimonial__author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.testimonial__meta {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Gallery */
.gallery {
  display: grid;
  gap: var(--space-3);
}

.gallery__main {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stone);
}

.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: var(--space-2);
}

.gallery__thumbs button {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  opacity: 0.75;
}

.gallery__thumbs button.is-active,
.gallery__thumbs button:hover {
  border-color: var(--champagne);
  opacity: 1;
}

.gallery__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Empty / page hero (inner) */
.page-hero {
  padding-block: var(--space-12) var(--space-8);
}

.page-hero h1 {
  margin-bottom: var(--space-3);
}

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--champagne);
  color: #0c1219;
  font-size: 0.65rem;
  font-weight: 700;
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
}

.badge-count:empty,
.badge-count[data-count="0"] {
  display: none;
}
