/* ============================================================
   Tokens
   ============================================================ */
:root {
  --orange: #f87b1b;
  --orange-hover: #f98f3f;
  --navy: #11224e;
  --navy-hover: #1c3061;

  --text-primary: #11224e;
  --text-secondary: #4a5470;
  --text-muted: #8a91a6;

  --bg-page: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-subtle: #eef0f4;
  --bg-subtle-hover: #f3f5f8;

  --border: #eef0f5;
  --border-light: rgba(17, 34, 78, 0.06);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-control: 100px;

  --space-2: 2px;
  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;

  --shadow-soft: 0 1px 2px rgba(17, 34, 78, 0.04), 0 6px 20px rgba(17, 34, 78, 0.05);

  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-blur: saturate(1.4) blur(14px);

  --header-h: 64px;
  --filters-h: 94px;
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-style: normal;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p {
  margin: 0;
}

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

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

input,
select {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Header
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1680px;
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.logo svg {
  color: var(--orange);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(248, 123, 27, 0.14);
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition: background-color 150ms ease;
}

.nav-link:hover {
  background: var(--bg-subtle-hover);
}

.nav-link--active {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.nav-link--active:hover {
  background: var(--bg-subtle-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.btn--primary {
  background: var(--orange);
  color: #ffffff;
  border-color: rgba(248, 123, 27, 0.25);
}

.btn--primary:hover {
  background: var(--orange-hover);
}

.btn--navy {
  background: var(--navy);
  color: #ffffff;
  border-color: rgba(17, 34, 78, 0.18);
}

.btn--navy:hover {
  background: var(--navy-hover);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--border);
}

.btn--lg {
  padding: 12px var(--space-24);
  font-size: 15px;
  border-radius: var(--radius-control);
}

/* ============================================================
   Filters — compact block at the top of the list panel
   ============================================================ */
.filters {
  border-bottom: 1px solid var(--border);
}

.filters__inner {
  padding: var(--space-16);
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-16);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.filter-group__label {
  font-size: 12px;
  font-weight: 500;
  color: #000000;
}

.filter-select,
.filter-input {
  height: 40px;
  padding: 0 var(--space-16);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.72);
  appearance: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.filter-select:hover,
.filter-input:hover {
  border-color: var(--border);
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: rgba(17, 34, 78, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

.filter-select {
  padding-right: var(--space-32);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a91a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.filter-input {
  width: 104px;
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.price-range {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.price-range__divider {
  color: var(--text-muted);
  font-size: 13px;
}

.segmented {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
}

.segmented__btn {
  height: 36px;
  min-width: 44px;
  padding: 0 var(--space-16);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition: background-color 150ms ease;
}

.segmented__btn:hover {
  background: var(--bg-subtle-hover);
}

.segmented__btn--active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
}

.segmented__btn--active:hover {
  background: var(--bg-surface);
}

.filters__reset {
  height: 40px;
  padding: 0 var(--space-16);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.55);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.filters__reset:hover {
  background: var(--bg-subtle-hover);
}

.filters__spacer {
  display: none;
}

/* ============================================================
   Layout: fullscreen map + floating list panel
   ============================================================ */
.page-catalog {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.catalog__panel {
  position: fixed;
  top: calc(var(--header-h) + var(--space-16));
  left: var(--space-16);
  bottom: var(--space-16);
  width: 480px;
  max-width: calc(100% - var(--space-32));
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* Detail panel — same glass treatment as the listings panel */
.catalog-detail {
  position: fixed;
  top: calc(var(--header-h) + var(--space-16));
  right: var(--space-16);
  bottom: var(--space-16);
  width: 420px;
  max-width: calc(100% - var(--space-32));
  z-index: 50;
  display: none;
  flex-direction: column;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: fade-in 220ms ease both;
}

.catalog-detail--open {
  display: flex;
}

.catalog-detail__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-16);
}

.catalog-detail__scroll::-webkit-scrollbar {
  width: 8px;
}

.catalog-detail__scroll::-webkit-scrollbar-thumb {
  background: rgba(17, 34, 78, 0.15);
  border-radius: 999px;
}

.catalog-detail__toolbar {
  margin-bottom: var(--space-16);
}

.catalog-detail__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding-bottom: var(--space-16);
}

.catalog-detail__body h2 {
  font-size: 20px;
}

.catalog-detail__body h3 {
  font-size: 16px;
  color: var(--text-primary);
}

.catalog-detail__price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.catalog-detail__price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.catalog-detail__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Shared glass surface for every block inside the detail card */
.catalog-detail__glass,
.catalog-detail .back-link,
.catalog-detail .detail__title-block,
.catalog-detail .catalog-detail__price,
.catalog-detail .stats--panel .stat,
.catalog-detail .section,
.catalog-detail .nearby-toggles,
.catalog-detail .contact-card--panel,
.catalog-detail .panel-gallery__all {
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

.catalog-detail .back-link {
  border-radius: var(--radius-sm);
}

.catalog-detail .back-link:hover {
  background: rgba(255, 255, 255, 0.58);
}

.catalog-detail .detail__title-block {
  padding: var(--space-16);
  border-radius: var(--radius-md);
  gap: var(--space-8);
}

.catalog-detail .catalog-detail__price {
  padding: var(--space-16);
  border-radius: var(--radius-md);
}

.catalog-detail .section {
  padding: var(--space-16);
  border-radius: var(--radius-md);
  gap: var(--space-12);
}

.nearby-toggles {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-top: var(--space-8);
  padding: 0;
  border-radius: var(--radius-md);
}

/* Avoid nested frosted boxes inside an already-glassy section */
.catalog-detail .section .nearby-toggles {
  background: transparent;
  border: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 0;
}

.nearby-toggles__item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.nearby-toggles__item input {
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
}

.panel-gallery {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: repeat(2, 88px);
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.panel-gallery__item {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  cursor: pointer;
}

.panel-gallery__item:first-child {
  grid-row: span 2;
}

.panel-gallery--single {
  grid-template-columns: 1fr;
  grid-template-rows: 200px;
}

.panel-gallery--single .panel-gallery__item:first-child {
  grid-row: auto;
}

.panel-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-gallery__all {
  position: absolute;
  right: var(--space-8);
  bottom: var(--space-8);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-gallery__all:hover {
  background: rgba(255, 255, 255, 0.62);
}

.stats--panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats--panel .stat {
  border-radius: var(--radius-md);
}

.features--panel {
  grid-template-columns: 1fr;
}

.contact-card--panel {
  border-radius: var(--radius-md);
}

.map-layers--detail {
  right: calc(420px + var(--space-32));
  bottom: var(--space-16);
}

.page-catalog.detail-open .catalog__map .mapboxgl-ctrl-top-right {
  right: calc(420px + var(--space-16));
}

.catalog__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-16);
}

.catalog__list::-webkit-scrollbar {
  width: 8px;
}

.catalog__list::-webkit-scrollbar-thumb {
  background: rgba(17, 34, 78, 0.15);
  border-radius: 999px;
}

.catalog__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.catalog__header h1 {
  font-size: 18px;
}

.catalog__count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* ============================================================
   Card — compact horizontal row
   ============================================================ */
.card {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: var(--space-8);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.48);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-md);
  box-shadow: none;
  animation: fade-in 300ms ease both;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.card:hover {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.72);
}

.card--selected {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(17, 34, 78, 0.22);
  box-shadow: 0 0 0 1px rgba(17, 34, 78, 0.12);
}

.card__media {
  position: relative;
  width: 132px;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__badge {
  display: none;
}

.card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-2) 0;
  min-width: 0;
}

.card__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card__price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__address {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) 12px;
  margin-top: var(--space-4);
  font-size: 12px;
  color: var(--text-secondary);
}

.card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
}

.card__meta-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  display: none;
  padding: var(--space-64) var(--space-24);
  text-align: center;
  animation: fade-in 300ms ease both;
}

.empty-state--visible {
  display: block;
}

.empty-state h3 {
  margin-bottom: var(--space-8);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: var(--space-16);
}

/* ============================================================
   Map
   ============================================================ */
.catalog__map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* Keep map zoom controls below the glass header */
.catalog__map .mapboxgl-ctrl-top-right {
  top: var(--header-h);
}

.map-container {
  width: 100%;
  height: 100%;
  background: var(--bg-subtle);
}

.map-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-24);
}

