:root {
  --background: #f8f5ef;
  --card: #fffdf9;
  --ink: #2d2822;
  --muted: #82796f;
  --border: #e7ddd0;
  --sand: #f1e9db;
  --gold: #b79256;
  --green: #143c31;
  --shadow-soft: 0 8px 24px rgba(64, 48, 30, .08);
  --shadow-lifted: 0 18px 48px rgba(64, 48, 30, .16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--background); color: var(--ink); font-family: "Karla", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid rgba(217, 205, 188, .8); background: rgba(248,245,239,.92); backdrop-filter: blur(14px); }
.header-inner { max-width: 1600px; margin: auto; padding: 14px 24px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 20px; }
.header-inner > :first-child { min-width: 0; }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .28em; font-size: 16px; }
.desktop-nav { display: inline-flex; gap: 26px; margin-left: 38px; vertical-align: middle; }
.desktop-nav button, .mobile-menu button { border: 0; background: transparent; color: var(--muted); font-size: 14px; padding: 8px 0; }
.desktop-nav button:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.back-link { text-decoration: none; border-radius: 999px; background: var(--ink); color: white; padding: 11px 18px; font-size: 13px; font-weight: 700; }
.menu-button { display: none; border: 1px solid var(--border); background: var(--card); border-radius: 999px; width: 42px; height: 42px; }
.mobile-menu { border-top: 1px solid var(--border); padding: 10px 20px 16px; background: var(--background); }
.mobile-menu button { width: 100%; text-align: left; display: block; padding: 10px 0; }

