/* ========== FONTS ========== */
@font-face { font-family: 'Suisse Intl'; src: url('../fonts/SuisseIntl-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Suisse Intl'; src: url('../fonts/SuisseIntl-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Suisse Intl'; src: url('../fonts/SuisseIntl-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Suisse Intl'; src: url('../fonts/SuisseIntl-Semibold.woff2') format('woff2'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Suisse Intl'; src: url('../fonts/SuisseIntl-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Suisse Intl'; src: url('../fonts/SuisseIntl-Book.woff2') format('woff2'); font-weight: 350; font-style: normal; }

/* ========== RESET & BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: 'Suisse Intl', sans-serif; font-weight: 300; color: #222; background: #222; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

:root {
  --dark: #222222;
  --dark2: #2b2b2b;
  --cream: #f5f2eb;
  --white: #ffffff;
  --accent: #fe5639;
  --accent-blue: #4778f6;
  --text-secondary: #595959;
  --text-tertiary: #b8b8b8;
  --stroke: #e6e6e6;
  --overlay: rgba(34,34,34,0.4);
  --overlay2: rgba(34,34,34,0.6);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== LOADING SCREEN ========== */
#loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
#loader.hide {
  opacity: 0; transform: translateY(-40px); pointer-events: none;
}
#loader .logo-wrap {
  opacity: 0; transform: scale(0.85);
  animation: logoIn 1s var(--ease) 0.3s forwards;
}
#loader .logo-wrap svg,
#loader .logo-wrap img { width: 220px; height: auto; display: block; }
#loader .city-title {
  display: block;
  width: 260px; height: auto;
  margin-top: 28px;
  /* New Mira Hills logo ships black-on-light, so invert it for the dark loader. */
  filter: invert(1);
  opacity: 0; transform: translateY(15px);
  animation: fadeUp 0.8s var(--ease) 0.9s forwards;
}
#loader .tagline {
  font-size: 14px; letter-spacing: 0.12em; color: var(--text-tertiary);
  margin-top: 12px; text-transform: uppercase; opacity: 0;
  animation: fadeUp 0.8s var(--ease) 1.3s forwards;
}
#loader .progress-bar {
  position: absolute; bottom: 60px; width: 180px; height: 1px;
  background: rgba(255,255,255,0.15); border-radius: 1px; overflow: hidden;
}
#loader .progress-bar::after {
  content: ''; position: absolute; left: 0; top: 0; height: 100%;
  background: var(--white); border-radius: 1px;
  animation: progressFill 2.2s var(--ease) 0.4s forwards;
  width: 0;
}

@keyframes logoIn { to { opacity: 1; transform: scale(1); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes progressFill { to { width: 100%; } }

/* ========== APP CONTAINER ========== */
#app { width: 100%; height: 100%; position: relative; overflow: hidden; }

/* ========== HEADER ========== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 40px; pointer-events: none;
}
.app-header > * { pointer-events: auto; }
.app-header .logo svg { width: 120px; height: auto; opacity: 0.9; transition: opacity 0.3s; }
.app-header .logo:hover svg { opacity: 1; }
.app-header .step-indicator {
  font-size: 13px; letter-spacing: 0.08em; color: rgba(255,255,255,0.7);
  text-transform: uppercase; transition: color 0.4s;
}
.app-header.on-cream .step-indicator { color: var(--text-secondary); }
.app-header.on-cream .logo img { filter: invert(1); }

/* ========== BACK BUTTON ========== */
.back-btn {
  position: fixed; top: 28px; left: 180px; z-index: 101;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; letter-spacing: 0.04em; color: rgba(255,255,255,0.7);
  opacity: 0; pointer-events: none; transition: all 0.4s var(--ease);
  text-transform: uppercase;
}
.back-btn.visible { opacity: 1; pointer-events: auto; }
.back-btn:hover { color: var(--white); }
.back-btn.on-cream { color: var(--text-secondary); }
.back-btn.on-cream:hover { color: var(--dark); }
.back-btn svg { width: 16px; height: 16px; }

/* ========== MAP VIEW ========== */
#mapView {
  width: 100%; height: 100%; position: relative;
  overflow: hidden; cursor: grab; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
#mapView.dragging { cursor: grabbing; }
#mapWrapper {
  position: absolute;
  transform-origin: 0 0;
  /* Sized by JS to match image cover dimensions */
}
#mapWrapper.animate {
  transition: transform 0.8s var(--ease);
}
.map-bg {
  width: 100%; height: 100%;
  position: absolute; inset: 0;
  transition: filter 0.8s var(--ease);
}
.map-bg.zoomed { filter: brightness(0.6); }

.map-overlay {
  position: absolute; inset: 0;
}
.map-overlay svg { width: 100%; height: 100%; position: absolute; inset: 0; }
.map-overlay svg path {
  fill: rgba(255,255,255,0.04); stroke: rgba(255,255,255,0.25); stroke-width: 2;
  cursor: pointer;
  transition: fill 0.35s var(--ease), stroke 0.35s var(--ease), filter 0.35s var(--ease), opacity 0.35s var(--ease);
}
/* Saleable plot default: white tint */
.map-overlay svg path.zone-apartments,
.map-overlay svg path.zone-villas,
.map-overlay svg path.zone-townhouses,
.map-overlay svg path.zone-branded { fill: rgba(255,255,255,0.08); stroke: rgba(255,255,255,0.55); stroke-width: 2.5; }
/* Branded residences: subtle gold accent so they read as premium */
.map-overlay svg path.zone-branded { stroke: rgba(212,175,108,0.7); }
/* Amenities / non-saleable: blue (community amenity, villas, lakeview) */
.map-overlay svg path.amenity { fill: rgba(71,120,246,0.05); stroke: rgba(71,120,246,0.15); cursor: pointer; }
/* Unavailable: not on the saleable whitelist and not an amenity. Hidden
   visually and removed from the hit area entirely. */
