/* ── ROOT & RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #1a2535;
  --slate:  #2e3d52;
  --accent: #2a7a4b;
  --accent-light: #3d9e63;
  --gold:   #c8a84b;
  --cream:  #f8f6f2;
  --muted:  #6b7a8d;
  --border: #e2e8f0;
  --white:  #ffffff;
  --card-shadow: 0 4px 24px rgba(26,37,53,0.09);
  --radius: 12px;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--navy); background: var(--white); line-height: 1.6; }

img { display: block; max-width: 100%; }
a  { text-decoration: none; color: inherit; }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
em { font-style: italic; color: var(--accent); }

.section-eyebrow {
  font-size: .75rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .5rem;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block; padding: .75rem 1.75rem;
  background: var(--accent); color: var(--white);
  border-radius: 8px; font-weight: 600; font-size: .95rem;
  border: none; cursor: pointer; transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-primary.full-width { width: 100%; text-align: center; }

.btn-ghost {
  display: inline-block; padding: .75rem 1.75rem;
  border: 2px solid rgba(255,255,255,.5); color: var(--white);
  border-radius: 8px; font-weight: 600; font-size: .95rem;
  transition: background .2s, border-color .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: var(--white); }

.btn-nav {
  padding: .5rem 1.25rem; background: var(--accent);
  color: var(--white) !important; border-radius: 8px;
  font-weight: 600; transition: background .2s;
}
.btn-nav:hover { background: var(--accent-light); }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
}
.logo { font-family: var(--font-serif); font-size: 1.4rem; color: var(--navy); }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-weight: 500; color: var(--slate); transition: color .2s; font-size: .95rem; }
.nav-links a:hover { color: var(--accent); }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--navy); border-radius: 2px; transition: .3s; }

.mobile-menu {
  display: none; flex-direction: column; gap: 0;
  background: var(--white); border-top: 1px solid var(--border);
  padding: 1rem 2rem;
}
.mobile-menu a { padding: .75rem 0; border-bottom: 1px solid var(--border); font-weight: 500; color: var(--slate); }
.mobile-menu.open { display: flex; }

/* ── HERO ── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 8rem 2rem 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, var(--navy) 0%, #243447 50%, #1e3a2f 100%);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; text-align: center; }
.hero-eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.hero-headline { font-size: clamp(2.5rem, 6vw, 4.5rem); color: var(--white); margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.1rem; color: rgba(255,255,255,.7); max-width: 520px; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  position: relative; z-index: 1;
  display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
  margin-top: 4rem; padding-top: 3rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.stat { text-align: center; }
.stat-num { display: block; font-family: var(--font-serif); font-size: 2.25rem; color: var(--white); }
.stat-label { font-size: .8rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .1em; }

/* ── FILTER BAR ── */
.filter-bar { background: var(--cream); border-bottom: 1px solid var(--border); padding: 1.5rem 2rem; }
.filter-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 140px; }
.filter-group label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.filter-group select {
  padding: .65rem 1rem; border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--font-sans); font-size: .95rem;
  background: var(--white); color: var(--navy); cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 2rem;
}
.filter-group select:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ── LISTINGS SECTION ── */
.listings-section { padding: 4rem 2rem; max-width: 1200px; margin: 0 auto; }
.section-header { margin-bottom: 2.5rem; }
.section-header h2 { margin-bottom: .35rem; }
.section-header p { color: var(--muted); }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.75rem;
}

/* ── LISTING CARD ── */
.listing-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--card-shadow); overflow: hidden;
  transition: transform .25s, box-shadow .25s; cursor: pointer;
}
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(26,37,53,0.14); }

.card-image {
  height: 200px; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; position: relative; overflow: hidden;
}
.card-badge {
  position: absolute; top: 12px; left: 12px;
  padding: .25rem .75rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.badge-sale   { background: var(--accent); color: var(--white); }
.badge-pending { background: var(--gold); color: var(--navy); }
.badge-sold   { background: var(--muted); color: var(--white); }

.card-fave {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.9); border: none; border-radius: 50%;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; transition: transform .2s;
}
.card-fave:hover { transform: scale(1.2); }
.card-fave.active { color: #e55; }

.card-body { padding: 1.25rem; }
.card-price { font-family: var(--font-serif); font-size: 1.5rem; color: var(--navy); margin-bottom: .25rem; }
.card-address { font-size: .9rem; color: var(--muted); margin-bottom: .85rem; }
.card-meta { display: flex; gap: 1.25rem; font-size: .82rem; color: var(--slate); border-top: 1px solid var(--border); padding-top: .85rem; margin-top: .5rem; }
.card-meta span { display: flex; align-items: center; gap: .3rem; }

/* ── MAP SECTION ── */
.map-section {
  background: var(--cream); padding: 4rem 2rem;
}
.map-section .section-header { max-width: 1200px; margin: 0 auto 2rem; }

.map-layout {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem;
  align-items: start;
}
#map {
  height: 520px; border-radius: var(--radius);
  box-shadow: var(--card-shadow); z-index: 1;
  border: 1px solid var(--border);
}
.map-sidebar {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--card-shadow); padding: 1.5rem;
  min-height: 200px; border: 1px solid var(--border);
}
.sidebar-placeholder { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.sidebar-placeholder svg { margin: 0 auto 1rem; opacity: .4; }
.sidebar-placeholder p { font-size: .9rem; line-height: 1.5; }

.sidebar-card h3 { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: .25rem; }
.sidebar-card .s-price { font-size: 1.6rem; font-family: var(--font-serif); color: var(--accent); margin-bottom: .5rem; }
.sidebar-card .s-address { color: var(--muted); font-size: .88rem; margin-bottom: 1rem; }
.sidebar-card .s-meta { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.sidebar-card .s-tag {
  background: var(--cream); border-radius: 6px;
  padding: .25rem .65rem; font-size: .8rem; color: var(--slate);
}
.sidebar-card .s-desc { font-size: .88rem; color: var(--muted); line-height: 1.6; margin-bottom: 1.25rem; }
.sidebar-card .btn-primary { width: 100%; text-align: center; }
.sidebar-img { height: 150px; border-radius: 8px; margin-bottom: 1rem; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }

/* Leaflet popup customization */
.leaflet-popup-content-wrapper { border-radius: 10px !important; box-shadow: var(--card-shadow) !important; border: 1px solid var(--border); }
.leaflet-popup-content { font-family: var(--font-sans) !important; font-size: .88rem !important; }
.popup-inner strong { font-family: var(--font-serif); font-size: 1rem; }
.popup-inner p { color: var(--muted); font-size: .8rem; margin-top: .2rem; }

/* ── ABOUT ── */
.about-section { padding: 5rem 2rem; }
.about-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.about-text h2 { margin-bottom: 1rem; }
.about-text p { color: var(--muted); margin-bottom: 1.5rem; font-size: 1.02rem; }
.about-bullets { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.about-bullets li { display: flex; align-items: center; gap: .65rem; font-size: .95rem; }
.about-bullets li span { color: var(--accent); font-weight: 700; }

.about-cards { display: flex; flex-direction: column; gap: 1rem; }
.agent-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
}
.agent-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--navy); flex-shrink: 0;
}
.agent-info { display: flex; flex-direction: column; }
.agent-info strong { font-size: .95rem; }
.agent-info span { font-size: .8rem; color: var(--muted); }