.hero { border-bottom: 1px solid rgba(217, 205, 188, .8); }
.hero-inner { max-width: 1600px; margin: auto; padding: 48px 24px 44px; }
.eyebrow { margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .30em; }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; letter-spacing: -.01em; }
h1 { margin: 16px 0 0; max-width: 790px; font-size: clamp(44px, 5vw, 72px); line-height: 1.02; }
.hero-copy { margin: 16px 0 0; max-width: 620px; color: var(--muted); line-height: 1.65; }
.search-box { margin-top: 26px; width: min(100%, 560px); height: 52px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 0 20px; background: var(--card); box-shadow: var(--shadow-soft); }
.search-box:focus-within { border-color: var(--gold); }
.search-box span:first-child { font-size: 22px; color: var(--muted); transform: rotate(-15deg); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box input::placeholder { color: #a59c92; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.chip { border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); padding: 9px 15px; transition: .2s ease; }
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.is-active { border-color: var(--ink); background: var(--ink); color: white; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.filter-button { min-height: 44px; border: 1px solid #ded1c1; border-radius: 999px; background: var(--card); color: var(--ink); padding: 0 18px; box-shadow: 0 2px 7px rgba(50,40,28,.05); }
.reset-button { border: 0; background: transparent; color: var(--muted); padding: 8px 0; }
.reset-button:hover { text-decoration: underline; color: var(--ink); }
.result-count { color: var(--muted); font-size: 14px; }

.discovery-layout { max-width: 1600px; margin: auto; display: grid; grid-template-columns: 40% 60%; }
.list-panel { height: calc(100vh - 80px); overflow-y: auto; padding: 24px; border-right: 1px solid var(--border); }
.listing-grid { display: grid; gap: 24px; }
.listing-card { overflow: hidden; border: 1px solid var(--border); border-radius: 28px; background: var(--card); box-shadow: var(--shadow-soft); transition: .28s ease; cursor: pointer; }
.listing-card:hover, .listing-card.is-active { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow-lifted); }
.card-image-wrap { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #eee; }
.card-image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s ease; }
.listing-card:hover .card-image { transform: scale(1.035); }
.badge { position: absolute; left: 16px; top: 16px; border: 1px solid var(--gold); border-radius: 999px; background: rgba(43,38,32,.92); color: #dabb84; padding: 6px 11px; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.featured { position: absolute; right: 16px; top: 16px; border-radius: 999px; background: #c7a161; color: white; padding: 6px 11px; font-size: 10px; letter-spacing: .14em; }
.card-body { padding: 20px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.card-title { margin: 0; font-size: 25px; line-height: 1.05; }
.card-meta { margin: 5px 0 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }
.card-price { flex: 0 0 auto; text-align: right; font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px; }
.card-price small { display: block; margin-top: 2px; color: var(--muted); font-family: "Karla"; font-size: 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { background: var(--sand); color: #5e554b; padding: 5px 9px; border-radius: 999px; font-size: 11px; }
.card-cta { width: 100%; margin-top: 14px; border: 1px solid #d8cbbb; border-radius: 999px; background: transparent; color: var(--ink); padding: 10px 14px; font-weight: 700; }
.card-cta:hover { background: var(--sand); }
.empty-state { border: 1px dashed var(--border); border-radius: 28px; padding: 42px 26px; text-align: center; }
.empty-state h2 { margin: 0; font-size: 30px; }
.empty-state p { color: var(--muted); }
.empty-state button { border: 1px solid var(--border); border-radius: 999px; background: var(--card); padding: 10px 18px; }

.map-panel { position: sticky; top: 72px; height: calc(100vh - 72px); min-height: 560px; background: #ece9e2; }
#map { width: 100%; height: 100%; }
.leaflet-container { font-family: "Karla", Arial, sans-serif; background: #eeece7; }
.leaflet-control-zoom a { color: var(--ink) !important; }
.leaflet-control-attribution { font-size: 9px; }
.price-marker { border: 1px solid #d7c29d; border-radius: 999px; background: white; color: var(--ink); padding: 7px 12px; white-space: nowrap; font-size: 12px; font-weight: 700; box-shadow: 0 6px 18px rgba(43,38,32,.16); transition: .18s ease; }
.price-marker.is-active { background: var(--ink); color: white; border-color: var(--ink); transform: scale(1.04); }
.map-card { position: absolute; z-index: 600; left: 50%; bottom: 24px; width: min(92%, 420px); transform: translateX(-50%); border: 1px solid var(--border); border-radius: 26px; background: var(--card); box-shadow: var(--shadow-lifted); overflow: hidden; }
.map-card-main { display: flex; gap: 13px; padding: 12px; padding-right: 44px; }
.map-card img { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; }
.map-card h3 { margin: 4px 0 0; font-size: 21px; }
.map-card .meta { margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.map-card .price { margin-top: 7px; font-size: 14px; }
.map-card .mini-badge { display: inline-block; margin-top: 6px; border: 1px solid var(--gold); border-radius: 999px; background: var(--ink); color: #dabb84; padding: 3px 7px; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.map-card .close-map-card { position: absolute; top: 11px; right: 11px; width: 30px; height: 30px; border: 0; border-radius: 999px; background: rgba(248,245,239,.96); font-size: 20px; }
.map-card .map-cta { display: block; margin: 0 12px 12px; border-radius: 999px; background: var(--ink); color: white; text-align: center; text-decoration: none; padding: 11px 14px; font-weight: 700; }

.mobile-switch { display: none; }
.filter-dialog { width: min(92vw, 520px); border: 0; border-radius: 28px; padding: 0; color: var(--ink); box-shadow: var(--shadow-lifted); }
.filter-dialog::backdrop { background: rgba(25,22,18,.42); backdrop-filter: blur(4px); }
.filter-sheet { padding: 26px; background: var(--card); }
.filter-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.filter-heading h2 { margin: 6px 0 0; font-size: 34px; }
.close-button { border: 1px solid var(--border); border-radius: 999px; background: var(--background); width: 38px; height: 38px; font-size: 24px; line-height: 1; }
.field-label, .amenities legend { display: block; margin: 24px 0 8px; font-weight: 700; }
.filter-sheet select { width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 14px; background: white; padding: 0 12px; color: var(--ink); }
.price-row { display: flex; justify-content: space-between; align-items: end; gap: 15px; }
#priceRange { width: 100%; accent-color: var(--ink); }
.amenities { border: 0; padding: 0; margin: 0; }
.amenities label { display: inline-flex; align-items: center; gap: 7px; margin: 6px 9px 6px 0; border: 1px solid var(--border); border-radius: 999px; padding: 8px 11px; background: white; }
.amenities input { accent-color: var(--ink); }
.apply-button { width: 100%; margin-top: 24px; border: 0; border-radius: 999px; background: var(--ink); color: white; padding: 13px 16px; font-weight: 700; }

@media (max-width: 1023px) {
  .desktop-nav { display: none; }
  .menu-button { display: inline-grid; place-items: center; }
  .back-link { display: none; }
  .hero-inner { padding: 36px 18px 30px; }
  h1 { font-size: clamp(42px, 10vw, 60px); }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -18px; margin-right: -18px; padding: 0 18px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .discovery-layout { display: block; }
  .list-panel { height: auto; min-height: 55vh; overflow: visible; border-right: 0; padding: 18px 16px 90px; }
  .map-panel { display: none; position: relative; top: auto; height: calc(100vh - 72px); min-height: 520px; }
  .discovery-layout.show-map .list-panel { display: none; }
  .discovery-layout.show-map .map-panel { display: block; }
  .mobile-switch { position: fixed; z-index: 900; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,253,249,.96); padding: 4px; box-shadow: var(--shadow-lifted); backdrop-filter: blur(10px); }
  .mobile-switch button { border: 0; border-radius: 999px; background: transparent; color: var(--muted); padding: 9px 14px; }
  .mobile-switch button.is-active { background: var(--ink); color: white; }
  .map-card { bottom: 82px; }
}
@media (max-width: 620px) {
  .header-inner { padding: 12px 16px; }
  .brand { font-size: 14px; letter-spacing: .22em; }
  .hero-copy { font-size: 15px; }
  .filter-row { gap: 10px; }
  .result-count { width: 100%; }
  .card-heading { display: block; }
  .card-price { margin-top: 8px; text-align: left; }
  .map-card { width: calc(100% - 24px); }
  .map-card img { width: 84px; height: 84px; }
}