.map-overlay svg path.unavailable {
  fill: transparent;
  stroke: transparent;
  pointer-events: none;
  cursor: default;
}
/* Restricted: red — villas, branded residences. Hover-only, not clickable. */
.map-overlay svg path.restricted {
  fill: rgba(220,60,60,0.12);
  stroke: rgba(220,60,60,0.55);
  stroke-width: 2;
  cursor: default;
}
.map-overlay svg path.restricted:hover {
  fill: rgba(220,60,60,0.28);
  stroke: rgba(220,60,60,0.9);
  filter: drop-shadow(0 0 10px rgba(220,60,60,0.3));
}
/* Hover: white glow for saleable plots, blue for amenities */
.map-overlay svg path:hover,
.map-overlay svg path.zone-apartments:hover,
.map-overlay svg path.zone-villas:hover,
.map-overlay svg path.zone-townhouses:hover,
.map-overlay svg path.zone-branded:hover {
  fill: rgba(255,255,255,0.15);
  stroke: rgba(255,255,255,0.5);
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.25));
}
.map-overlay svg path.zone-branded:hover { stroke: rgba(212,175,108,0.95); filter: drop-shadow(0 0 12px rgba(212,175,108,0.35)); }
.map-overlay svg path.amenity:hover {
  fill: rgba(71,120,246,0.2);
  stroke: rgba(71,120,246,0.5);
  filter: drop-shadow(0 0 8px rgba(71,120,246,0.3));
}
/* Selected: white for zones, blue for amenities */
.map-overlay svg path.selected {
  fill: rgba(255,255,255,0.25);
  stroke: rgba(255,255,255,0.8);
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.3));
}
.map-overlay svg path.amenity.selected {
  fill: rgba(71,120,246,0.35);
  stroke: rgba(71,120,246,0.9);
  filter: drop-shadow(0 0 18px rgba(71,120,246,0.5));
}
/* Multi-select highlight: persistent orange ring while a saleable plot is
   queued. Uses the brand accent (#fe5639). */
.map-overlay svg path.multi-selected {
  fill: rgba(254,86,57,0.28);
  stroke: rgba(254,86,57,0.95);
  stroke-width: 3;
  filter: drop-shadow(0 0 14px rgba(254,86,57,0.45));
}
.map-overlay svg path.multi-selected:hover {
  fill: rgba(254,86,57,0.4);
  stroke: rgba(254,86,57,1);
  filter: drop-shadow(0 0 18px rgba(254,86,57,0.6));
}

/* ========== HOVER ADD/REMOVE BADGE ========== */
.hover-badge { pointer-events: none; }
.hover-badge circle {
  fill: var(--accent);
  fill-opacity: 0.95;
  stroke: #fff;
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.hover-badge.is-remove circle {
  fill: #1a1a1a;
  fill-opacity: 0.92;
}
.hover-badge line {
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
}
.hover-badge.is-remove .sign-v { display: none; }
.map-overlay svg path.dimmed { opacity: 0.15; pointer-events: none; }
/* Mobile preview-card target: keep the tapped saleable plot findable while
   the bottom sheet is open. */
.map-overlay svg path.previewing {
  fill: rgba(254,86,57,0.22);
  stroke: rgba(254,86,57,0.95);
  stroke-width: 3;
  filter: drop-shadow(0 0 14px rgba(254,86,57,0.5));
  animation: previewPulse 1.6s ease-in-out infinite;
}
@keyframes previewPulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(254,86,57,0.35)); }
  50%      { filter: drop-shadow(0 0 18px rgba(254,86,57,0.7)); }
}

/* ========== APARTMENT BUILDING OVERLAY ========== */
.apt-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0;
  transition: opacity 0.5s var(--ease);
  z-index: 2;
}
/* Detail mode: overlay always visible, individual paths controlled */
.apt-overlay.detail-mode { opacity: 1; }
/* When zoomed out: hide all unselected buildings */
.apt-overlay.detail-mode .apt-building {
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease), fill 0.3s var(--ease), stroke 0.3s var(--ease), filter 0.3s var(--ease);
}
.apt-overlay.detail-mode .apt-building.apt-selected { opacity: 1; }
/* When zoomed in: show all buildings */
#mapView.zoomed-in .apt-overlay.detail-mode .apt-building { opacity: 1; pointer-events: all; }
/* Active mode: visible */
.apt-overlay.active { opacity: 1; }
.apt-overlay .apt-building {
  fill: rgba(0,0,0,0.001); stroke: rgba(255,255,255,0.4); stroke-width: 2.5;
  cursor: pointer; pointer-events: all;
  transition: fill 0.3s var(--ease), stroke 0.3s var(--ease), filter 0.3s var(--ease);
}
.apt-overlay .apt-icon-g { pointer-events: none; }
.apt-overlay .apt-building:hover {
  fill: rgba(255,255,255,0.12);
  stroke: rgba(255,255,255,0.6);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.25));
}
.apt-overlay .apt-building.apt-selected {
  fill: rgba(255,255,255,0.2);
  stroke: rgba(255,255,255,0.85);
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.3));
}
.apt-icon-g {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
/* Only show icons when zoomed in */
#mapView.zoomed-in .apt-icon-g.visible { opacity: 1; }
.apt-icon-g line {
  stroke: white; stroke-width: 2; stroke-linecap: round;
}

/* ========== SELECTION BAR (replaces legend during plot selection) ========== */
.selection-bar {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(120px);
  display: flex; align-items: center; gap: 12px;
  background: rgba(34,34,34,0.9); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 14px 10px 18px; border-radius: 40px; z-index: 55;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
  opacity: 0; pointer-events: none;
  max-width: 90vw;
}
.selection-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: auto;
}
.selection-bar-chips {
  display: flex; gap: 6px; flex-wrap: nowrap;
  overflow-x: auto; max-width: 60vw;
  -ms-overflow-style: none; scrollbar-width: none;
}
.selection-bar-chips::-webkit-scrollbar { display: none; }
.selection-bar-chips:empty::after {
  content: 'Select plots on the map';
  color: rgba(255,255,255,0.4); font-size: 13px; white-space: nowrap;
  letter-spacing: 0.02em;
}
.sel-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.1); color: white;
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 400; cursor: pointer;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.2s, border-color 0.2s;
}
.sel-chip:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); }
.sel-chip svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }
.selection-bar-btn {
  padding: 10px 24px; flex-shrink: 0;
  background: white; color: var(--dark);
  border: none; border-radius: 24px;
  font-family: 'Suisse Intl', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; letter-spacing: 0.02em;
  transition: background 0.3s, opacity 0.3s, transform 0.2s;
}
.selection-bar-btn:hover:not(:disabled) { background: #f0f0f0; }
.selection-bar-btn:disabled { opacity: 0.3; cursor: not-allowed; }
/* Mobile-only summary that replaces the chip strip in the bar. Underlined
   so it reads as a tappable link. */
.selection-bar-summary {
  display: none;
  background: transparent; border: 0;
  color: rgba(255,255,255,0.92);
  font-family: 'Suisse Intl', sans-serif;
  font-size: 13px; letter-spacing: 0.02em; font-weight: 400;
  padding: 6px 4px; cursor: pointer;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.45);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.selection-bar-summary:hover,
.selection-bar-summary:active {
  color: white;
  text-decoration-color: rgba(255,255,255,0.9);
}

/* Tablet-sized touch screens: cap bottom-sheet width so it doesn't stretch
   edge-to-edge. left:50% + negative margin keeps centering off the
   transform (the swipe-down handler still drives translateY). */
body.is-tablet-sheet .preview-card,
body.is-tablet-sheet #selectionSheet .selection-sheet-card,
body.is-tablet-sheet #configPanel.is-amenity-panel {
  left: 50%;
  right: auto;
  width: 520px;
  max-width: calc(100vw - 40px);
  margin-left: -260px;
  border-radius: 20px 20px 0 0;
}

