/* ═════════════════════════════════════════════════════════════════
   Ni & Be Invest — Rezidenca Te Lumi · Virton-style interactive picker
   Brand: light, premium palette — warm paper background, charcoal text,
   refined terracotta accent. Matches the home page (index.html) token set.
   ═════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:           #fbfaf7;
  --bg-soft:      #f4f1ec;
  --card:         #ffffff;
  --card-2:       #f8f6f1;
  --border:       rgba(26, 29, 36, 0.08);
  --border-strong:rgba(26, 29, 36, 0.16);
  --ink:          #1a1d24;
  --mute:         #5d6470;
  --mute-2:       #2c313a;
  --dim:          #8a8f99;
  --accent:       #c45e1f;
  --accent-bright:#e2701f;
  --accent-deep:  #9a4515;
  --accent-soft:  rgba(196, 94, 31, 0.08);
  --accent-glow:  rgba(196, 94, 31, 0.30);
  --shadow-sm:    0 1px 3px rgba(26, 29, 36, 0.05), 0 1px 2px rgba(26, 29, 36, 0.03);
  --shadow-md:    0 4px 14px rgba(26, 29, 36, 0.06), 0 2px 4px rgba(26, 29, 36, 0.04);
  --shadow-lg:    0 14px 38px rgba(26, 29, 36, 0.10), 0 4px 10px rgba(26, 29, 36, 0.04);
  --shadow-xl:    0 24px 56px rgba(26, 29, 36, 0.14), 0 8px 16px rgba(26, 29, 36, 0.06);
  --radius:       10px;
  --radius-lg:    14px;
  --ease:         cubic-bezier(.22, .61, .36, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

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

/* ───────── NAV ───────── */
nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; max-width: 1320px; margin: 0 auto;
  gap: 32px;
}
.brand {
  font-weight: 800; font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a {
  color: var(--mute);
  font-weight: 600; font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 6px 2px;
  transition: color 0.18s var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ""; position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-cta {
  background: var(--accent); color: #fff;
  padding: 12px 20px;
  font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.10em; text-transform: uppercase;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.nav-cta:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ───────── LAYER 1 + 2: hotspot picker stage ───────── */
.picker-page main { flex: 1; }
.picker-stage { padding: 32px 0 60px; }
.picker-header { text-align: center; margin-bottom: 24px; }
.picker-eyebrow {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  border-radius: 999px;
  margin-bottom: 14px;
}
.picker-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.picker-hint {
  color: var(--mute);
  font-size: 1rem;
}

/* the photo + invisible polygons */
.hotspot-image {
  position: relative;
  max-width: 1280px;
  margin: 0 auto 32px;
  padding: 0 24px;
  line-height: 0;
}
.hotspot-image svg {
  width: 100%; height: auto;
  display: block;
  border-radius: 6px;
  overflow: hidden;
}
/* The clickable polygon — invisible itself, sits on top of the outline */
.hotspot {
  fill: rgba(242, 106, 31, 0);
  stroke: transparent;
  stroke-width: 4;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease;
  outline: none;   /* the browser's focus box is a rectangle; focus shows on the outline instead */
}

/* Invisible at rest — only the pin signals clickability (Virton style).
   The hover state is the moment the shade reveals the silhouette. */
.building-outline {
  fill: rgba(242, 106, 31, 0);
  stroke: transparent;
  stroke-width: 0;
  pointer-events: none;
  transition: fill 0.22s ease, stroke 0.22s ease, stroke-width 0.22s ease, filter 0.22s ease;
}
.building-group:hover .building-outline,
.building-group:focus-within .building-outline {
  fill: rgba(226, 112, 31, 0.28);
  stroke: #fff;
  stroke-width: 3;
  filter: none;
}
.building-group.sync .building-outline { fill: rgba(226, 112, 31, 0.28); stroke: #fff; stroke-width: 3; }
.building-group.sync .pin-bg { fill: var(--accent-bright); r: 26; }
/* while one building is hovered (on the photo or its card), the others step back */
#building-hotspots:hover .building-group:not(:hover) .building-outline,
#building-hotspots:has(.sync) .building-group:not(.sync) .building-outline { fill: rgba(14, 15, 16, 0.32); }
.home-picker { max-width: 1180px; margin-bottom: 0; }
.hotspot-image.zooming .pin, .hotspot-image.zooming .hotspot-tooltip { opacity: 0; transition: opacity 0.2s; }

/* Pin marker — always visible badge with the building letter */
.pin { pointer-events: none; }
.pin-bg {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 3;
  transition: r 0.2s ease, fill 0.2s ease;
}
.pin-label {
  fill: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 22px;
  text-anchor: middle;
  letter-spacing: 0.02em;
}
.pin-pulse {
  fill: var(--accent);
  opacity: 0.35;
  transform-origin: center;
  transform-box: fill-box;
  animation: pinPulse 2.2s ease-out infinite;
}
.pin-glow { opacity: 0.6; }
.building-group:hover .pin-bg {
  fill: var(--accent-bright);
  r: 26;
}

/* Layer 2: per-floor band — invisible at rest, clear orange shade on hover (Virton style) */
.floor-outline {
  fill: rgba(242, 106, 31, 0);
  stroke: transparent;
  stroke-width: 0;
  pointer-events: none;
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}
.floor-group:hover .floor-outline,
.floor-group:focus-within .floor-outline {
  fill: rgba(26, 29, 36, 0.6);
  stroke: transparent;
  stroke-width: 0;
  filter: none;
}
/* Floor number pin: smaller than building pin */
.floor-pin .pin-bg {
  fill: rgba(14, 15, 16, 0.92);
  stroke: var(--accent);
  stroke-width: 2;
}
.floor-group:hover .floor-pin .pin-bg {
  fill: var(--accent);
  stroke: #fff;
  r: 18;
}
.floor-pin .pin-label { font-weight: 800; }

/* Per-apartment hotspots on the façade (Layer 2.5) — same Virton treatment */
.apt-outline {
  fill: rgba(242, 106, 31, 0);
  stroke: transparent;
  stroke-width: 0;
  pointer-events: none;
  transition: fill 0.18s ease, stroke 0.18s ease, stroke-width 0.18s ease, filter 0.18s ease;
}
.apt-group:hover .apt-outline,
.apt-group:focus-within .apt-outline {
  fill: rgba(26, 29, 36, 0.6);
  stroke: transparent;
  stroke-width: 0;
  filter: none;
}

/* hover-sync: hovering a list row lights its façade band, and vice versa */
.floor-group.sync .floor-outline {
  fill: rgba(26, 29, 36, 0.6);
  stroke: transparent;
  stroke-width: 0;
  filter: none;
}
.floor-group.sync .floor-pin .pin-bg { fill: var(--accent); stroke: #fff; r: 18; }
.floor-row.sync { background: var(--accent-soft); padding-left: 20px; }
.floor-row.sync .floor-num { background: var(--accent); color: #fff; }
.floor-row.sync .floor-go { color: var(--accent); transform: translateX(3px); }
/* Ground floor uses the same neutral shade (commercial space, not apartments) */
.floor-ground:hover .floor-outline,
.floor-ground.sync .floor-outline {
  fill: rgba(26, 29, 36, 0.6);
  stroke: transparent;
}
.floor-ground .floor-pin .pin-bg {
  fill: rgba(14, 15, 16, 0.92);
  stroke: var(--mute-2);
}
@keyframes pinPulse {
  0%   { transform: scale(0.75); opacity: 0.5; }
  70%  { transform: scale(1.5);  opacity: 0; }
  100% { transform: scale(1.5);  opacity: 0; }
}

/* tooltip that follows the cursor */
.hotspot-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(14, 15, 16, 0.96);
  color: #fff;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  font-size: 13px;
  transform: translate(16px, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 20;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.hotspot-tooltip.visible { opacity: 1; }
.tt-label  { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.tt-sub    { color: var(--mute); font-size: 12px; margin-bottom: 8px; }
.tt-cta    { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: 0.05em; }

/* legend cards under the picker */
.picker-legend {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
  margin-top: 24px;
}
.legend-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.legend-card:hover {
  border-color: rgba(196, 94, 31, 0.22);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.legend-marker {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: #fff;
  font-weight: 800; font-size: 1.05rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(196, 94, 31, 0.30);
  flex-shrink: 0;
}
.legend-card strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.legend-card span   { display: block; color: var(--mute); font-size: 0.82rem; }

/* ───────── LAYER 2: building façade view ───────── */
.building-stage { padding: 24px 0 60px; }
.breadcrumb {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; color: var(--mute);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--mute); transition: color 0.18s var(--ease); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span.sep { color: var(--dim); }
.breadcrumb span.current { color: var(--ink); font-weight: 600; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 600;
  color: var(--mute);
  margin-bottom: 14px;
  transition: color 0.18s var(--ease), gap 0.18s var(--ease);
}
.back-link:hover { color: var(--accent); gap: 10px; }

.building-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 22px;
}
.building-head h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.02em;
}
.building-head .building-meta { color: var(--mute); font-size: 0.95rem; margin-top: 4px; }
.building-toggle {
  display: inline-flex; gap: 4px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.building-toggle button {
  background: transparent; color: var(--mute);
  border: 0; padding: 9px 18px;
  font-family: inherit; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; border-radius: 999px;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.building-toggle button:hover { color: var(--ink); }
.building-toggle button.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(196, 94, 31, 0.30);
}

/* Floor selector — full-width façade on top, compact floor strip below.
   Stacking gives the image ~1280px width so apartment hotspots are easy to hit. */
.floor-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
.floor-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: var(--shadow-md);
  /* Override .hotspot-image margin:auto + max-width so the SVG fills the grid column
     instead of shrinking to the SVG's intrinsic 300px default. */
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.floor-visual svg { width: 100%; height: auto; display: block; }
.floor-visual img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}
.floor-visual-tag {
  position: absolute; top: 14px; left: 14px;
  background: rgba(14,15,16,0.78);
  backdrop-filter: blur(4px);
  border: 1px solid var(--accent-soft);
  color: #fff; font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 7px 14px; border-radius: 999px;
}
.floor-selector {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.floor-selector-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em;
}
.floor-selector-sub { color: var(--mute); font-weight: 500; font-size: 0.8rem; }
.floor-rows { display: flex; flex-direction: column; }
.floor-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.18s, padding 0.18s;
}
.floor-row:last-child { border-bottom: 0; }
.floor-row:hover, .floor-row:focus-visible {
  background: var(--accent-soft);
  padding-left: 20px;
  outline: none;
}
.floor-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--card-2);
  color: var(--mute-2);
  font-weight: 900; font-size: 1.05rem;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}
.floor-row:hover .floor-num { background: var(--accent); color: #fff; }
.floor-info { flex: 1; min-width: 0; }
.floor-info strong { display: block; font-size: 0.9rem; font-weight: 700; }
.floor-info span { display: block; color: var(--mute); font-size: 0.78rem; margin-top: 1px; }
.floor-go {
  flex-shrink: 0; color: var(--dim); font-size: 1.1rem; font-weight: 700;
  transition: color 0.18s, transform 0.18s;
}
.floor-row:hover .floor-go { color: var(--accent); transform: translateX(3px); }
.floor-ground { background: rgba(26, 29, 36, 0.03); }
.floor-ground .floor-num { font-size: 0.8rem; }

@media (max-width: 860px) {
  .floor-layout { gap: 18px; }
}

/* Floor picker v2 (building.html): façade | floor strip + floor card.
   Hover previews a floor, click pins it; the card lists that floor's apartments. */
.fp-layout { grid-template-columns: minmax(0, 1.3fr) minmax(330px, 1fr); }
.fp-layout .floor-group .hotspot { outline: none; }
/* a clicked band keeps focus; don't let the generic focus shade (dark) stick to it */
.fp-layout .floor-group:focus-within:not(.sel):not(.sync):not(:hover):not(:has(.hotspot:focus-visible)) .floor-outline { fill: transparent; stroke: transparent; }
.fp-layout .floor-group:hover .floor-outline,
.fp-layout .floor-group:focus-visible .floor-outline,
.fp-layout .floor-group:has(.hotspot:focus-visible) .floor-outline,
.fp-layout .floor-group.sync .floor-outline,
.fp-layout .floor-group.sel .floor-outline {
  fill: rgba(226, 112, 31, 0.32); stroke: #fff; stroke-width: 2.5;
}
.fp-layout .floor-group.sold-out:hover .floor-outline,
.fp-layout .floor-group.sold-out.sync .floor-outline,
.fp-layout .floor-group.floor-ground:hover .floor-outline,
.fp-layout .floor-group.floor-ground.sync .floor-outline,
.fp-layout .floor-group.floor-ground.sel .floor-outline { fill: rgba(26, 29, 36, 0.38); stroke: rgba(255, 255, 255, 0.7); }
.fp-layout .floor-group.sel .floor-pin .pin-bg { fill: var(--accent); stroke: #fff; r: 18; }

.fp-panel {
  position: sticky; top: 88px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden;
}
.fp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em;
}
.fp-body { display: grid; grid-template-columns: 74px 1fr; min-height: 420px; }
.fp-strip {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 8px;
  border-right: 1px solid var(--border); background: var(--card-2);
}
.fp-floor {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 1px solid transparent; background: none; border-radius: 8px; padding: 5px 2px;
  font-family: inherit; color: var(--mute-2); cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.fp-floor b { font-weight: 900; font-size: 0.95rem; line-height: 1.1; }
.fp-floor small { font-size: 0.6rem; font-weight: 600; color: #2f8a4c; white-space: nowrap; }
.fp-floor.sold-out small { color: var(--dim); }
.fp-floor.info b { font-size: 0.75rem; color: var(--dim); }
.fp-floor:hover, .fp-floor.sync { background: var(--accent-soft); border-color: rgba(196, 94, 31, 0.25); }
.fp-floor.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.fp-floor.sel small, .fp-floor.sel b { color: #fff; }
.fp-floor:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.fp-card { padding: 20px 20px 18px; min-width: 0; }
.fp-eyebrow { color: var(--accent); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.fp-card h3 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; }
.fp-sub { color: var(--mute); font-size: 0.85rem; margin-bottom: 16px; }
.fp-hint { color: var(--dim); font-size: 0.8rem; margin-top: 14px; }
.fp-units, .fp-types { display: flex; flex-direction: column; gap: 8px; }
.fp-unit, .fp-types a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); color: inherit;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.16s var(--ease);
}
.fp-unit:hover, .fp-types a:hover { border-color: rgba(196, 94, 31, 0.35); background: var(--accent-soft); transform: translateX(2px); }
.fp-unit:hover .floor-go { color: var(--accent); transform: translateX(3px); }
.fp-types a { justify-content: space-between; }
.fp-types b { font-weight: 800; }
.fp-types span { color: var(--mute); font-size: 0.8rem; }
.fp-type {
  flex-shrink: 0; min-width: 44px; height: 36px; padding: 0 6px; display: grid; place-items: center;
  background: var(--card-2); border-radius: 8px; font-weight: 800; font-size: 0.78rem;
}
.fp-unit-info { flex: 1; min-width: 0; }
.fp-unit-info strong { display: block; font-size: 0.88rem; }
.fp-unit-info span { display: block; color: var(--mute); font-size: 0.75rem; }
.fp-status { font-size: 0.68rem; font-weight: 700; padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.st-available .fp-status { background: rgba(47, 138, 76, 0.12); color: #2f8a4c; }
.st-reserved .fp-status { background: rgba(160, 104, 32, 0.14); color: #a06820; }
.st-sold .fp-status { background: rgba(26, 29, 36, 0.08); color: var(--dim); }
.st-sold { opacity: 0.65; }
.fp-all { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.fp-all:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .fp-layout { grid-template-columns: 1fr; }
  .fp-panel { position: static; }
}
@media (max-width: 520px) {
  .fp-body { grid-template-columns: 60px 1fr; }
  .fp-card { padding: 16px 14px; }
}

/* ───────── LAYER 3: apartment grid ───────── */
.apartments-page main { flex: 1; padding: 24px 0 60px; }
.apartments-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 28px;
}
.apartments-page h1 {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.apartments-page .sub { color: var(--mute); margin-bottom: 22px; }

.filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  height: fit-content;
  position: sticky; top: 86px;
}
.filters h2 {
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.filter-group { margin-bottom: 22px; }
.filter-group label.field-label {
  display: block;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 10px;
}
.filter-group select,
.filter-group input[type="range"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  border-radius: 4px;
  font-family: inherit; font-size: 0.9rem;
}
.filter-group select:focus { outline: none; border-color: var(--accent); }
.range-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--mute-2);
}
.range-row input[type="number"] {
  width: 70px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  border-radius: 4px;
  font-family: inherit; font-size: 0.85rem;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card); color: var(--mute);
  cursor: pointer; font-size: 0.82rem; font-weight: 600;
  font-family: inherit;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease),
              color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
.chip.active {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
  box-shadow: 0 3px 10px rgba(196, 94, 31, 0.28);
}
.filter-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn {
  padding: 12px 16px;
  border: 0; border-radius: var(--radius);
  cursor: pointer; font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.10em; text-transform: uppercase;
  font-family: inherit;
  flex: 1;
  transition: background 0.22s var(--ease), transform 0.22s var(--ease),
              box-shadow 0.22s var(--ease), color 0.22s var(--ease),
              border-color 0.22s var(--ease);
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(196, 94, 31, 0.24);
}
.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(196, 94, 31, 0.30);
}
.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  color: var(--accent); border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  color: var(--mute);
  font-size: 0.88rem;
}
.result-bar strong { color: var(--ink); font-weight: 700; }
.sort {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: inherit; font-size: 0.85rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  text-decoration: none; color: inherit;
  display: block;
}
.card:hover {
  border-color: rgba(196, 94, 31, 0.22);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-img img { transition: transform 0.6s var(--ease); }
.card:hover .card-img img { transform: scale(1.04); }
.card-img {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-soft);
  overflow: hidden;
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.card-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: #fff;
  padding: 4px 10px; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 2px;
}
.card-body { padding: 14px 16px 16px; }
.card-id {
  color: var(--accent);
  font-weight: 800; font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.card-loc { color: var(--mute); font-size: 0.78rem; margin-top: 2px; }
.card-stats {
  display: flex; gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-stat {
  flex: 1;
  font-size: 0.82rem;
}
.card-stat span {
  display: block;
  color: var(--dim); font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 2px;
}
.card-stat strong { color: var(--ink); font-weight: 700; }
.card-more {
  margin-top: 12px;
  text-align: center;
  font-size: 0.8rem; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em; text-transform: uppercase;
}

.empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--mute);
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}

/* ───────── LAYER 4: apartment detail ───────── */
.detail-page main { flex: 1; padding: 24px 0 60px; }
.detail-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 22px;
}
.detail-head h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.02em;
}
.detail-head .detail-sub { color: var(--mute); margin-top: 4px; font-size: 0.95rem; }
.detail-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 32px;
  align-items: start;
}

.plan-viewer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.plan-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
}
.plan-image {
  background: var(--bg-soft);
  padding: 28px;
  min-height: 420px;
  display: grid; place-items: center;
}
.plan-image img { max-height: 560px; width: auto; max-width: 100%; }

