:root {
  --brand-cream: #fff8ed;
  --brand-surface: #ffffff;
  --brand-panel: #f4efe7;
  --brand-gold: #a77718;
  --brand-gold-dark: #7a5410;
  --brand-forest: #18382f;
  --brand-ink: #1e2421;
  --brand-muted: #64716c;
  --brand-line: rgba(24, 56, 47, 0.14);
  --shadow: 0 18px 42px rgba(21, 36, 31, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  color: var(--brand-ink);
  background: var(--brand-cream);
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
.brand-logo {
  font-family: "Adamina", Georgia, serif;
  margin: 0;
}

p {
  line-height: 1.7;
}

a {
  color: inherit;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 237, 0.94);
  border-bottom: 1px solid var(--brand-line);
  backdrop-filter: blur(14px);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  color: var(--brand-forest);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.nav-links a,
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--brand-forest);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(167, 119, 24, 0.12);
  color: var(--brand-gold-dark);
}

.nav-cta {
  color: #fff;
  background: var(--brand-forest);
}

.hero {
  min-height: 650px;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(12, 28, 24, 0.82), rgba(12, 28, 24, 0.38)),
    url("https://images.unsplash.com/photo-1560518883-ce09059eeffa?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 680px) 1fr;
  align-items: center;
}

.hero-copy {
  padding: 88px 0;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--brand-gold);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f4c86c;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 1.03;
}

.hero p {
  max-width: 620px;
  margin: 22px 0 26px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.03rem;
}

.search-shell {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.search-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 13px 16px;
  color: var(--brand-ink);
  background: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--brand-gold);
  box-shadow: 0 10px 24px rgba(122, 84, 16, 0.25);
}

.btn-primary:hover {
  background: var(--brand-gold-dark);
}

.btn-soft {
  color: var(--brand-forest);
  background: rgba(24, 56, 47, 0.08);
}

.btn-outline {
  color: var(--brand-forest);
  border: 1px solid var(--brand-line);
  background: transparent;
}

.quick-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.quick-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.12);
}

.quick-stats strong {
  color: #fff;
}

.section {
  padding: 62px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading h2,
.sell-section h2,
.contact-section h2 {
  color: var(--brand-forest);
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.section-heading p {
  max-width: 480px;
  margin: 0;
  color: var(--brand-muted);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.toolbar label,
.contact-form label {
  display: grid;
  gap: 6px;
}

.toolbar label span,
.contact-form label span {
  color: var(--brand-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar select,
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--brand-ink);
  background: #fff;
  outline: 0;
}

.toolbar select:focus,
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: rgba(167, 119, 24, 0.65);
  box-shadow: 0 0 0 4px rgba(167, 119, 24, 0.12);
}

.property-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
  gap: 18px;
}

.map-panel,
.listings-panel,
.contact-form,
.contact-card {
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: var(--brand-surface);
  box-shadow: var(--shadow);
}

.map-panel {
  overflow: hidden;
}

#map {
  width: 100%;
  min-height: 650px;
}

.listings-panel {
  min-height: 650px;
  overflow: hidden;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--brand-line);
}

.results-header h3 {
  color: var(--brand-forest);
  font-size: 1.2rem;
}

.result-count {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-forest);
  font-weight: 800;
}

.listings {
  max-height: 588px;
  overflow: auto;
  padding: 14px;
}