/* Shared close-X button for popups (preview card, selection sheet, config
   panel on mobile). Sits in the top-right corner of the sheet. Uses a
   semi-translucent white background with a backdrop blur so it stays
   legible whether it sits over the cream panel or over a gallery image. */
.sheet-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: var(--dark);
  border: 0; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, color 0.2s;
}
.sheet-close:hover { background: white; color: #000; }
.sheet-close svg { width: 16px; height: 16px; }
/* Config panel and summary view both surface a close-X. Mobile sheets
   already had one; desktop now matches so users can dismiss the panel
   without hunting for the header Back button. */
#configPanel > .sheet-close { display: flex; }
#summaryView > .sheet-close { display: flex; top: 20px; right: 20px; }

/* ========== SELECTION SHEET (mobile) ========== */
.selection-sheet {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.selection-sheet.open { pointer-events: all; opacity: 1; }
.selection-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.selection-sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 12px 24px max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
  max-height: 80vh; display: flex; flex-direction: column;
}
.selection-sheet.open .selection-sheet-card { transform: translateY(0); }
.selection-sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #ddd; margin: 0 auto 16px;
}
.selection-sheet-title {
  font-size: 18px; font-weight: 400; color: var(--dark);
  letter-spacing: 0.02em; margin-bottom: 14px;
}
.selection-sheet-list {
  flex: 1; min-height: 0; overflow-y: auto;
  margin: 0 -24px; padding: 0 24px;
}
.selection-sheet-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 0;
  border-bottom: 1px solid #eee;
}
.selection-sheet-row:last-child { border-bottom: 0; }
.selection-sheet-row-name {
  font-size: 15px; color: var(--dark); letter-spacing: 0.01em;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-sheet-row-meta {
  font-size: 12px; color: var(--text-tertiary);
  white-space: nowrap;
}
.selection-sheet-row-remove {
  flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: #f3f3f3; color: #444;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.selection-sheet-row-remove svg { width: 14px; height: 14px; }
.selection-sheet-row-remove:hover { background: #ebebeb; color: #000; }
.selection-sheet-empty {
  padding: 32px 0; text-align: center;
  font-size: 14px; color: var(--text-tertiary);
}
.selection-sheet-actions {
  display: flex; gap: 10px; padding-top: 16px;
  border-top: 1px solid #eee;
}
.selection-sheet-secondary,
.selection-sheet-primary {
  flex: 1; padding: 14px; border-radius: 12px;
  font-family: 'Suisse Intl', sans-serif;
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
  cursor: pointer; border: 0;
  transition: background 0.2s, opacity 0.2s;
}
.selection-sheet-secondary {
  background: #f1f1f1; color: var(--dark);
}
.selection-sheet-secondary:hover { background: #e8e8e8; }
.selection-sheet-primary {
  background: var(--accent); color: var(--white);
}
.selection-sheet-primary:hover { background: #e84a2f; }
.selection-sheet-primary:disabled { opacity: 0.35; cursor: not-allowed; }

/* ========== TOOLTIP ========== */
.tooltip {
  position: fixed; z-index: 200;
  background: var(--dark); color: var(--white);
  padding: 12px 18px; border-radius: 8px;
  font-size: 13px; letter-spacing: 0.02em;
  pointer-events: none; opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  max-width: 260px;
}
.tooltip.visible { opacity: 1; transform: translateY(0); }
.tooltip .tt-name { font-weight: 500; margin-bottom: 4px; font-size: 14px; }
.tooltip .tt-type { color: var(--text-tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.tooltip .tt-info { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.6); }
.tooltip .tt-amenity-label { color: #4778f6; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }
.tooltip .tt-restricted-label { color: #dc3c3c; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }
.tooltip .tt-price { color: var(--accent); font-size: 14px; font-weight: 500; letter-spacing: 0.02em; margin-top: 4px; display: inline-block; }

/* ========== LEGEND ========== */
.map-legend {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 28px; z-index: 50;
  background: rgba(34,34,34,0.85); backdrop-filter: blur(16px);
  padding: 14px 32px; border-radius: 40px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: opacity 0.5s, transform 0.5s var(--ease);
}
.map-legend.hidden { opacity: 0; transform: translateX(-50%) translateY(20px); pointer-events: none; }
.map-legend .legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.04em; color: rgba(255,255,255,0.7);
  text-transform: uppercase; cursor: pointer; padding: 6px 12px;
  border-radius: 20px; transition: all 0.3s var(--ease);
}
.map-legend .legend-item:hover {
  background: rgba(255,255,255,0.1); color: var(--white);
}
.map-legend .legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.apartments { background: #fe5639; }
.legend-dot.villas { background: #d4a853; }
.legend-dot.townhouses { background: #6cb87e; }
.legend-dot.amenity { background: #4778f6; }

/* ========== CONFIGURATOR PANEL ========== */
#configPanel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 520px; background: var(--cream);
  z-index: 90; transform: translateX(100%);
  transition: transform 0.7s var(--ease);
  box-shadow: -4px 0 40px rgba(0,0,0,0.15);
}
#configPanel.open { transform: translateX(0); }

/* Drag handle for the mobile bottom-sheet variant. Hidden on desktop where
   the panel is a side drawer. */
.config-panel-grip { display: none; }
.config-panel-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #ddd; margin: 10px auto 0;
}

.config-scroll {
  height: 100%; overflow-y: auto; padding: 100px 40px 0;
  scroll-behavior: smooth;
}
.config-scroll::-webkit-scrollbar { width: 3px; }
.config-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }

.plot-header { margin-bottom: 36px; }
.plot-header .plot-type {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); margin-bottom: 8px; font-weight: 500;
}
.plot-header .plot-name {
  font-size: 32px; font-weight: 300; letter-spacing: 0.02em;
  color: var(--dark); line-height: 1.15; margin-bottom: 16px;
}
.plot-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card {
  background: var(--white); border-radius: 10px; padding: 16px;
  border: 1px solid var(--stroke);
}
.stat-card .stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); margin-bottom: 4px;
}
.stat-card .stat-value { font-size: 20px; font-weight: 400; color: var(--dark); }
.stat-card .stat-unit { font-size: 12px; color: var(--text-secondary); font-weight: 300; }

.config-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-tertiary); margin: 40px 0 18px; font-weight: 500;
}

/* ========== SELECTED PLOTS LIST (Townhouses Config) ========== */
.selected-plots-list {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--stroke);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.selected-plot-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  font-size: 13px;
}
.selected-plot-row .sp-name {
  font-weight: 500; color: var(--dark);
  min-width: 70px;
}
.selected-plot-row .sp-type {
  flex: 1;
  color: var(--text-secondary);
  font-size: 12px;
}
.selected-plot-row .sp-area {
  color: var(--text-secondary);
  font-size: 12px;
  text-align: right;
}

/* ========== BUILDING CARDS ========== */
.building-cards-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 24px;
}
.building-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 14px 16px 18px;
  background: var(--white);
  border: 1px solid var(--stroke);
  border-radius: 10px;
}
.building-card-info { flex: 1; min-width: 0; }
.building-card-name {
  font-weight: 500; font-size: 15px; color: var(--dark);
  margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.building-card-stats {
  display: flex; gap: 16px;
  font-size: 12px; color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.building-card-price {
  margin-top: 6px;
  font-size: 14px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.02em;
}
.building-card-remove {
  flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: #f3f3f3; color: #444;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.building-card-remove svg { width: 14px; height: 14px; }
.building-card-remove:hover { background: #ebebeb; color: #000; }

/* ========== BRAND CARDS ========== */
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-card {
  background: var(--white); border-radius: 12px; padding: 20px 16px;
  border: 2px solid var(--stroke); cursor: pointer;
  transition: all 0.3s var(--ease);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  position: relative;
}
.brand-card:hover { border-color: #ccc; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.brand-card.selected { border-color: var(--dark); }
.brand-card .brand-check {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--dark); display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.5);
  transition: all 0.3s var(--ease-spring);
}
.brand-card.selected .brand-check { opacity: 1; transform: scale(1); }
.brand-card .brand-logo {
  height: 40px; margin-bottom: 12px;
  object-fit: contain; filter: grayscale(100%);
  transition: filter 0.3s; max-width: 100%;
}
.brand-card:hover .brand-logo, .brand-card.selected .brand-logo { filter: grayscale(0%); }
.brand-card .brand-name { font-size: 13px; font-weight: 500; color: var(--dark); margin-bottom: 4px; }
.brand-card .brand-desc { font-size: 11px; color: var(--text-tertiary); }
.brand-card.no-brand { border-style: dashed; }
.brand-card.no-brand .brand-icon {
  width: 40px; height: 40px; margin-bottom: 12px;
  border-radius: 50%; background: var(--stroke);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-tertiary);
}

/* ========== SERVICE TOGGLES ========== */
.service-item {
  background: var(--white); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 10px;
  border: 1px solid var(--stroke);
  display: flex; align-items: flex-start; gap: 16px;
  transition: all 0.3s var(--ease);
  opacity: 0; transform: translateY(12px);
}
.service-item.visible { opacity: 1; transform: translateY(0); }
.service-item.active { border-color: var(--dark); background: #fff; }

.service-toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: #ddd; position: relative; cursor: pointer;
  transition: background 0.3s; flex-shrink: 0; margin-top: 2px;
}
.service-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 0.3s var(--ease);
}
.service-toggle.on { background: var(--dark); }
.service-toggle.on::after { transform: translateX(20px); }

.service-info { flex: 1; min-width: 0; }
.service-info .service-name { font-size: 15px; font-weight: 400; color: var(--dark); margin-bottom: 3px; }
.service-info .service-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 6px; }