.map-placeholder__card {
  max-width: 360px;
  padding: var(--space-24);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.map-placeholder__card h3 {
  margin-bottom: var(--space-8);
}

.map-placeholder__card p {
  font-size: 14px;
  color: var(--text-secondary);
}

.map-placeholder__card code {
  display: inline-block;
  margin-top: var(--space-8);
  padding: var(--space-2) var(--space-8);
  border-radius: var(--space-4);
  background: var(--bg-subtle);
  font-size: 13px;
  color: var(--text-primary);
}

/* Cluster badge */
.map-cluster {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 150ms ease, background-color 150ms ease;
}

.map-cluster:hover {
  background: var(--navy-hover);
  transform: scale(1.06);
}

/* Price hotspot marker */
.map-pin {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-soft);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease;
  animation: fade-in 300ms ease both;
}

.map-pin:hover {
  background: rgba(255, 255, 255, 0.92);
}

.map-pin--active {
  background: var(--navy);
  color: #ffffff;
}

.map-pin--active:hover {
  background: var(--navy-hover);
}

/* Mapbox popup restyle */
.mapboxgl-popup {
  animation: fade-in 200ms ease both;
}

.mapboxgl-popup-content {
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  width: 240px;
}

.mapboxgl-popup-tip {
  display: none;
}