.property-card {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 13px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.property-card + .property-card {
  margin-top: 10px;
}

.property-card:hover,
.property-card.active {
  border-color: rgba(167, 119, 24, 0.35);
  background: var(--brand-cream);
  transform: translateY(-1px);
}

.property-card img {
  width: 136px;
  height: 112px;
  object-fit: cover;
  border-radius: 6px;
}

.property-card h4 {
  margin: 6px 0 4px;
  color: var(--brand-forest);
  font-size: 0.98rem;
}

.price {
  color: var(--brand-gold-dark);
  font-size: 1.12rem;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand-forest);
  background: rgba(24, 56, 47, 0.08);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta {
  margin: 0;
  color: var(--brand-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(167, 119, 24, 0.45);
  border-radius: var(--radius);
  color: var(--brand-gold-dark);
  background: rgba(167, 119, 24, 0.08);
  font-weight: 700;
  text-align: center;
}

.sell-section {
  background: var(--brand-panel);
}

.sell-grid,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 30px;
  align-items: center;
}

.sell-grid p,
.contact-grid p {
  color: var(--brand-muted);
}

.seller-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contact-grid {
  align-items: start;
}

.contact-card {
  display: grid;
  gap: 7px;
  max-width: 360px;
  margin-top: 20px;
  padding: 18px;
}

.contact-card a {
  color: var(--brand-gold-dark);
  font-weight: 700;
  text-decoration: none;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.contact-form textarea {
  resize: vertical;
}

.form-note {
  min-height: 22px;
  margin: 0;
  color: var(--brand-forest);
  font-size: 0.9rem;
  font-weight: 700;
}

footer {
  padding: 26px 0;
  color: rgba(255, 255, 255, 0.82);
  background: var(--brand-forest);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-row p {
  margin: 0;
}

.footer-row a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

body.modal-open {
  overflow: hidden;
}

.card-media {
  position: relative;
}

.favorite-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #fff;
  background: rgba(24, 36, 33, 0.58);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.favorite-button:hover {
  transform: translateY(-1px) scale(1.03);
}

.favorite-button.saved {
  color: #fff;
  background: #d63230;
}

.property-card .favorite-button {
  position: absolute;
  top: 8px;
  right: 8px;
}

.photo-count {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(24, 36, 33, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--brand-gold-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.text-button:hover {
  text-decoration: underline;
}

.price-marker {
  background: transparent;
  border: 0;
}

.price-marker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 32px;
  padding: 6px 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-forest);
  box-shadow: 0 8px 20px rgba(24, 36, 33, 0.22);
  font-size: 0.84rem;
  font-weight: 900;
}

.popup-button {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  background: var(--brand-gold);
  cursor: pointer;
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 16, 0.7);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(24, 36, 33, 0.72);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.modal-gallery {
  position: relative;
  min-height: 420px;
  background: #111;
}

.modal-gallery img {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.gallery-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(24, 36, 33, 0.72);
  cursor: pointer;
  font-size: 2rem;
}

.gallery-prev {
  left: 14px;
}

.gallery-next {
  right: 14px;
}

.gallery-count {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(24, 36, 33, 0.74);
  font-size: 0.82rem;
  font-weight: 800;
}

.modal-content {
  padding: 24px;
}

.modal-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.modal-title-row h2 {
  color: var(--brand-forest);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.modal-title-row p {
  margin: 8px 0 0;
  color: var(--brand-muted);
}

.modal-favorite {
  flex: 0 0 auto;
  color: var(--brand-forest);
  border-color: var(--brand-line);
  background: var(--brand-cream);
}

.modal-favorite.saved {
  color: #fff;
  background: #d63230;
}

.modal-price {
  margin-top: 16px;
  color: var(--brand-gold-dark);
  font-size: 1.8rem;
  font-weight: 900;
}

.modal-facts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-facts span {
  padding: 9px 12px;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  color: var(--brand-muted);
  background: var(--brand-cream);
}

.modal-facts strong {
  color: var(--brand-forest);
}

.modal-description {
  max-width: 760px;
  color: var(--brand-muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-cta {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-grid,
  .property-shell,
  .sell-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  #map {
    min-height: 430px;
  }

  .listings-panel {
    min-height: auto;
  }

  .listings {
    max-height: none;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .seller-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .hero-copy {
    padding: 62px 0;
  }

  .search-shell {
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .property-card {
    grid-template-columns: 1fr;
  }

  .property-card img {
    width: 100%;
    height: 190px;
  }

  .btn {
    width: 100%;
  }

  .toolbar label {
    width: 100%;
  }

  .modal {
    padding: 0;
    align-items: stretch;
  }

  .modal-dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-gallery,
  .modal-gallery img {
    min-height: 300px;
    height: 300px;
  }

  .modal-actions .btn {
    width: 100%;
  }
}