/* Fee column on the right of each service card. */
.service-price {
  flex-shrink: 0;
  margin-left: 12px;
  text-align: right;
  font-size: 16px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.01em;
  line-height: 1.1;
  display: flex; flex-direction: column; align-items: flex-end;
}
/* Was + Now rendered on the same line, baseline-aligned, so the discount
   reads like an ecommerce price (e.g. "17% 15%"). */
.service-price-row {
  display: inline-flex; align-items: baseline; gap: 6px;
}
.service-price-was {
  font-size: 12px; font-weight: 400;
  color: var(--text-tertiary);
  text-decoration: line-through;
}
.service-item.is-package .service-price-was {
  color: rgba(255,255,255,0.5);
}
.service-price-now { display: inline-block; }
.service-price-of {
  display: block;
  margin-top: 4px;
  font-size: 10px; font-weight: 400;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* "Save N%" chip — sits under the price + microcopy on the package card. */
.service-saves {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(45, 138, 78, 0.14);
  color: #2d8a4e;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.service-item.is-package .service-saves {
  background: rgba(255, 255, 255, 0.14);
  color: #6ad28f;
}
.sr-saves {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(45, 138, 78, 0.14);
  color: #2d8a4e;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 6px;
}
.sr-was {
  color: var(--text-tertiary);
  text-decoration: line-through;
  margin-right: 4px;
}

/* Footnote above the service list explaining the fee basis. */
.service-note {
  font-size: 12px; color: var(--text-secondary);
  margin: -8px 0 16px;
  letter-spacing: 0.01em;
}
.service-note strong { color: var(--dark); font-weight: 500; }

/* Package & included states */
.service-item.is-package {
  border-color: var(--dark); background: var(--dark); color: var(--white);
}
.service-item.is-package .service-name { color: var(--white); }
.service-item.is-package .service-desc { color: rgba(255,255,255,0.6); }
.service-item.is-package .service-toggle.on { background: var(--accent); }
.service-item.is-package .service-price { color: var(--accent); }
.service-item.is-package .service-price-of { color: rgba(255,255,255,0.55); }
.service-item.is-included {
  opacity: 0.7;
}
.service-item.is-included .service-toggle { pointer-events: none; }
.included-badge {
  display: inline-block;
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2d8a4e; background: rgba(45,138,78,0.1);
  padding: 2px 8px; border-radius: 4px; margin-left: 8px;
  vertical-align: middle;
}

.config-footer {
  padding: 24px 40px 40px;
  border-top: 1px solid var(--stroke);
  background: var(--cream);
}

.continue-btn {
  width: 100%; padding: 16px; border-radius: 10px;
  background: var(--dark); color: var(--white);
  font-size: 15px; font-weight: 400; letter-spacing: 0.04em;
  transition: all 0.3s var(--ease);
}
.continue-btn:hover { background: #333; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

/* ========== AMENITY MARKERS ========== */
/* Markers are visual-only — clicks and hover pass through to the path below
   so the polygon's hover/select states still activate. */
.amenity-markers { pointer-events: none; }
.amenity-marker {
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.amenity-marker circle:first-child {
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.12));
  animation: markerPulse 3s ease-in-out infinite;
}
@keyframes markerPulse {
  0%, 100% { fill-opacity: 0.9; }
  50% { fill-opacity: 0.7; }
}
/* Hide markers when zones are dimmed (zone selected) */
.amenity-markers.dimmed .amenity-marker { opacity: 0; pointer-events: none; }

/* ========== AMENITY INFO PANEL ========== */
.amenity-gallery {
  margin: -100px -40px 0;
  position: relative;
  overflow: hidden;
}
.amenity-slider {
  display: flex;
  transition: transform 0.5s var(--ease);
}
.amenity-slide {
  min-width: 100%; cursor: zoom-in;
}
.amenity-slide img {
  width: 100%; height: 280px;
  object-fit: cover; display: block;
}
.amenity-gallery-controls {
  position: absolute; top: 50%; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 0 8px; transform: translateY(-50%);
  pointer-events: none;
}
.gallery-arrow {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(8px);
  border: none; cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.gallery-arrow:hover { background: white; transform: scale(1.1); }
.gallery-arrow svg { width: 16px; height: 16px; stroke: var(--dark); }
.gallery-arrow.hidden { opacity: 0; pointer-events: none; }
.amenity-gallery-dots {
  position: absolute; bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px;
}
.gallery-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5); border: none; padding: 0; cursor: pointer;
  transition: all 0.3s var(--ease);
}
.gallery-dot.active {
  background: white; width: 20px; border-radius: 4px;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease);
  overflow: hidden;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.92);
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: white; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  transition: background 0.3s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev svg, .lightbox-next svg { width: 24px; height: 24px; color: white; }
.lightbox-track {
  position: relative; z-index: 5;
  display: flex; align-items: center;
  width: 100%; height: 100%;
  transition: transform 0.4s var(--ease);
}
.lightbox-slide {
  min-width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
}
.lightbox-slide img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 4px;
  user-select: none; -webkit-user-drag: none;
}
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%); z-index: 10;
  color: rgba(255,255,255,0.6); font-size: 13px;
  letter-spacing: 0.05em;
}
.amenity-header {
  padding-top: 28px;
}
.amenity-type {
  color: var(--accent-blue);
}
.amenity-details {
  margin-bottom: 28px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  overflow: hidden;
}
.amenity-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--stroke);
  font-size: 14px;
}
.amenity-detail-row:last-child { border-bottom: none; }
.amenity-detail-label {
  color: var(--text-secondary); font-weight: 300;
}
.amenity-detail-value {
  color: var(--dark); font-weight: 400; text-align: right;
}
.amenity-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 20px;
  background: rgba(71, 120, 246, 0.06);
  border-radius: 10px;
  font-size: 13px; color: var(--accent-blue);
  line-height: 1.5;
  margin-bottom: 40px;
}
.amenity-note svg {
  flex-shrink: 0; margin-top: 1px;
  stroke: var(--accent-blue);
}

