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

:root {
  --navy:      #1A1A2E;
  --navy-mid:  #2E2E4A;
  --gold:      #C9A234;
  --gold-lt:   #E2BC5A;
  --warm:      #F5F2EC;
  --stone:     #888780;
  --green:     #2E7D32;
  --green-bg:  #E8F5E9;
  --amber:     #F57F17;
  --amber-bg:  #FFF8E1;
  --red:       #C62828;
  --red-bg:    #FFEBEE;
  --border:    rgba(201,162,52,0.18);
  --shadow:    0 4px 24px rgba(0,0,0,0.18);
}

html, body { height: 100%; font-family: 'Barlow', sans-serif; font-weight: 300; overflow: hidden; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 60px; background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-wordmark .w1 { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 900; letter-spacing: 3px; color: var(--warm); line-height: 1; }
.nav-wordmark .rule { display: block; height: 1.5px; background: var(--gold); margin: 2px 0; }
.nav-wordmark .w2 { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 900; letter-spacing: 3px; color: var(--gold); line-height: 1; }
.nav-tag { font-size: 10px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); opacity: 0.7; }

.nav-back { font-size: 11px; color: var(--stone); text-decoration: none; letter-spacing: 1px; transition: color .2s; }
.nav-back:hover { color: var(--gold); }

/* ── FILTER BAR ── */
.filter-bar {
  position: fixed; top: 60px; left: 0; right: 0; z-index: 190;
  background: white; padding: 10px 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.filter-btn {
  font-family: 'Barlow', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid #ddd; background: white;
  color: #666; cursor: pointer; transition: all .2s;
}
.filter-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.filter-btn:hover:not(.active) { border-color: var(--gold); color: var(--gold); }

.stats-bar {
  margin-left: auto; display: flex; gap: 16px; align-items: center;
}
.stat { font-size: 11px; color: var(--stone); }
.stat strong { font-weight: 700; }
.stat.green strong { color: var(--green); }
.stat.amber strong { color: var(--amber); }
.stat.red strong { color: var(--red); }

/* ── MAP ── */
#map {
  position: fixed;
  top: 108px; left: 0; right: 0; bottom: 0;
}

/* ── PANEL (plot detail) ── */
.panel {
  position: fixed;
  top: 108px; right: 0; bottom: 0;
  width: 360px;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.12);
  z-index: 150;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel.open { transform: translateX(0); }

/* Photo gallery */
.panel-photos {
  position: relative; height: 200px; flex-shrink: 0;
  background: #c8d8b8; overflow: hidden;
}
.panel-photos img {
  width: 100%; height: 100%; object-fit: cover;
  display: none;
}
.panel-photos img.active { display: block; }

.photo-counter {
  position: absolute; bottom: 8px; right: 10px;
  background: rgba(0,0,0,0.55); color: white;
  font-size: 10px; padding: 3px 8px; border-radius: 3px;
}
.photo-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.4); color: white;
  border: none; cursor: pointer; padding: 8px 12px;
  font-size: 16px; transition: background .2s;
}
.photo-nav:hover { background: rgba(0,0,0,0.7); }
.photo-nav.prev { left: 0; border-radius: 0 4px 4px 0; }
.photo-nav.next { right: 0; border-radius: 4px 0 0 4px; }

.photo-thumbs {
  position: absolute; bottom: 8px; left: 8px;
  display: flex; gap: 4px;
}
.photo-thumbs img {
  width: 36px; height: 26px; object-fit: cover;
  border-radius: 3px; cursor: pointer; opacity: 0.6;
  border: 1.5px solid transparent; display: block;
}
.photo-thumbs img.active { opacity: 1; border-color: var(--gold); }

/* Panel close button */
.panel-close {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.5); color: white;
  border: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 10;
}
.panel-close:hover { background: rgba(0,0,0,0.8); }

/* Panel content */
.panel-content { flex: 1; overflow-y: auto; padding: 16px; }

.panel-status {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.status-badge {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
}
.status-badge.available { background: var(--green-bg); color: var(--green); }
.status-badge.reserved  { background: var(--amber-bg); color: var(--amber); }
.status-badge.sold      { background: var(--red-bg);   color: var(--red); }

.plot-number { font-size: 11px; color: var(--stone); }

.plot-title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.plot-location { font-size: 12px; color: var(--stone); margin-bottom: 12px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.badge {
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 5px;
}
.badge.hati    { background: #E3F2FD; color: #1565C0; }
.badge.survey  { background: #F3E5F5; color: #6A1B9A; }
.badge.kml     { background: #FFF8E1; color: #E65100; }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.detail-cell { background: #f8f8f8; border-radius: 8px; padding: 10px; }
.detail-cell.highlight { background: var(--green-bg); }
.detail-label { font-size: 9px; color: #999; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.detail-value { font-size: 15px; font-weight: 700; color: var(--navy); }
.detail-cell.highlight .detail-label { color: var(--green); }
.detail-cell.highlight .detail-value { color: var(--green); font-size: 13px; }

.plot-notes {
  font-size: 12px; color: var(--stone); line-height: 1.6;
  padding: 10px; background: #fafafa; border-radius: 6px;
  border-left: 3px solid var(--gold); margin-bottom: 16px;
}

/* Buttons */
.btn-whatsapp {
  display: block; width: 100%; padding: 14px;
  background: #25D366; color: white; border: none;
  border-radius: 10px; cursor: pointer; text-decoration: none;
  text-align: center; margin-bottom: 8px;
  transition: background .2s, transform .15s;
}
.btn-whatsapp:hover { background: #20b858; transform: translateY(-1px); }
.btn-whatsapp .btn-main { font-size: 14px; font-weight: 700; display: block; }
.btn-whatsapp .btn-sub { font-size: 10px; color: rgba(255,255,255,0.8); display: block; margin-top: 2px; }

.btn-navigate {
  display: block; width: 100%; padding: 11px;
  background: white; color: var(--navy);
  border: 1px solid #ddd; border-radius: 10px;
  cursor: pointer; text-align: center; text-decoration: none;
  font-size: 12px; font-weight: 600; margin-bottom: 8px;
  transition: border-color .2s, color .2s;
}
.btn-navigate:hover { border-color: var(--navy); }

.btn-share {
  display: block; width: 100%; padding: 11px;
  background: white; color: var(--stone);
  border: 1px solid #eee; border-radius: 10px;
  cursor: pointer; text-align: center;
  font-size: 12px; transition: border-color .2s;
}
.btn-share:hover { border-color: var(--stone); }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .panel { width: 100%; top: auto; height: 85vh; transform: translateY(100%); border-radius: 20px 20px 0 0; }
  .panel.open { transform: translateY(0); }
  .stats-bar { display: none; }
}