.map-popup__media {
  aspect-ratio: 3 / 2;
  background: var(--bg-subtle);
}

.map-popup__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-popup__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-16);
}

.map-popup__price {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.map-popup__title {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.map-popup__link {
  margin-top: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #ffffff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background-color 150ms ease;
}

.map-popup__link:hover {
  background: var(--navy-hover);
}

.mapboxgl-ctrl-group {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-soft) !important;
}

/* Nearby POI layer toggles */
.map-layers {
  position: absolute;
  right: var(--space-16);
  bottom: var(--space-16);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 200px;
  padding: var(--space-16);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-soft);
}

.map-layers__title {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.map-layers__item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.map-layers__item input {
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
  cursor: pointer;
}

.map-layers__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.map-layers__swatch--grocery { background: #6dbe45; }
.map-layers__swatch--restaurant { background: var(--orange); }
.map-layers__swatch--gym { background: var(--navy); }
.map-layers__swatch--education { background: var(--text-secondary); }

.poi-marker {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 150ms ease;
}

.poi-marker:hover {
  transform: scale(1.08);
}

.poi-marker__icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.poi-popup {
  padding: var(--space-12, 12px) var(--space-16);
}

.poi-popup__name {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
}

.poi-popup__distance {
  margin-top: var(--space-4);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.poi-popup__address {
  margin-top: var(--space-4);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.poi-popup-wrap .mapboxgl-popup-content {
  width: auto;
  min-width: 160px;
  max-width: 220px;
}

.detail-map {
  position: relative;
}

.detail-map--poi .map-layers {
  top: var(--space-16);
  right: var(--space-16);
  bottom: auto;
}

/* ============================================================
   Detail page
   ============================================================ */
.detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-24);
}

.detail__toolbar {
  margin-bottom: var(--space-16);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 150ms ease;
}

.back-link:hover {
  background: var(--bg-subtle-hover);
}

/* Gallery */
.gallery {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
  height: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-32);
}

.gallery__item {
  position: relative;
  overflow: hidden;
  background: var(--bg-subtle);
  cursor: pointer;
  padding: 0;
}

.gallery__item:first-child {
  grid-row: span 2;
}

.gallery--compact {
  grid-template-columns: 2fr 1fr;
}

.gallery--single {
  grid-template-columns: 1fr;
}

.gallery--single .gallery__item:first-child {
  grid-row: auto;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(17, 34, 78, 0);
  transition: background-color 150ms ease;
}

.gallery__item:hover::after {
  background: rgba(17, 34, 78, 0.08);
}

.gallery__all {
  position: absolute;
  right: var(--space-16);
  bottom: var(--space-16);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background-color 150ms ease;
}

.gallery__all:hover {
  background: rgba(255, 255, 255, 0.92);
}

/* Content grid */
.detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-32);
  align-items: start;
}