/* ========== SUMMARY VIEW ========== */
#summaryView {
  position: fixed; inset: 0; z-index: 95;
  background: var(--cream);
  transform: translateX(100%);
  transition: transform 0.7s var(--ease);
  overflow-y: auto;
}
#summaryView.open { transform: translateX(0); }

.summary-inner { max-width: 640px; margin: 0 auto; padding: 100px 40px 80px; }
.summary-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 40px; cursor: pointer;
  transition: color 0.3s;
}
.summary-back:hover { color: var(--dark); }
.summary-back svg { width: 16px; height: 16px; }

.summary-title { font-size: 36px; font-weight: 300; color: var(--dark); letter-spacing: 0.02em; margin-bottom: 8px; }
.summary-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 40px; }

.summary-card {
  background: var(--white); border-radius: 14px;
  padding: 28px; margin-bottom: 16px;
  border: 1px solid var(--stroke);
}
.summary-card-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-tertiary); margin-bottom: 16px; font-weight: 500;
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .sr-label { font-size: 14px; color: var(--dark); }
.summary-row .sr-value { font-size: 14px; color: var(--text-secondary); text-align: right; }
.summary-row-total .sr-label,
.summary-row-total .sr-value {
  font-size: 16px; font-weight: 500; color: var(--dark);
}
.summary-row-total .sr-value { color: var(--accent); }