/* ── CONTACT ── */
.contact-section { background: var(--navy); padding: 5rem 2rem; }
.contact-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start;
}
.contact-text .section-eyebrow { color: var(--gold); }
.contact-text h2 { color: var(--white); margin-bottom: 1rem; }
.contact-text > p { color: rgba(255,255,255,.6); margin-bottom: 2rem; }

.contact-details { display: flex; flex-direction: column; gap: 1rem; }
.contact-details div { display: flex; flex-direction: column; }
.contact-details strong { color: rgba(255,255,255,.5); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.contact-details span { color: var(--white); font-size: .95rem; }

.contact-form { display: flex; flex-direction: column; gap: .9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.contact-form input,
.contact-form textarea {
  padding: .85rem 1rem; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  color: var(--white); font-family: var(--font-sans); font-size: .95rem;
  transition: border-color .2s;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(255,255,255,.35); }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form textarea { resize: vertical; }

/* ── FOOTER ── */
.footer { background: #0f1720; padding: 2rem; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer .logo { color: rgba(255,255,255,.7); font-size: 1.15rem; }
.footer .logo span { color: var(--accent); }
.footer p { color: rgba(255,255,255,.35); font-size: .85rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255,255,255,.4); font-size: .85rem; transition: color .2s; }
.footer-links a:hover { color: rgba(255,255,255,.8); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-sidebar { min-height: auto; }
  .about-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 680px) {
  /* Nav */
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-inner { padding: .85rem 1.25rem; }

  /* Hero */
  .hero { padding: 6rem 1.25rem 3rem; min-height: auto; }
  .hero-headline { font-size: 2.4rem; }
  .hero-sub { font-size: .97rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta a { width: 100%; max-width: 280px; text-align: center; }
  .hero-stats { flex-direction: row; gap: 1rem; padding-top: 2rem; margin-top: 2.5rem; justify-content: space-around; }
  .stat-num { font-size: 1.65rem; }
  .stat-label { font-size: .7rem; }

  /* Filter */
  .filter-bar { padding: 1.25rem; }
  .filter-inner { flex-direction: column; gap: .75rem; }
  .filter-group { min-width: unset; width: 100%; }
  .filter-group select { width: 100%; }
  #applyFilter { width: 100%; padding: .85rem; }

  /* Listings */
  .listings-section { padding: 2.5rem 1.25rem; }
  .listings-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .section-header { margin-bottom: 1.5rem; }
  .card-image { height: 170px; }

  /* Map */
  .map-section { padding: 2.5rem 1.25rem; }
  #map { height: 320px; border-radius: 10px; }
  .map-sidebar { padding: 1.25rem; }
  .sidebar-img { height: 120px; }

  /* About */
  .about-section { padding: 3rem 1.25rem; }
  .about-inner { gap: 2rem; }
  .about-text p { font-size: .95rem; }

  /* Contact */
  .contact-section { padding: 3rem 1.25rem; }
  .contact-inner { gap: 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form input,
  .contact-form textarea { font-size: 1rem; } /* prevent iOS zoom */

  /* Footer */
  .footer { padding: 1.5rem 1.25rem; }
  .footer-inner { flex-direction: column; text-align: center; gap: .75rem; }
  .footer-links { justify-content: center; flex-wrap: wrap; gap: 1rem; }

  /* General */
  h2 { font-size: 1.65rem; }
  .btn-primary, .btn-ghost { padding: .85rem 1.5rem; font-size: .95rem; }
}

@media (max-width: 380px) {
  .hero-headline { font-size: 2rem; }
  .hero-stats { flex-wrap: wrap; }
  .stat { min-width: 30%; }
}