.detail__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  min-width: 0;
}

.detail__title-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.detail__address {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 15px;
  color: var(--text-muted);
}

.detail__address svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-8);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-16);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.stat__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat__label {
  font-size: 13px;
  color: var(--text-muted);
}

.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.section p {
  line-height: 1.7;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-8) var(--space-16);
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 15px;
  color: var(--text-secondary);
}

.features li svg {
  color: var(--orange);
  flex-shrink: 0;
}

.detail-map {
  height: 360px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-subtle);
}

/* Sidebar */
.detail__aside {
  position: sticky;
  top: calc(var(--header-h) + var(--space-24));
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: var(--space-24);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.contact-card__price {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.contact-card__price span {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
}

.contact-card__divider {
  height: 1px;
  background: var(--border);
}

.contact-card__agent {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.contact-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-weight: 600;
  flex-shrink: 0;
}

.contact-card__agent-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-card__agent-role {
  font-size: 13px;
  color: var(--text-muted);
}

.contact-card__note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Not found */
.not-found {
  padding: var(--space-64) var(--space-24);
  text-align: center;
}

.not-found h1 {
  margin-bottom: var(--space-8);
}

.not-found p {
  color: var(--text-muted);
  margin-bottom: var(--space-24);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: rgba(12, 18, 38, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) var(--space-24);
}

.lightbox__counter {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.lightbox__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transition: background-color 150ms ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-16);
  padding: 0 var(--space-24) var(--space-48);
  min-height: 0;
}

.lightbox__img {
  max-width: min(1100px, calc(100% - 140px));
  max-height: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
  animation: fade-in 250ms ease both;
}

.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  flex-shrink: 0;
  transition: background-color 150ms ease;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.footer__inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--space-24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .detail__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail__aside {
    position: static;
  }
}

@media (max-width: 1024px) {
  .gallery {
    height: 360px;
  }
}

@media (max-width: 768px) {
  .header__nav {
    display: none;
  }

  .map-layers {
    right: var(--space-8);
    bottom: var(--space-8);
    min-width: 0;
    padding: var(--space-8) var(--space-16);
  }

  .catalog__panel {
    top: calc(var(--header-h) + var(--space-8));
    left: var(--space-8);
    bottom: var(--space-8);
    max-width: calc(100% - var(--space-16));
  }

  .page-catalog.detail-open .catalog__panel {
    display: none;
  }

  .catalog-detail {
    top: calc(var(--header-h) + var(--space-8));
    right: var(--space-8);
    left: var(--space-8);
    bottom: var(--space-8);
    width: auto;
    max-width: none;
  }

  .map-layers--detail {
    right: var(--space-8);
  }

  .page-catalog.detail-open .catalog__map .mapboxgl-ctrl-top-right {
    right: 0;
  }

  .detail {
    padding: var(--space-16);
  }

  .gallery {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .gallery__item {
    aspect-ratio: 3 / 2;
  }

  .gallery__item:first-child {
    grid-row: auto;
  }

  .gallery__item:not(:first-child) {
    display: none;
  }

  .lightbox__img {
    max-width: 100%;
  }

  .lightbox__nav {
    position: absolute;
    bottom: var(--space-24);
  }

  .lightbox__nav--prev {
    left: var(--space-24);
  }

  .lightbox__nav--next {
    right: var(--space-24);
  }

  h1 {
    font-size: 24px;
  }
}
