/* ==========================================================================
   FORMA ESTATE — ARCHITECTURAL LUXURY REAL ESTATE STYLES
   ========================================================================== */

:root {
  --bg-warm: #FAF9F6;
  --bg-surface: #F2EFE9;
  --bg-card: #FFFFFF;
  --bg-dark: #121416;
  --text-dark: #141618;
  --text-muted: #6B7280;
  --border-light: #E5E0D8;
  --border-dark: #2A2E33;
  --accent-gold: #C5A880;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-warm);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-padding {
  padding: 100px 0;
}

.bg-warm {
  background-color: var(--bg-surface);
}

.bg-dark {
  background-color: var(--bg-dark);
}

.text-white {
  color: #FFFFFF !important;
}

.text-muted-light {
  color: #9CA3AF !important;
}

.text-center {
  text-align: center;
}

/* CAPABLE DEMO Bar */
.capable-demo-bar {
  background: #000000;
  color: #FFFFFF;
  font-size: 0.8rem;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.demo-bar-badge {
  background: var(--accent-gold);
  color: #121212;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  margin-right: 8px;
}

.demo-bar-text {
  color: #B5B2AC;
}

.demo-bar-back-btn {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.demo-bar-back-btn:hover {
  color: #FFFFFF;
}

/* Header */
.estate-header {
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 37px;
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 0.12em;
}

.estate-nav {
  display: flex;
  gap: 32px;
}

.estate-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.estate-nav a:hover {
  color: var(--text-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wishlist-btn {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
}

.wishlist-btn .badge {
  background: var(--text-dark);
  color: #FFF;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-dark {
  background: var(--text-dark);
  color: #FFFFFF;
}

.btn-dark:hover {
  background: #2D3238;
  transform: translateY(-2px);
}

.btn-outline {
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  color: var(--text-dark);
}

.btn-outline:hover {
  border-color: var(--text-dark);
  transform: translateY(-2px);
}

.btn-gold {
  background: var(--accent-gold);
  color: #121212;
  font-weight: 700;
}

.btn-gold:hover {
  background: #D8BD98;
}

/* Hero Section */
.hero-section {
  padding: 90px 0 110px 0;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-tag {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  display: block;
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 4.8vw, 4.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual-col {
  position: relative;
}

.hero-image-card {
  position: relative;
  height: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-light);
}

.hero-estate-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-image-card:hover .hero-estate-photo {
  transform: scale(1.03);
}

.hero-stats-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(18, 20, 22, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  color: #FFFFFF;
}

.hero-stats-overlay .hero-metric {
  border-left: 2px solid var(--accent-gold);
  padding-left: 14px;
}

.hero-stats-overlay .metric-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1;
  margin-bottom: 4px;
}

.hero-stats-overlay .metric-label {
  font-size: 0.72rem;
  color: #B5B2AC;
  line-height: 1.3;
}

/* Section Header */
.section-header {
  max-width: 720px;
  margin: 0 auto 56px auto;
  text-align: center;
}

.section-tag {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.tag-gold {
  color: var(--accent-gold);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.4vw, 3rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Filter Panel */
.filter-panel {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 24px;
  margin-bottom: 40px;
}

.filter-types {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.type-pill {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.type-pill.active, .type-pill:hover {
  background: var(--text-dark);
  color: #FFFFFF;
  border-color: var(--text-dark);
}

.filter-inputs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.filter-item label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.filter-select {
  width: 100%;
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  cursor: pointer;
}

/* Estates Grid */
.estates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.estate-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.estate-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.estate-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #EAE6DF;
  overflow: hidden;
}

.estate-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.estate-card:hover .estate-card-photo {
  transform: scale(1.06);
}

.estate-tag-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(18, 20, 22, 0.8);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.estate-wish-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition), color var(--transition);
}

.estate-wish-btn.active {
  color: #EF4444;
}

.estate-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.estate-district {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.estate-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.estate-specs-row {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.estate-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.estate-price {
  font-weight: 800;
  font-size: 1.1rem;
}

.btn-details {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
}

/* 3D Section */
.threed-estate-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  background: #181A1D;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-dark);
  padding: 32px;
  align-items: center;
}

.threed-canvas-holder {
  height: 400px;
  background: radial-gradient(circle at center, #24282F 0%, #121417 100%);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

#estateThreeCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
}

#estateThreeCanvas:active {
  cursor: grabbing;
}

.threed-hotspot-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.threed-hotspot-btn {
  background: rgba(18, 20, 23, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2DFD8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.threed-hotspot-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-gold);
}

.threed-hotspot-btn.active {
  background: var(--accent-gold);
  color: #121417;
  border-color: var(--accent-gold);
}

.hotspot-badge-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  background: rgba(197, 168, 128, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.threed-estate-meta h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.threed-estate-meta p {
  color: var(--text-muted-light);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.threed-specs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 28px;
  color: #D1D5DB;
}

/* Map Section */
.map-interactive-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
}

.mock-vector-map {
  position: relative;
  height: 420px;
  background: #EDEAE4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-image: 
    linear-gradient(#E2DFD8 1px, transparent 1px),
    linear-gradient(90deg, #E2DFD8 1px, transparent 1px);
  background-size: 40px 40px;
}

.map-river {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 45%;
  width: 80px;
  background: rgba(180, 200, 220, 0.4);
  transform: skewX(-20deg);
  border-left: 2px solid rgba(160, 185, 210, 0.5);
  border-right: 2px solid rgba(160, 185, 210, 0.5);
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
}

.pin-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--text-dark);
  color: var(--accent-gold);
  border-radius: 50%;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition);
}

.map-pin:hover .pin-dot {
  transform: scale(1.2);
  background: var(--accent-gold);
  color: #121212;
}

.pin-popup {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 20, 22, 0.9);
  backdrop-filter: blur(6px);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  pointer-events: none;
}

/* Viewing Form */
.viewing-card {
  max-width: 800px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 48px;
}

.viewing-header {
  text-align: center;
  margin-bottom: 32px;
}

.viewing-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 8px 0;
}

.viewing-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.form-toast-msg {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
  display: none;
}

.form-toast-msg.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid #10B981;
}

/* Modal */
.estate-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.estate-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 2;
  padding: 40px;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Toast */
.estate-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-dark);
  color: #FFFFFF;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition);
}

.estate-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.estate-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border-light);
  padding: 48px 0;
}

.footer-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-link {
  color: var(--accent-gold);
  font-weight: 700;
}

@media (max-width: 1100px) {
  .estates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .threed-estate-card {
    grid-template-columns: 1fr;
  }
  .hero-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .estate-nav {
    display: none;
  }
  .estates-grid {
    grid-template-columns: 1fr;
  }
  .filter-inputs-row {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
