:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #b8973e;
  --primary-light: #f5ecd7;
  --primary-hover: #9a7c30;
  --accent: #6b5a2a;
  --accent-light: #f0e6c8;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.header__cta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .875rem;
  color: var(--text-muted);
}
.header__cta a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #2c2010 0%, #7a6128 50%, #b8973e 100%);
  color: #fff;
  padding: 64px 24px 80px;
  text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; opacity: .85; margin-bottom: 40px; }

/* ── Search bar ── */
.search-bar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}
.search-field label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.search-field input,
.search-field select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.search-field input:focus,
.search-field select:focus { border-color: var(--primary); }
.btn-search {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  height: 40px;
  align-self: flex-end;
}
.btn-search:hover { background: var(--primary-hover); }

/* ── Layout ── */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.results-count { font-size: .9rem; color: var(--text-muted); }
.results-count strong { color: var(--text); }

/* ── Grid ── */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ── Property card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.card__img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #9ca3af;
}
.card__img img { width: 100%; height: 100%; object-fit: cover; }

.card__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge--venta { background: var(--primary-light); color: var(--primary); }
.badge--alquiler { background: var(--accent-light); color: var(--accent); }

.card__body { padding: 16px 20px 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

.card__price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}
.card__price span { font-size: .8rem; font-weight: 400; color: var(--text-muted); }

.card__address {
  font-size: .875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card__specs {
  display: flex;
  gap: 16px;
  font-size: .825rem;
  color: var(--text-muted);
}
.card__specs span { display: flex; align-items: center; gap: 4px; }

.card__desc {
  font-size: .825rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-interest {
  margin-top: auto;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background .15s;
}
.btn-interest:hover { background: var(--primary-hover); }

/* ── Empty state ── */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty__icon { font-size: 3rem; margin-bottom: 16px; }
.empty h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.card--skeleton .card__img { background: #e5e7eb; }
.card--skeleton .sk-line { height: 14px; margin-bottom: 8px; }
.card--skeleton .sk-price { height: 22px; width: 120px; }
.card--skeleton .sk-addr { height: 14px; width: 60%; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h2 { font-size: 1.2rem; margin-bottom: 4px; }
.modal p { font-size: .875rem; color: var(--text-muted); margin-bottom: 24px; }
.modal__property-ref {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.form-group input,
.form-group textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }

.modal__actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-cancel {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}
.btn-submit {
  flex: 2;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-submit:hover { background: var(--primary-hover); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  z-index: 300;
  transform: translateY(80px);
  opacity: 0;
  transition: transform .3s, opacity .3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--accent); }
.toast.error { background: var(--danger); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .search-bar { flex-direction: column; }
  .search-field { min-width: 100%; }
  .btn-search { width: 100%; }
  .header__cta { display: none; }
  .properties-grid { grid-template-columns: 1fr; }
}