.spec-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.spec-panel h2 {
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.spec-row {
  display: flex; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.spec-row:last-of-type { border-bottom: 0; }
.spec-row .k { color: var(--mute); }
.spec-row .v { color: var(--ink); font-weight: 700; }
.spec-actions { margin-top: 20px; display: grid; gap: 10px; }
.spec-actions .btn { width: 100%; padding: 14px; font-size: 0.82rem; }
.btn-tour {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 16px rgba(196, 94, 31, 0.32);
}
.btn-tour:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(196, 94, 31, 0.40);
}
.btn-tour::before {
  content: "▶";
  font-size: 0.7rem;
}

/* gallery + similar apartments under the fold */
.section {
  margin-top: 48px;
}
.section h2 {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.section .section-sub { color: var(--mute); margin-bottom: 20px; font-size: 0.92rem; }
.gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-item {
  aspect-ratio: 4/3;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 0.4s;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ───────── LAYER 5: tour modal/iframe ───────── */
.tour-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 40px;
}
.tour-overlay.open { display: flex; }
.tour-frame-wrap {
  width: 100%; height: 100%;
  max-width: 1400px; max-height: 800px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}
.tour-frame-wrap iframe {
  width: 100%; height: 100%;
  border: 0;
}
.tour-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: grid; place-items: center;
  transition: background 0.2s;
}
.tour-close:hover { background: var(--accent); }

.tour-note {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: var(--mute-2);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.78rem;
  z-index: 5;
  pointer-events: none;
}

/* ───────── footer ───────── */
.mini-foot {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 22px 0;
  font-size: 0.82rem;
  color: var(--mute);
}
.mini-foot .container {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}

/* ───────── responsive ───────── */
@media (max-width: 900px) {
  .container { padding: 0 20px; }
  .nav-inner { padding: 14px 20px; gap: 16px; }
  .nav-links { display: none; }
  .picker-legend { grid-template-columns: 1fr; }
  .apartments-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .building-head, .detail-head { flex-direction: column; align-items: flex-start; }
}

/* ═══ 360° tour — floor circles ═════════════════════════════════════
   Pannellum positions the hotspot div; js/tour.js sizes it by distance and
   squashes the ring by the viewing angle so it reads as lying on the floor. */
.pnlm-hotspot-base.tour-spot { cursor: pointer; }
.tour-spot .ts-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.92);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 38%, rgba(255, 255, 255, 0.08) 40% 100%);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(0, 0, 0, 0.15);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.tour-spot:hover .ts-ring {
  border-color: #fff;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0 38%, rgba(255, 255, 255, 0.2) 40% 100%);
}
/* "Step forward": the outgoing view keeps pushing in while it dissolves */
.pnlm-fade-img { transform-origin: 50% 50%; animation: tour-step 0.9s cubic-bezier(.3, 0, .4, 1) forwards; }
@keyframes tour-step { to { transform: scale(1.35); } }
/* Real-movement tour (js/pano3d.js) */
.p3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.p3-canvas:active { cursor: grabbing; }
.p3-title {
  position: absolute; left: 0; bottom: 0; padding: 6px 12px; border-radius: 0 10px 0 0;
  background: rgba(14, 15, 16, 0.6); color: #fff; font: 600 13px/1.2 'Inter', sans-serif; pointer-events: none;
}
.p3-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; background: #1a1b1e; font: 500 14px 'Inter', sans-serif;
}
/* Title pill Pannellum shows for the active scene */
.pnlm-panorama-info { border-radius: 0 0 10px 0; }

