/* UI Components, Floating Modern Dock Widgets & Hero Overlay */

/* =========================================================
   HERO OVERLAY (AERIAL LAND BACKGROUND & ELEGANT TYPOGRAPHY)
   ========================================================= */
.hero-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--ab-z-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(rgba(248, 250, 252, 0.65), rgba(248, 250, 252, 0.75)), image-set(url('../assets/hero-bg.avif') type('image/avif'), url('../assets/hero-bg.webp') type('image/webp')) center/cover no-repeat;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s ease;
}

.hero-overlay.hero-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero-overlay:not(.hero-hidden) + #map-application { visibility:hidden; }

.hero-card {
  max-width: 540px;
  width: 100%;
  padding: 44px 36px;
  border-radius: var(--ab-radius-lg);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 70px rgba(6, 78, 59, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  text-align: center;
  color: #0f172a;
}

.hero-logo-wrapper {
  margin: 0 auto 20px auto;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-wrapper img {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

.hero-headline {
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-xl);
  font-weight: 800;
  color: var(--ab-brand-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero-description {
  font-size: var(--ab-text-sm);
  line-height: 1.75;
  color: #334155;
  margin-bottom: 28px;
  font-weight: 500;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 32px;
  border-radius: var(--ab-radius-pill);
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #ffffff;
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-base);
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 28px rgba(6, 78, 59, 0.38);
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(6, 78, 59, 0.48);
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

/* =========================================================
   ULTRA-MODERN FLOATING DOCK WIDGET (PROPORTIONED FOR 3 & 4 DIGITS)
   ========================================================= */

.map-bottom-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--ab-z-controls);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Floating Island Glass Container */
.dock-widget-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: var(--ab-glass-bg);
  backdrop-filter: var(--ab-glass-blur);
  -webkit-backdrop-filter: var(--ab-glass-blur);
  border: 1px solid var(--ab-glass-border);
  box-shadow: var(--ab-glass-shadow);
  min-width: 270px;
}

.dock-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

/* Dynamic Filter Trigger Pill with Auto-Expanding Digit Badge */
.btn-dock-filter {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--ab-radius-pill);
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #ffffff;
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-xs);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.3);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

.btn-dock-filter:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  transform: scale(1.02);
}

/* Auto-Expanding Dynamic Badge (Supports 1 to 5 Digits cleanly!) */
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: #f59e0b;
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Segmented Display Switcher [ Price | Area ] Floating Pill */
.display-switcher {
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--ab-radius-pill);
  background: rgba(6, 78, 59, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.switcher-option {
  padding: 6px 14px;
  border-radius: var(--ab-radius-pill);
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-xs);
  font-weight: 800;
  color: #475569;
  transition: all 0.2s ease;
}

.switcher-option.active {
  background: var(--ab-brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(6, 78, 59, 0.35);
}

/* Equal Proportioned 2-Column Metric Stat Grid */
.dock-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.metric-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 14px;
  transition: all 0.2s ease;
  min-width: 0;
}

.metric-stat-box.avail {
  background: rgba(6, 78, 59, 0.08);
  border: 1px solid rgba(6, 78, 59, 0.16);
}