.inquiry-form { margin-top: 40px; }
.inquiry-form .form-title { font-size: 22px; font-weight: 300; color: var(--dark); margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-tertiary);
  margin-bottom: 8px; font-weight: 400;
}
.form-group input, .form-group textarea {
  width: 100%; padding: 14px 0; border: none;
  border-bottom: 1px solid var(--stroke);
  background: transparent; font-family: inherit;
  font-size: 15px; font-weight: 300; color: var(--dark);
  outline: none; transition: border-color 0.3s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--dark); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.submit-btn {
  width: 100%; padding: 18px; border-radius: 10px;
  background: var(--accent); color: var(--white);
  font-size: 16px; font-weight: 400; letter-spacing: 0.04em;
  margin-top: 32px; transition: all 0.3s var(--ease);
}
.submit-btn:hover { background: #e84a2f; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(254,86,57,0.3); }

.form-note {
  text-align: center; font-size: 12px; color: var(--text-tertiary);
  margin-top: 16px; letter-spacing: 0.02em;
}

/* ========== SUCCESS OVERLAY ========== */
#successOverlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--dark); display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
#successOverlay.show { opacity: 1; pointer-events: auto; }
.success-check {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--white); display: flex;
  align-items: center; justify-content: center;
  margin-bottom: 28px; opacity: 0; transform: scale(0.5);
  transition: all 0.5s var(--ease-spring) 0.3s;
}
#successOverlay.show .success-check { opacity: 1; transform: scale(1); }
.success-title {
  font-size: 28px; font-weight: 300; color: var(--white);
  letter-spacing: 0.04em; margin-bottom: 12px;
  opacity: 0; transform: translateY(15px);
  transition: all 0.5s var(--ease) 0.5s;
}
#successOverlay.show .success-title { opacity: 1; transform: translateY(0); }
.success-sub {
  font-size: 14px; color: var(--text-tertiary);
  letter-spacing: 0.03em; text-align: center; max-width: 360px;
  opacity: 0; transition: opacity 0.5s var(--ease) 0.7s;
}
#successOverlay.show .success-sub { opacity: 1; }
/* ========== PREVIEW CARD (mobile only) ========== */
.preview-card {
  display: none; /* enabled inside the mobile media query */
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 85;
  background: var(--white); border-radius: 20px 20px 0 0;
  padding: 12px 24px max(28px, env(safe-area-inset-bottom));
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
  transform: translateY(100%);
  transition: transform 0.5s var(--ease);
}
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .preview-card { display: flex; }
}
.preview-card.visible { transform: translateY(0); }
.preview-card-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #ddd; margin: 0 auto 16px; flex-shrink: 0;
}
.preview-card-type {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); font-weight: 500; margin-bottom: 4px;
}
.preview-card-name {
  font-size: 22px; font-weight: 300; color: var(--dark);
  letter-spacing: 0.02em; margin-bottom: 10px;
}
.preview-card-stats {
  display: flex; gap: 16px; margin-bottom: 10px;
  font-size: 12px; color: var(--text-secondary);
}
.preview-card-stats span { display: flex; align-items: center; gap: 4px; }
.preview-card-desc {
  font-size: 13px; color: var(--text-secondary); line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.preview-card-price {
  font-size: 20px; font-weight: 400; color: var(--dark); margin-bottom: 16px;
}
.preview-card-btn {
  width: 100%; padding: 14px; border-radius: 10px;
  background: var(--dark); color: var(--white);
  font-size: 14px; font-weight: 400; letter-spacing: 0.03em;
  transition: all 0.3s var(--ease);
}
.preview-card-btn:hover { background: #333; }
.preview-card-amenity-note {
  display: none; font-size: 12px; color: var(--text-tertiary);
  text-align: center; padding: 8px 0; letter-spacing: 0.02em;
}
.preview-card.is-amenity .preview-card-type { color: var(--accent-blue); }
.preview-card.is-amenity .preview-card-btn {
  background: var(--accent-blue);
}
.preview-card.is-amenity .preview-card-amenity-note { display: block; }
.preview-card.is-amenity .preview-card-price { display: none; }
/* Saleable preview: orange Add button, dark Remove button when already in
   the multi-select queue. Total price (AED) is shown above the button. */
.preview-card.is-saleable .preview-card-price { display: block; }
.preview-card.is-saleable .preview-card-btn {
  background: var(--accent);
  color: var(--white);
}
.preview-card.is-saleable.is-selected .preview-card-btn {
  background: var(--dark);
  color: var(--white);
}
.preview-card-image {
  margin: -12px -24px 16px;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}
.preview-card-image img {
  width: 100%; height: 140px; object-fit: cover; display: block;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  /* Tooltip is desktop-only — touch taps go straight to the preview/info
     panel, no need for a transient hover bubble. */
  .tooltip { display: none !important; }

  /* While any bottom-sheet is open, prevent the map underneath from
     responding to horizontal pan/zoom (Safari was letting touches leak
     through and drag the map sideways behind the sheet). */
  body.sheet-locked { overflow: hidden; touch-action: pan-y; }
  body.sheet-locked #mapView { pointer-events: none; }

  /* Selection bar on mobile: fixed-width pill so the layout doesn't twitch
     when the label flips between "1 plot" and "N plots". Children can't
     shrink, justify-content keeps them anchored to the edges. */
  .selection-bar {
    padding: 5px 5px 5px 14px;
    gap: 8px;
    max-width: none;
    width: 260px;
    min-width: 260px;
    justify-content: space-between;
  }
  .selection-bar-chips { display: none; }
  .selection-bar-summary {
    display: inline-flex; align-items: center;
    padding: 6px 2px;
    flex-shrink: 0;
  }
  .selection-bar-btn {
    padding: 10px 20px;
    flex-shrink: 0;
  }

  /* Loader */
  #loader .logo-wrap svg,
  #loader .logo-wrap img { width: 160px; }
  #loader .city-title { width: 200px; margin-top: 20px; }
  #loader .tagline { font-size: 12px; letter-spacing: 0.1em; }
  #loader .progress-bar { width: 140px; bottom: 40px; }

  /* Header */
  .app-header { padding: 16px 20px; }
  .app-header .logo img { width: 90px !important; }
  .app-header .step-indicator { font-size: 11px; letter-spacing: 0.06em; }

  /* Back button */
  .back-btn { top: 20px; left: 120px; font-size: 12px; }

  /* Currency bar in config */

  /* Map — full screen, pan to explore */

  /* Tooltip — show on mobile too */

  /* Legend */
  .map-legend {
    bottom: 20px; gap: 6px; padding: 10px 16px;
    border-radius: 28px; flex-wrap: nowrap;
    overflow-x: auto; max-width: calc(100vw - 32px);
    -webkit-overflow-scrolling: touch;
  }
  .map-legend .legend-item {
    font-size: 10px; padding: 4px 8px; gap: 5px;
    white-space: nowrap; letter-spacing: 0.03em;
  }
  .map-legend .legend-dot { width: 6px; height: 6px; }

  /* Saleable plots on mobile: clearly visible default state since there is
     no hover affordance on touch. White outline + soft fill. */
  .map-overlay svg path.zone-apartments,
  .map-overlay svg path.zone-villas,
  .map-overlay svg path.zone-townhouses,
  .map-overlay svg path.zone-branded {
    fill: rgba(255,255,255,0.14);
    stroke: rgba(255,255,255,0.7);
    stroke-width: 2.5;
  }
  .map-overlay svg path.amenity {
    fill: rgba(71,120,246,0.12);
    stroke: rgba(71,120,246,0.3);
  }
  /* Disable hover effects on touch devices */
  .map-overlay svg path:hover { filter: none; }
  .map-overlay svg path.zone-apartments:hover,
  .map-overlay svg path.zone-villas:hover,
  .map-overlay svg path.zone-townhouses:hover,
  .map-overlay svg path.zone-branded:hover {
    fill: rgba(255,255,255,0.14); stroke: rgba(255,255,255,0.7);
  }
  .map-overlay svg path.amenity:hover {
    fill: rgba(71, 120, 246, 0.12); stroke: rgba(71, 120, 246, 0.3);
  }
  /* Dimmed state hides non-selected zones */
  .map-overlay svg path.dimmed {
    fill: rgba(0,0,0,0.001); stroke: transparent; opacity: 0.3;
  }
  /* Selection / preview states need to win over the mobile saleable rules
     above (same specificity, defined later in source so they take effect). */
  .map-overlay svg path.multi-selected {
    fill: rgba(254,86,57,0.28);
    stroke: rgba(254,86,57,0.95);
    stroke-width: 3;
    filter: drop-shadow(0 0 14px rgba(254,86,57,0.45));
  }
  .map-overlay svg path.previewing {
    fill: rgba(254,86,57,0.22);
    stroke: rgba(254,86,57,0.95);
    stroke-width: 3;
    filter: drop-shadow(0 0 14px rgba(254,86,57,0.5));
  }

  /* Config panel — full screen on mobile */
  #configPanel {
    width: 100%; left: 0;
    transform: translateY(100%);
    border-radius: 20px 20px 0 0;
    top: 60px; bottom: 0;
  }
  #configPanel.open { transform: translateY(0); }
  /* Amenity info panel: bottom sheet sized to content height (max 85vh).
     Drag handle + close X live above the scrollable content. */
  #configPanel.is-amenity-panel {
    top: auto;
    bottom: 0;
    height: auto;
    max-height: 85vh;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
    overflow: hidden;  /* keeps the rounded radius clean over the gallery */
  }
  #configPanel.is-amenity-panel .config-panel-grip {
    display: block;
    position: relative;
    z-index: 5;
    background: var(--cream);
  }
  #configPanel.is-amenity-panel .config-scroll {
    max-height: calc(85vh - 24px);
    overflow-y: auto;
    padding-top: 0;
  }
  #configPanel.is-amenity-panel > .sheet-close { top: 18px; }

  .config-scroll { padding: 24px 20px 0; }

  /* Plot header */
  .plot-header .plot-name { font-size: 24px; margin-bottom: 12px; }
  .plot-header .plot-type { font-size: 10px; }
  .plot-header p { font-size: 13px !important; }

  .plot-stats { gap: 8px; }
  .stat-card { padding: 12px; border-radius: 8px; }
  .stat-card .stat-label { font-size: 10px; }
  .stat-card .stat-value { font-size: 17px; }

  .config-section-title { margin: 28px 0 14px; font-size: 10px; }

  /* Brand grid */
  .brand-grid { gap: 8px; }
  .brand-card { padding: 14px 10px; border-radius: 10px; }
  .brand-card .brand-logo { height: 30px; margin-bottom: 8px; }
  .brand-card .brand-name { font-size: 11px; }
  .brand-card .brand-desc { font-size: 10px; }
  .brand-card .brand-check { width: 18px; height: 18px; top: 8px; right: 8px; }
  .brand-card .brand-check svg { width: 10px; height: 10px; }
  .brand-card.no-brand .brand-icon { width: 30px; height: 30px; margin-bottom: 8px; font-size: 16px; }

  /* Service items */
  .service-item { padding: 14px 16px; gap: 12px; border-radius: 10px; margin-bottom: 8px; }
  .service-toggle { width: 40px; height: 22px; }
  .service-toggle::after { width: 18px; height: 18px; }
  .service-toggle.on::after { transform: translateX(18px); }
  .service-info .service-name { font-size: 14px; }
  .service-info .service-desc { font-size: 12px; margin-bottom: 4px; }

  /* Fee column on mobile — narrower text, microcopy lives on one line. */
  .service-price { font-size: 14px; margin-left: 8px; }
  .service-price-of { font-size: 9px; letter-spacing: 0.06em; }
  .service-price-was { font-size: 10px; margin-right: 4px; vertical-align: 1px; }
  .service-saves { font-size: 9px; padding: 2px 7px; margin-top: 5px; }

  .service-note { font-size: 11px; margin: -4px 0 14px; }

  /* Amenity panel mobile — gallery is flush with the panel edges, no
     rounded corners (the panel itself owns the rounded top now). Swipe +
     dots only; arrows hidden. Extra top breathing room below the handle. */
  .amenity-gallery { margin: 18px -20px 20px; border-radius: 0; overflow: hidden; }
  .amenity-slide img { height: 220px; }
  .amenity-gallery-controls { display: none; }
  .lightbox-slide { padding: 20px; }
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; }
  .lightbox-prev svg, .lightbox-next svg { width: 20px; height: 20px; }
  .amenity-detail-row { padding: 12px 16px; font-size: 13px; }
  .amenity-note { font-size: 12px; padding: 14px 16px; }

  /* Config footer */
  .config-footer { padding: 20px 20px 32px; }
  .continue-btn { padding: 14px; font-size: 14px; border-radius: 8px; }

  /* Summary view */
  .summary-inner { padding: 80px 20px 60px; }
  .summary-title { font-size: 28px; }
  .summary-subtitle { font-size: 13px; margin-bottom: 28px; }
  .summary-back { font-size: 12px; margin-bottom: 28px; }

  .summary-card { padding: 20px; border-radius: 12px; }
  .summary-card-title { font-size: 10px; margin-bottom: 12px; }
  .summary-row { padding: 8px 0; }
  .summary-row .sr-label { font-size: 13px; }
  .summary-row .sr-value { font-size: 13px; }


  .inquiry-form .form-title { font-size: 20px; margin-bottom: 20px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-group label { font-size: 11px; }
  .form-group input, .form-group textarea { font-size: 14px; padding: 12px 0; }
  .submit-btn { padding: 16px; font-size: 15px; margin-top: 24px; border-radius: 8px; }
  .form-note { font-size: 11px; margin-top: 12px; }

  /* Success overlay */
  .success-check { width: 52px; height: 52px; margin-bottom: 20px; }
  .success-check svg { width: 22px; height: 22px; }
  .success-title { font-size: 22px; }
  .success-sub { font-size: 13px; max-width: 300px; }
}