/* ───────── 3D WALKTHROUGH (js/walkthrough.js) ─────────
   Generated from the 2D plan; lives inside .ap-media on the apartment page. */
.ap-walk { position: absolute; inset: 0; background: #0e0f10; overflow: hidden; }
.ap-walk:fullscreen { border-radius: 0; }
.vw-canvas { display: block; width: 100%; height: 100%; cursor: grab; outline: none; touch-action: none; }
.vw-canvas:active { cursor: grabbing; }
.vw-doll .vw-canvas { cursor: pointer; }

/* dollhouse room labels, positioned by JS each frame */
.vw-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; display: none; }
.vw-doll .vw-labels { display: block; }
.vw-label {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 20px; background: rgba(14, 15, 16, 0.62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); pointer-events: auto; white-space: nowrap;
}
.vw-label button {
  border: 0; background: none; color: #fff; font: 600 0.74rem/1 'Inter', sans-serif;
  padding: 7px 11px; border-radius: 16px; cursor: pointer;
  transition: background 0.16s var(--ease);
}
.vw-label button:hover { background: rgba(255, 255, 255, 0.14); }
.vw-label .vw-label-360 { display: none; background: var(--accent); font-weight: 800; padding: 7px 9px; }
.vw-label .vw-label-360:hover { background: var(--accent-bright); }
.vw-label:hover, .vw-label:focus-within { z-index: 1; }
.vw-label:hover .vw-label-360, .vw-label:focus-within .vw-label-360 { display: inline-block; }
@media (hover: none) { .vw-label .vw-label-360 { display: inline-block; } }   /* touch: no hover to reveal it */
@media (max-width: 640px) {
  .vw-label button { font-size: 0.66rem; padding: 6px 8px; }
}