.metric-stat-box.sold {
  background: rgba(194, 65, 12, 0.08);
  border: 1px solid rgba(194, 65, 12, 0.16);
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.metric-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.metric-badge-dot.avail { background: var(--ab-color-available); box-shadow: 0 0 6px var(--ab-color-available-glow); }
.metric-badge-dot.sold { background: var(--ab-color-sold); box-shadow: 0 0 6px var(--ab-color-sold-glow); }

.stat-label {
  font-family: var(--ab-font-sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-label.avail { color: var(--ab-color-available); }
.stat-label.sold { color: var(--ab-color-sold); }

.stat-number {
  font-family: var(--ab-font-sans);
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}
.stat-number.avail { color: var(--ab-color-available); }
.stat-number.sold { color: var(--ab-color-sold); }

/* Legend (Bottom-Left: Clean Circular Swatches!) */
.map-legend {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: var(--ab-z-controls);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 20px;
  border-radius: var(--ab-radius-pill);
  background: var(--ab-glass-bg);
  backdrop-filter: var(--ab-glass-blur);
  border: 1px solid var(--ab-glass-border);
  box-shadow: var(--ab-glass-shadow);
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-xs);
  font-weight: 700;
  color: #334155;
}

.legend-swatch {
  display: inline-block;
  width: 100px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

/* Fix width: 10px override to ensure clean circular swatches */
.legend-swatch {
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  margin-right: 6px !important;
}

/* =========================================================
   PROPERTY DETAILS PANEL (DESKTOP)
   ========================================================= */
#details-panel {
  position: fixed;
  top: calc(var(--header-height,78px) + env(safe-area-inset-top) + 12px);
  left: 24px;
  bottom: calc(var(--footer-height,64px) + env(safe-area-inset-bottom) + 12px);
  width: 450px;
  z-index: var(--ab-z-details-panel);
  border-radius: var(--ab-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

#details-panel[hidden] { display: none !important; visibility: hidden; pointer-events: none; }

.panel-header {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--ab-radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.badge-available { background: var(--ab-color-available); color: #ffffff; }
.badge-sold { background: var(--ab-color-sold); color: #ffffff; }

.panel-title {
  font-size: var(--ab-text-lg);
  font-weight: 800;
  color: var(--ab-brand-primary);
  line-height: 1.3;
}

.panel-location {
  font-size: var(--ab-text-xs);
  color: #64748b;
  margin-top: 4px;
  font-weight: 600;
}

.btn-close-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  color: #64748b;
  font-size: 16px;
  transition: background 0.2s;
}

.btn-close-panel:hover {
  background: rgba(0,0,0,0.12);
  color: var(--ab-brand-primary);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.financial-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
  background: rgba(6, 78, 59, 0.05);
  border-radius: var(--ab-radius-md);
  border: 1px solid rgba(6, 78, 59, 0.14);
}

.summary-card {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 700;
}

.summary-value {
  font-size: var(--ab-text-base);
  font-weight: 800;
  color: var(--ab-brand-primary);
}

.summary-value.accent {
  color: var(--ab-brand-gold);
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-heading {
  font-size: var(--ab-text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding-bottom: 6px;
}

.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.highlights-list li {
  font-size: var(--ab-text-xs);
  color: #334155;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  font-weight: 500;
}

.highlights-list li::before {
  content: "•";
  color: var(--ab-brand-primary);
  font-weight: bold;
  font-size: 14px;
}

.attributes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ab-text-xs);
}

.attributes-table tr {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.attributes-table td {
  padding: 8px 0;
}

.attributes-table td.attr-name {
  color: #64748b;
  width: 45%;
  font-weight: 500;
}

.attributes-table td.attr-val {
  font-weight: 700;
  color: #0f172a;
}

.panel-footer {
  padding: 18px 24px;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: var(--ab-glass-bg);
  position: relative;
  z-index: var(--ab-z-panel-actions);
  flex: 0 0 auto;
}

.btn-enquire-full {
  width: 100%;
  padding: 15px;
  border-radius: var(--ab-radius-md);
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #ffffff;
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  box-shadow: 0 6px 18px rgba(6, 78, 59, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-enquire-full:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 24px rgba(6, 78, 59, 0.45);
}

/* =========================================================
   FLOATING FILTER DRAWER
   ========================================================= */
#filter-drawer {
  position: fixed;
  top: calc(var(--header-height,78px) + env(safe-area-inset-top) + 12px);
  right: 24px;
  bottom: calc(var(--footer-height,64px) + env(safe-area-inset-bottom) + 12px);
  width: 390px;
  z-index: var(--ab-z-details-panel);
  border-radius: var(--ab-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

#filter-drawer[hidden] { display: none !important; visibility: hidden; pointer-events: none; }

@media (max-width: 767px) {
  #filter-drawer,#details-panel {
    top:calc(var(--header-height,64px) + env(safe-area-inset-top)); right:0; bottom:calc(var(--footer-height,78px) + env(safe-area-inset-bottom)); left:0;
    width:100vw; height:auto; max-height:calc(100vh - var(--header-height,64px) - var(--footer-height,78px)); max-height:calc(100dvh - var(--header-height,64px) - var(--footer-height,78px) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius:12px 12px 0 0;
  }
}

.drawer-header {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-lg);
  font-weight: 800;
  color: var(--ab-brand-primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-footer {
  padding: 18px 24px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ab-glass-bg);
  position: relative;
  z-index: var(--ab-z-panel-actions);
  flex: 0 0 auto;
}

.btn-reset-filters {
  padding: 12px 18px;
  border-radius: var(--ab-radius-md);
  border: 1px solid rgba(6, 78, 59, 0.25);
  color: var(--ab-brand-primary);
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-xs);
  font-weight: 700;
  transition: background 0.2s;
}

.btn-reset-filters:hover {
  background: rgba(6, 78, 59, 0.08);
}

.btn-apply-filters {
  flex: 1;
  padding: 12px;
  border-radius: var(--ab-radius-md);
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #ffffff;
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-xs);
  font-weight: 700;
  transition: background 0.2s;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.3);
}

.btn-apply-filters:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-scrim {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--ab-z-modals);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-card {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--ab-radius-lg);
  background: #ffffff;
  box-shadow: 0 25px 70px rgba(6, 78, 59, 0.22);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-scrim.modal-active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 22px 26px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--ab-font-sans);
  font-size: var(--ab-text-lg);
  font-weight: 800;
  color: var(--ab-brand-primary);
}

.modal-body {
  padding: 26px;
  overflow-y: auto;
}