/* ========== ONBOARDING (first-visit, mobile + tablet) ========== */
.onboarding {
  position: fixed; inset: 0; z-index: 2500;
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s var(--ease);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.onboarding.open { pointer-events: all; opacity: 1; }
.onboarding-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.onboarding-card {
  position: relative;
  width: 100%; max-width: 380px;
  background: var(--white); color: var(--dark);
  border-radius: 22px;
  padding: 28px 26px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s var(--ease);
}
.onboarding.open .onboarding-card { transform: translateY(0) scale(1); }
.onboarding-skip {
  position: absolute; top: 14px; right: 16px;
  background: transparent; border: 0;
  font-family: 'Suisse Intl', sans-serif;
  font-size: 13px; color: var(--text-tertiary);
  cursor: pointer; padding: 6px 8px;
  letter-spacing: 0.02em;
}
.onboarding-skip:hover { color: var(--dark); }
.onboarding-stage { padding: 6px 0 12px; min-height: 240px; text-align: center; }
.onboarding-icon {
  width: 96px; height: 96px;
  margin: 8px auto 18px;
  color: var(--dark);
  display: flex; align-items: center; justify-content: center;
}
.onboarding-icon svg { width: 100%; height: 100%; }
.onboarding-title {
  font-size: 19px; font-weight: 500;
  letter-spacing: 0.01em; margin: 0 0 10px;
  color: var(--dark);
}
.onboarding-body {
  font-size: 14px; line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 auto; max-width: 280px;
}
.onboarding-dots {
  display: flex; gap: 6px; justify-content: center;
  margin: 8px 0 18px;
}
.onboarding-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(0,0,0,0.18);
  transition: background 0.2s, width 0.3s;
}
.onboarding-dot.active { background: var(--accent); width: 18px; border-radius: 4px; }
.onboarding-actions {
  display: flex; gap: 10px;
}
.onboarding-back,
.onboarding-next {
  flex: 1; padding: 13px;
  border-radius: 12px; border: 0;
  font-family: 'Suisse Intl', sans-serif;
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.02em; cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.onboarding-back {
  background: #f1f1f1; color: var(--dark);
}
.onboarding-back:disabled { opacity: 0; pointer-events: none; }
.onboarding-back:hover:not(:disabled) { background: #e8e8e8; }
.onboarding-next {
  background: var(--accent); color: var(--white);
}
.onboarding-next:hover { background: #e84a2f; }

/* ========== AUTH GATE ========== */
.auth-gate {
  position: fixed; inset: 0; z-index: 3000;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.auth-gate.open { opacity: 1; pointer-events: all; }
.auth-card {
  width: 100%; max-width: 560px;
  background: transparent;
  display: flex; flex-direction: column;
  align-items: stretch;
}
.auth-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
  margin-bottom: 40px;
}
/* The Mira × ADPorts mark ships white-on-dark — invert it so it reads on
   the cream auth gate. The Mira Hills city logo is already black, so it
   renders natively without inversion. */
.auth-brand img { display: block; height: auto; }
.auth-brand-mark { width: 140px; opacity: 0.85; filter: invert(1); }
.auth-brand-city { width: 280px; }

.auth-view { display: flex; flex-direction: column; gap: 18px; }
.auth-view[hidden] { display: none; }

.auth-title {
  font-family: 'Suisse Intl', sans-serif;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: 0.01em;
  color: var(--dark);
  margin: 0;
}
.auth-title-display {
  font-size: 40px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.auth-subtitle {
  font-size: 15px; line-height: 1.55;
  color: var(--text-secondary);
  margin: -6px 0 10px;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label {
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-tertiary);
  font-weight: 500;
}
.auth-field input,
.auth-field select,
.auth-field textarea {
  width: 100%;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'Suisse Intl', sans-serif;
  font-size: 15px; color: var(--dark);
  transition: border-color 0.2s, background 0.2s;
}
.auth-field textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.auth-field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23595959' stroke-width='1.6'><path d='M1 1.5l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
  outline: none; border-color: var(--dark);
  background: rgba(255,255,255,0.9);
}

.auth-error {
  min-height: 18px;
  font-size: 13px; color: #c0392b;
}

.auth-primary {
  width: 100%;
  background: var(--dark); color: var(--white);
  padding: 16px 22px; border-radius: 12px;
  font-family: 'Suisse Intl', sans-serif;
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em;
  border: 0; cursor: pointer;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}
.auth-primary:hover:not(:disabled) { background: #000; }
.auth-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-primary-block { margin-top: 6px; }

.auth-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 14px; color: var(--text-secondary);
  margin-top: 14px;
}
.auth-link {
  background: transparent; border: 0; padding: 4px 2px;
  color: var(--accent); cursor: pointer; font-size: 14px;
  font-family: 'Suisse Intl', sans-serif;
  letter-spacing: 0.01em; font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

/* Lead form: two-column grid on desktop, single column on phone */
.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.auth-field-full { grid-column: 1 / -1; }

/* intl-tel-input overrides so the country selector matches our input style */
.iti { width: 100%; }
.iti__tel-input,
.iti--separate-dial-code .iti__tel-input {
  width: 100%;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'Suisse Intl', sans-serif;
  font-size: 15px; color: var(--dark);
}

/* Thanks state */
.auth-view-thanks { align-items: center; text-align: center; }
.auth-view-thanks .auth-title,
.auth-view-thanks .auth-subtitle { text-align: center; }
.auth-thanks-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
}
.auth-thanks-icon svg { width: 28px; height: 28px; }
.auth-view-thanks .auth-primary { max-width: 280px; margin: 6px auto 0; }

body.auth-locked { overflow: hidden; }

@media (max-width: 600px) {
  .auth-gate { padding: 20px 16px; align-items: flex-start; padding-top: 48px; }
  .auth-brand { margin-bottom: 28px; gap: 14px; }
  .auth-brand-city { width: 220px; }
  .auth-brand-mark { width: 110px; }
  .auth-title { font-size: 26px; }
  .auth-title-display { font-size: 32px; }
  .lead-grid { grid-template-columns: 1fr; }
}

/* Form-level error message inside the step-3 inquiry form */
.form-error {
  min-height: 18px;
  font-size: 13px; color: #c0392b;
  margin-top: 6px;
}