.vw-room, .vw-help, .vw-bar, .vw-loading {
  position: absolute; color: #fff; background: rgba(14, 15, 16, 0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.vw-room {
  left: 16px; top: 16px; display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 20px; font-size: 0.8rem; pointer-events: none;
}
.vw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 3px rgba(226, 112, 31, 0.3); }

.vw-map {
  position: absolute; right: 16px; top: 16px; width: 188px; aspect-ratio: 1;   /* JS sets the plan's own ratio */
  background: #fff; border-radius: 12px; overflow: hidden; cursor: crosshair;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.6);
}
.vw-map img, .vw-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.vw-map.wide { width: 260px; }

.vw-bar {
  left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 4px; border-radius: 24px;
}
.vw-bar button {
  border: 0; background: none; color: rgba(255, 255, 255, 0.82); font: 600 0.8rem/1 'Inter', sans-serif;
  padding: 9px 16px; border-radius: 20px; cursor: pointer; white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.vw-bar button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.vw-bar button.on { background: var(--accent); color: #fff; }
.vw-bar .vw-fs { padding: 9px 12px; font-size: 0.95rem; }

.vw-help {
  left: 16px; bottom: 16px; padding: 6px 12px; border-radius: 20px;
  font-size: 0.72rem; color: rgba(255, 255, 255, 0.85); pointer-events: none;
}

.vw-pad {
  position: absolute; right: 16px; bottom: 16px; display: none;
  grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(2, 42px); gap: 6px;
}
.vw-pad button {
  border: 0; border-radius: 10px; background: rgba(14, 15, 16, 0.6); color: #fff;
  font-size: 0.9rem; touch-action: none; user-select: none; -webkit-user-select: none;
}
.vw-pad [data-k="f"] { grid-column: 2; }
.vw-pad [data-k="l"] { grid-column: 1; grid-row: 2; }
.vw-pad [data-k="b"] { grid-column: 2; grid-row: 2; }
.vw-pad [data-k="r"] { grid-column: 3; grid-row: 2; }
.vw-doll .vw-pad { display: none !important; }

.vw-loading {
  inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #0e0f10; font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); text-align: center; padding: 20px;
}
.vw-spin {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent-bright);
  animation: vw-spin 0.8s linear infinite;
}
@keyframes vw-spin { to { transform: rotate(360deg); } }

@media (hover: none), (max-width: 860px) {
  .vw-pad { display: grid; }
  .vw-help { display: none; }
  .vw-bar { left: 16px; transform: none; }
}
@media (max-width: 860px) {
  .vw-map { width: 112px; right: 10px; top: 10px; }
  .vw-map.wide { width: 156px; }
  .vw-room { left: 10px; top: 10px; }
}
