/* Общая композиция товарных страниц ЖК и посёлков: утверждённые BASE 4 / PRO 4.
   Подключается после темы. Данные, контакты и поведение существующих компонентов
   не меняются; область действия ограничена data-property-detail. */
body[data-property-detail] main.wrap {
  max-width: 1272px;
  padding: 24px 24px 40px;
}
body[data-property-detail] .complex { display: block; min-width: 0; }
body[data-property-detail] .detail-crumbs {
  margin: 0;
  padding: 0 0 20px;
  font-size: 13px;
  line-height: 20px;
}
body[data-property-detail] h1 {
  text-wrap: balance;
  overflow-wrap: anywhere;
}
body[data-property-detail] .complex .detail-body {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 304px !important;
  gap: 32px;
  align-items: start;
  width: 100%;
}
body[data-property-detail] .complex .detail-body > .detail-content {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
}
/* Старое правило PRO ставило сайдбар в row 2 / span 4: контакты уезжали вниз. */
body[data-property-detail] .complex .detail-body > .detail-sidebar {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
}
body[data-property-detail] .detail-sidebar {
  position: sticky;
  /* space.300 (24px): тот же зазор до detail-nav, что и в PRO-раскладке. */
  top: calc(var(--site-header-height, 56px) + 48px + 1.5rem);
  max-height: calc(100dvh - var(--site-header-height, 56px) - 40px);
  padding: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-gutter: auto;
}
/* Свёрнутый блок «Коротко о ЖК» не должен тянуть пустую карточку на 100+ px. */
body[data-property-detail] .detail-sidebar > .detail-summary { padding: 10px 20px; }
body[data-property-detail] .detail-summary summary h2 { margin: 0; line-height: 44px; }
body[data-property-detail] .detail-content > section,
body[data-property-detail] .detail-sidebar > section {
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  scroll-margin-top: calc(var(--site-header-height, 56px) + 68px);
}
body[data-property-detail] .detail-content h2 {
  margin: 0 0 20px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}
body[data-property-detail] .detail-content h3 { font-size: 18px; line-height: 26px; }
body[data-property-detail] .detail-content p { font-size: 14px; line-height: 23px; }
body[data-property-detail] .detail-content #overview > div { max-width: 74ch; }
body[data-property-detail] .detail-sidebar .sales-contacts { display: block; }
body[data-property-detail] .sales-contact-heading h2 {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 28px;
}
body[data-property-detail] .sales-contacts .detail-price {
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
body[data-property-detail] .price-note { font-size: 12px; line-height: 18px; color: var(--muted); }
body[data-property-detail] .sales-contact-actions { gap: 8px; }
body[data-property-detail] .sales-contact-actions > .primary,
body[data-property-detail] .sales-contact-visit > summary {
  min-height: 44px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: normal;
}
body[data-property-detail] .detail-phone-contact { display: flex; align-items: center; gap: 8px; margin-block: 16px; }
body[data-property-detail] .detail-phone-action { flex: 1; min-width: 0; }
body[data-property-detail] .detail-phone-reveal {
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  white-space: normal;
}
body[data-property-detail] .sales-contact-phone { margin: 8px 0; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
body[data-property-detail] .sales-contact-hours,
body[data-property-detail] .sales-contact-address { margin: 12px 0; font-size: 13px; line-height: 20px; }
body[data-property-detail] .detail-summary { margin-top: 12px; }
body[data-property-detail] .detail-summary summary { min-height: 44px; }
body[data-property-detail] .detail-summary h2 { font-size: 14px; line-height: 20px; }
body[data-property-detail] .complex .detail-nav {
  position: sticky;
  top: var(--site-header-height, 56px);
  z-index: 25;
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  padding: 0;
  gap: 8px;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  scrollbar-width: none;
}
body[data-property-detail] .complex .detail-nav a {
  display: flex;
  flex: none;
  align-items: center;
  min-height: 48px;
  padding: 12px 8px;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 20px;
}
body[data-property-detail] .complex .detail-nav a:first-child { padding-left: 0; }
body[data-property-detail] .complex .detail-nav a[aria-current] {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-weight: 500;
}
body[data-property-detail] .complex-highlights { gap: 0; background: transparent; grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-property-detail] .complex-highlights > div {
  min-height: 88px;
  padding: 16px 12px 16px 32px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
body[data-property-detail] .complex-highlights > div > .icon { left: 8px; top: 19px; }
body[data-property-detail] .complex-highlights dt { font-size: 12px; line-height: 18px; }
body[data-property-detail] .complex-highlights dd { font-size: 15px; line-height: 22px; font-weight: 500; }
body[data-property-detail] .room-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
body[data-property-detail] .room-summary-link { padding: 16px; border-radius: 8px; }
body[data-property-detail] .room-summary-name { font-size: 14px; }
body[data-property-detail] .room-summary-price { font-size: 20px; line-height: 28px; white-space: normal; }
body[data-property-detail] .room-summary-area { font-size: 14px; }
body[data-property-detail] .room-summary-count,
body[data-property-detail] .room-summary-note,
body[data-property-detail] .room-summary-confirmed { font-size: 12px; line-height: 18px; }
body[data-property-detail] .lot { padding: 16px 0; gap: 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
body[data-property-detail] .lot-price b { font-size: 18px; line-height: 26px; font-weight: 600; }
body[data-property-detail] .lot-main { font-size: 14px; line-height: 20px; }
body[data-property-detail] .lot-price > span { font-size: 12px; line-height: 18px; }
body[data-property-detail] .feature-list { gap: 8px; }
body[data-property-detail] .map-single { height: 380px; border-radius: 8px; }
body[data-property-detail] .source { margin-top: 24px; font-size: 12px; line-height: 20px; }
body[data-property-detail] .detail-related { margin-top: 32px; }

/* BASE: галерея и настоящий отдел продаж рядом, факты без искусственных пустот. */
body[data-property-detail="base"] .complex .detail-hero.property-base-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 20px 32px;
  align-items: start;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body[data-property-detail] .complex .property-heading { grid-column: 1 / -1; min-width: 0; }
body[data-property-detail] .complex .property-heading { width: 100%; max-width: none; }
/* Отдельная левая колонка не растягивает строки галереи под высокий сайдбар. */
body[data-property-detail] .complex .property-base-content {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-self: start;
  min-width: 0;
  gap: 20px;
}
body[data-property-detail] .complex .property-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; line-height: 20px; color: var(--muted); }
body[data-property-detail] .complex .property-kicker .detail-badges { position: static; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
body[data-property-detail] .complex .property-status { padding: 3px 8px; border-radius: 4px; background: var(--surface); color: var(--ink); }
body[data-property-detail] .complex .property-title-line { display: flex; gap: 16px; align-items: start; }
body[data-property-detail] .property-title-line h1 { flex: 1; margin: 0; font-size: 36px; line-height: 44px; font-weight: 700; }
body[data-property-detail] .complex .property-title-line .favorite-toggle { position: static; flex: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); }
body[data-property-detail] .complex .property-address { margin: 8px 0 0; font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
body[data-property-detail] .complex .property-address a,
body[data-property-detail] .complex .property-address > span { display: inline-flex; align-items: start; gap: 6px; max-width: none; white-space: normal; overflow: visible; color: var(--muted); }
body[data-property-detail] .complex .property-address .icon { flex: none; margin-top: 2px; }
body[data-property-detail] .complex .property-developer { margin: 8px 0 0; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
body[data-property-detail] .complex .property-developer a,
body[data-property-detail] .complex .property-developer strong { max-width: none; white-space: normal; overflow: visible; text-overflow: clip; }
body[data-property-detail] .complex .property-developer > span { color: var(--muted); }
body[data-property-detail] .complex .property-base-media { position: relative; grid-column: 1; min-width: 0; min-height: 0; height: auto; width: 100%; aspect-ratio: 9 / 4; }
body[data-property-detail] .complex .property-mosaic { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; }
body[data-property-detail] .complex .property-mosaic-side { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; min-width: 0; min-height: 0; }
body[data-property-detail] .complex .property-mosaic--pair .property-mosaic-side { grid-template-rows: minmax(0, 1fr); }
body[data-property-detail] .complex .property-main-photo { position: relative; overflow: hidden; min-width: 0; min-height: 0; height: 100%; margin: 0; border-radius: 12px; background: var(--surface); }
body[data-property-detail] .complex .property-main-photo > a { display: block; position: absolute; inset: 0; height: 100%; }
body[data-property-detail] .complex .property-main-photo img,
body[data-property-detail] .complex .property-mosaic-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
body[data-property-detail] .complex .property-mosaic-thumb { display: block; position: relative; overflow: hidden; min-width: 0; min-height: 0; border-radius: 12px; background: var(--surface); }
body[data-property-detail] .complex .property-mosaic-thumb img { position: absolute; inset: 0; }
body[data-property-detail] .complex .property-main-photo,
body[data-property-detail] .complex .property-mosaic-thumb { grid-column: auto; grid-row: auto; }
body[data-property-detail] .complex .property-hero-map { position: absolute; inset: 0; display: block; border-radius: 12px; overflow: hidden; }
body[data-property-detail] .complex .property-hero-map img { display: block; width: 100%; height: 100%; object-fit: cover; }
body[data-property-detail] .complex .property-location-link { display: inline-flex; position: static; grid-column: 1; align-items: center; justify-self: start; min-height: 44px; gap: 8px; width: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--accent); font-size: 14px; line-height: 20px; }
body[data-property-detail] .complex .property-photo-bottom { position: absolute; inset: auto 16px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
/* Правый кластер на снимке: «Расположение» и плашка материала в одной линии.
   Кластер переносится, если плашка длинная; кнопка «Расположение» — никогда. */
body[data-property-detail] .complex .property-photo-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; margin-left: auto; }
body[data-property-detail] .complex .property-photo-actions .property-location-link { flex: none; white-space: nowrap; }
body[data-property-detail] .complex .property-photo-bottom a { position: static; pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 6px; background: var(--panel); color: var(--ink); font-size: 13px; line-height: 20px; font-weight: 500; }
/* Плашка материала — в левом верхнем углу снимка: внизу справа остаётся одна
   кнопка «Расположение», поэтому кластер выровнен по правому краю без зазоров. */
body[data-property-detail] .complex .property-photo-mark {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  max-width: calc(100% - 32px); padding: 4px 8px; border-radius: 4px;
  background: var(--ink); color: var(--panel);
  font-size: 12px; line-height: 18px; white-space: normal;
  pointer-events: none;
}
body[data-property-detail] .complex .property-facts { display: flex; grid-column: 1; gap: 24px; margin: 0; padding: 0 0 20px; border-bottom: 1px solid var(--line); }
body[data-property-detail] .complex .property-facts > div { min-width: 0; flex: 1; }
body[data-property-detail] .complex .property-facts > .property-fact-deadline { flex: 2; }
body[data-property-detail] .complex .property-facts dt { font-size: 12px; line-height: 18px; color: var(--muted); }
body[data-property-detail] .complex .property-facts dd { margin: 4px 0 0; font-size: 15px; line-height: 22px; font-weight: 500; overflow-wrap: anywhere; }
body[data-property-detail] .complex .property-sales-slot { grid-column: 2; grid-row: 2; align-self: start; min-width: 0; }
/* Фотография шапки ЖК — той же высоты, что карточка продаж справа: ряд сетки
   тянется по карточке, снимок заполняет ряд. Кнопка «Расположение» живёт на
   самом снимке и в раскладке ряда не участвует. Правило только для
   двухколоночной раскладки: на узком экране шапка — одна колонка и снимок
   держит свои пропорции (владелец, 30.10.2026). */
@media (min-width: 1024px) {
  /* Условие `:has(...)` обязательно: если карточки продаж нет, ряд тянется
     по снимку и пропорции остаются прежними. */
  body[data-property-detail] .complex .property-base-hero:has(.property-sales-slot > *) .property-base-content {
    align-self: stretch;
    align-content: stretch;
  }

  body[data-property-detail] .complex .property-base-hero:has(.property-sales-slot > *) .property-base-media {
    aspect-ratio: auto;
  }
}

/* Высота ряда шапки в двухколоночной раскладке — по карточке справа. Токен не
   нужен: у ЖК высоту задаёт карточка предложения, у посёлка — карточка «Отдел
   продаж», обе растягивают снимок по себе (villages/detail-page.css). */
body[data-property-detail] .property-sales-slot .detail-sidebar { position: static; width: 100%; max-height: none; overflow: visible; }
body[data-property-detail] .property-sales-slot .detail-summary { margin-top: 12px; }
body[data-property-detail="base"] .complex .detail-body { display: block !important; }
body[data-property-detail="base"] .detail-content #characteristics .complex-highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body[data-property-detail="base"] .detail-content #overview > div { max-width: 88ch; }
body[data-property-detail] .complex .property-base-offer { display: none; }
body[data-property-detail] .complex .property-label { display: block; font-size: 12px; line-height: 18px; color: var(--muted); }
body[data-property-detail] .complex .property-base-offer > strong { display: block; margin-top: 4px; font-size: 32px; line-height: 40px; }
body[data-property-detail] .complex .property-base-offer > p { margin: 8px 0 0; font-size: 14px; line-height: 22px; color: var(--muted); }
body[data-property-detail] .complex .property-offer-checked { display: block; margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--muted); }
body[data-property-detail] .complex .property-base-cta { margin-top: 20px; }
body[data-property-detail] .complex .property-base-cta .primary { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; padding: 12px 20px; border-radius: 8px; font-size: 14px; line-height: 20px; white-space: normal; }

/* PRO: цельная фотография, контрастная композиция и содержательный рассказ. */
body[data-property-detail="pro"] { background: var(--panel); }
body[data-property-detail="pro"] main.wrap { padding-top: 24px; }
body[data-property-detail="pro"] .detail-crumbs { display: none; }
body[data-property-detail="pro"] .complex.complex--pro .pro-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
  grid-template-rows: auto 1fr;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
}
body[data-property-detail="pro"] .pro-hero-media {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: stretch;
  height: auto;
  min-height: 0;
  aspect-ratio: 1.3;
}
body[data-property-detail="pro"] .pro-hero-image,
body[data-property-detail="pro"] .pro-hero-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
body[data-property-detail="pro"] .pro-hero-title {
  position: static;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 40px 32px 0;
  color: var(--panel);
}
body[data-property-detail="pro"] .pro-hero-title h1 { max-width: 20ch; font-size: 44px; line-height: 48px; font-weight: 700; }
body[data-property-detail="pro"] .pro-hero-kicker { font-size: 13px; line-height: 20px; color: #ffffffe6; }
body[data-property-detail="pro"] .pro-hero-address { font-size: 14px; line-height: 22px; }
body[data-property-detail="pro"] .pro-hero-shade { background: linear-gradient(180deg, #18233340, transparent 50%); }
body[data-property-detail="pro"] .pro-hero-top { left: 24px; right: 24px; top: 24px; }
body[data-property-detail="pro"] .pro-hero-mark { left: 16px; right: auto; }
body[data-property-detail="pro"] .pro-hero-gallery { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
body[data-property-detail="pro"] .pro-hero-gallery span { display: none; }
body[data-property-detail="pro"] .pro-hero-tools .favorite-toggle { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
body[data-property-detail="pro"] .pro-offer {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: end;
  min-width: 0;
  padding: 32px;
  gap: 24px;
}
body[data-property-detail="pro"] .pro-offer-price { font-size: 36px; line-height: 42px; white-space: normal; overflow-wrap: anywhere; }
body[data-property-detail="pro"] .pro-offer-price--quiet { font-size: 28px; line-height: 36px; }
body[data-property-detail="pro"] .pro-offer-label { font-size: 12px; line-height: 18px; }
body[data-property-detail="pro"] .pro-offer-note { font-size: 14px; line-height: 22px; text-wrap: balance; }
body[data-property-detail="pro"] .pro-offer-checked { font-size: 12px; line-height: 18px; color: #ffffffb8; }
body[data-property-detail="pro"] .pro-offer-developer { display: none; }
body[data-property-detail="pro"] .pro-offer-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
body[data-property-detail="pro"] .pro-cta { min-height: 48px; padding: 12px 20px; border-radius: 8px; font-size: 14px; line-height: 20px; font-weight: 500; white-space: normal; text-align: center; }
body[data-property-detail="pro"] .pro-offer-actions > .pro-cta:only-child { background: var(--accent); border-color: var(--accent); color: var(--panel); }
body[data-property-detail="pro"] .pro-sticky:not([data-open]) { visibility: hidden; pointer-events: none; }
body[data-property-detail="pro"] .complex .property-facts { padding: 24px 0; margin-bottom: 32px; }
body[data-property-detail="pro"] .pro-story { margin: 0 0 32px; padding: 0; background: transparent; border: 0; }
body[data-property-detail="pro"] .pro-story-head { margin-bottom: 20px; }
body[data-property-detail="pro"] .pro-story-head h2 { font-size: 28px; line-height: 36px; font-weight: 600; }
body[data-property-detail="pro"] .pro-story-dates { display: none; }
body[data-property-detail="pro"] .pro-story-grid { grid-template-columns: 1.5fr 1fr 1fr; align-items: start; gap: 20px; }
body[data-property-detail="pro"] .pro-story-link { aspect-ratio: 16 / 10; border: 0; border-radius: 10px; }
body[data-property-detail="pro"] .pro-story-item:first-child .pro-story-link { aspect-ratio: 4 / 3; }
body[data-property-detail="pro"] .pro-story-item:not(:first-child) { padding-top: 40px; }
body[data-property-detail="pro"] .pro-story-item figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 20px; }
body[data-property-detail="pro"] .pro-story-dot { position: relative; width: 44px; height: 44px; border-radius: 50%; background: transparent; }
body[data-property-detail="pro"] .pro-story-dot::after { content: ''; position: absolute; width: 8px; height: 8px; inset: 18px; border-radius: 50%; background: var(--line); }
body[data-property-detail="pro"] .pro-story-dot.is-current::after { background: var(--accent); }
body[data-property-detail="pro"] .complex .detail-nav { background: var(--panel); }
body[data-property-detail="pro"] .detail-content > section { padding: 0 0 32px; margin-bottom: 32px; border-width: 0 0 1px; border-radius: 0; }
/* Без обложки нет пустого фотоблока: отметки и избранное сохраняют свой ряд. */
body[data-property-detail="pro"] .complex.complex--pro .pro-hero--no-photo {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
}
body[data-property-detail="pro"] .pro-hero--no-photo .pro-hero-media {
  grid-column: 1;
  grid-row: 1;
  aspect-ratio: auto;
  padding: 24px 24px 0;
}
body[data-property-detail="pro"] .pro-hero--no-photo .pro-hero-top { position: static; }
body[data-property-detail="pro"] .pro-hero--no-photo .pro-hero-fallback,
body[data-property-detail="pro"] .pro-hero--no-photo .pro-hero-shade { display: none; }
body[data-property-detail="pro"] .pro-hero--no-photo .pro-hero-title { grid-column: 1; grid-row: 2; padding-top: 24px; }
body[data-property-detail="pro"] .pro-hero--no-photo .pro-offer { grid-column: 1; grid-row: 3; }
body[data-property-detail] :is(a, button, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body[data-property-detail="pro"] .pro-hero :is(a, button):focus-visible { outline-color: var(--panel); }

@media (max-width: 1079px) {
  body[data-property-detail] .complex .detail-body { grid-template-columns: minmax(0, 1fr) !important; gap: 24px; }
  body[data-property-detail] .complex .detail-body > .detail-content,
  body[data-property-detail] .complex .detail-body > .detail-sidebar { grid-column: 1 / -1 !important; grid-row: auto !important; }
  body[data-property-detail] .detail-sidebar { position: static; max-height: none; overflow: visible; }
  body[data-property-detail] .detail-sidebar .detail-summary { display: block; }
  body[data-property-detail="base"] .complex .detail-hero.property-base-hero { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  body[data-property-detail] .complex .property-base-content { display: contents; }
  body[data-property-detail] .complex .property-base-hero > *, body[data-property-detail] .complex .property-heading > * { min-width: 0; max-width: 100%; }
  body[data-property-detail] .complex .property-base-media { order: -1; width: 100%; height: auto; aspect-ratio: 16 / 10; }
  body[data-property-detail] .complex .property-heading, body[data-property-detail] .complex .property-base-offer { width: 100%; }
  body[data-property-detail] .complex .property-base-offer { display: block; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
  body[data-property-detail] .complex .property-base-cta, body[data-property-detail] .complex .property-base-cta .primary { display: flex; width: 100%; justify-content: center; }
  body[data-property-detail] .complex .property-sales-slot { margin-top: 0; }
  body[data-property-detail="base"] .property-contact-price { display: none; }
  body[data-property-detail="pro"] .complex.complex--pro .pro-hero { grid-template-columns: minmax(0, 1fr) minmax(290px, 1fr); }
  body[data-property-detail="pro"] .pro-hero-media { aspect-ratio: .7; }
  body[data-property-detail="pro"] .pro-hero-title { padding: 24px 24px 0; }
  body[data-property-detail="pro"] .pro-hero-title h1 { font-size: 34px; line-height: 40px; }
  body[data-property-detail="pro"] .pro-offer { padding: 24px; }
  body[data-property-detail="pro"] .pro-story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-property-detail="pro"] .pro-story-item:nth-child(3) { display: block; }
}

@media (max-width: 700px) {
  body[data-property-detail] main.wrap { padding: 16px 16px 32px; }
  body[data-property-detail] .detail-crumbs { display: none; }
  body[data-property-detail] .property-title-line h1 { font-size: 28px; line-height: 34px; }
  body[data-property-detail] .complex .property-kicker { font-size: 12px; gap: 8px; }
  body[data-property-detail] .complex .property-title-line { gap: 8px; }
  body[data-property-detail] .complex .property-address { font-size: 14px; line-height: 22px; }
  body[data-property-detail] .complex .property-photo-bottom { inset: auto 12px 12px; gap: 4px; }
  body[data-property-detail] .complex .property-photo-bottom a { font-size: 12px; padding: 8px; gap: 4px; }
  body[data-property-detail] .complex .property-photo-mark { top: 12px; left: 12px; max-width: calc(100% - 24px); font-size: 11px; line-height: 16px; }
  body[data-property-detail] .complex .property-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 0 20px; }
  body[data-property-detail] .complex .property-facts > .property-fact-deadline { grid-column: 1 / -1; grid-row: 1; }
  body[data-property-detail] .complex .property-facts dd { font-size: 14px; line-height: 22px; }
  body[data-property-detail] .complex .property-base-media, body[data-property-detail] .complex .property-mosaic { display: block; width: 100%; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; }
  body[data-property-detail] .complex .property-mosaic-side { display: none; }
  body[data-property-detail] .complex .property-base-offer > strong { font-size: 28px; line-height: 34px; }
  body[data-property-detail] .complex .detail-nav { margin: 20px 0; gap: 12px; }
  body[data-property-detail] .complex .detail-nav a { padding-inline: 0; }
  body[data-property-detail] .detail-content > section { padding: 20px 16px; margin-bottom: 16px; border-radius: 10px; }
  body[data-property-detail] .detail-content h2 { font-size: 22px; line-height: 28px; margin-bottom: 16px; }
  body[data-property-detail] .complex-highlights,
  body[data-property-detail="base"] .detail-content #characteristics .complex-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-property-detail] .complex-highlights > div { padding: 12px 0 12px 24px; min-height: 88px; }
  body[data-property-detail] .complex-highlights > div > .icon { left: 0; top: 15px; }
  body[data-property-detail] .complex-highlights dd { font-size: 14px; line-height: 20px; }
  body[data-property-detail] .room-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body[data-property-detail] .room-summary-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 4px 8px; padding: 12px; }
  body[data-property-detail] .room-summary-price { font-size: 18px; line-height: 24px; }
  body[data-property-detail] .room-summary-area { grid-column: 1; }
  body[data-property-detail] .room-summary-count { grid-column: 2; text-align: right; }
  body[data-property-detail] .room-summary-confirmed,
  body[data-property-detail] .room-summary-note { grid-column: 1 / -1; }
  body[data-property-detail] .detail-sidebar > section { padding: 20px; border-radius: 10px; }
  body[data-property-detail] .lot { flex-wrap: wrap; padding: 16px 0; }
  body[data-property-detail] .lot-price { text-align: left; }
  body[data-property-detail] .lot-main { flex-wrap: wrap; gap: 6px 12px; }
  body[data-property-detail] .map-single { height: 320px; }
  body[data-property-detail] .map-building-list { grid-template-columns: minmax(0, 1fr); }
  body[data-property-detail] .detail-mobile-actions { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  body[data-property-detail] .detail-mobile-actions > a,
  body[data-property-detail] .detail-mobile-actions > .favorite-toggle { min-height: 48px; }
  body[data-property-detail="pro"] main.wrap { padding-top: 0; }
  body[data-property-detail="pro"] .complex.complex--pro .pro-hero {
    width: calc(100% + 32px);
    margin: 0 -16px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    border-radius: 0 0 12px 12px;
  }
  body[data-property-detail="pro"] .pro-hero-media { grid-column: 1; grid-row: 1; width: 100%; aspect-ratio: 23 / 20; height: auto; min-height: 0; }
  body[data-property-detail="pro"] .pro-hero--no-photo .pro-hero-media { aspect-ratio: auto; padding: 12px 12px 0; }
  body[data-property-detail="pro"] .pro-hero-top { top: 12px; left: 12px; right: 12px; gap: 8px; }
  body[data-property-detail="pro"] .pro-hero-gallery { display: flex; }
  body[data-property-detail="pro"] .pro-hero-title { grid-column: 1; grid-row: 2; padding: 24px 20px 0; }
  body[data-property-detail="pro"] .pro-hero-title h1 { font-size: 34px; line-height: 38px; }
  body[data-property-detail="pro"] .pro-hero-kicker { font-size: 12px; line-height: 18px; }
  body[data-property-detail="pro"] .pro-hero-address { font-size: 14px; line-height: 22px; }
  body[data-property-detail="pro"] .pro-offer { grid-column: 1; grid-row: 3; display: block; padding: 20px; }
  body[data-property-detail="pro"] .pro-offer-price { font-size: 28px; line-height: 34px; }
  body[data-property-detail="pro"] .pro-offer-note { font-size: 13px; line-height: 20px; }
  body[data-property-detail="pro"] .pro-offer-checked { font-size: 12px; line-height: 18px; margin-top: 4px; }
  body[data-property-detail="pro"] .pro-offer-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 16px; gap: 8px; }
  body[data-property-detail="pro"] .pro-offer-actions > .pro-cta:only-child { grid-column: 1 / -1; }
  body[data-property-detail="pro"] .pro-cta { padding: 12px 8px; min-height: 48px; font-size: 14px; gap: 6px; }
  body[data-property-detail="pro"] .complex .property-facts { margin: 0 0 24px; padding: 20px 0; }
  body[data-property-detail="pro"] .pro-story-head { gap: 8px; margin-bottom: 16px; }
  body[data-property-detail="pro"] .pro-story-head h2 { font-size: 24px; line-height: 30px; }
  body[data-property-detail="pro"] .pro-story-grid { display: block; }
  body[data-property-detail="pro"] .pro-story-item,
  body[data-property-detail="pro"] .pro-story-item:nth-child(3) { display: none; padding: 0; }
  body[data-property-detail="pro"] .pro-story-item.is-current { display: block; }
  body[data-property-detail="pro"] .pro-story-link,
  body[data-property-detail="pro"] .pro-story-item:first-child .pro-story-link { aspect-ratio: 4 / 3; }
  body[data-property-detail="pro"] .pro-story-switch { display: flex; margin-top: 0; }
  body[data-property-detail="pro"] .pro-sticky { display: none; }
  body[data-property-detail="pro"] .detail-content > section { padding: 0 0 24px; margin-bottom: 24px; border-radius: 0; }
}

/* Постер-первый режим видео: картинка лежит поверх пустого <video> и уходит,
   когда ролик действительно пошёл. Кнопка воспроизведения остаётся кликабельной. */
body[data-property-detail] .hero-video-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
body[data-property-detail] .hero-video-poster[hidden] { display: none; }

/* Плашка «ИИ-визуализация» на боковых плитках мозаики: раньше она стояла только
   на главном кадре, и рендеры рядом читались как реальные фото. */
body[data-property-detail] .complex .property-mosaic-thumb .property-photo-mark {
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 16px;
}

/* Кнопка видео, пока ролик не загружен: вместо иконки-кружка — подписанная
   кнопка «Смотреть видеообзор», чтобы было понятно, что видео ещё не скачано
   и начнётся по нажатию (и на телефоне, и на десктопе с reduced motion). */
body[data-property-detail] .hero-video-toggle-label { display: none; }
body[data-property-detail] .hero-video-toggle[data-poster="on"] {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 40px;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 1;
}
body[data-property-detail] .hero-video-toggle[data-poster="on"] .hero-video-toggle-label {
  display: inline;
  font-size: 13px;
  line-height: 18px;
  font-weight: 550;
}

/* Телефон в карточке квартиры: на телефоне — набор в один тап, на десктопе —
   кнопка открывает общее модальное окно с контекстом лота. Контекст уходит в
   событие клика. */
body[data-property-detail] .complex .lot-call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
body[data-property-detail] .complex .lot-call-mobile,
body[data-property-detail] .complex .lot-call-reveal { display: none; }

@media (max-width: 700px) {
  body[data-property-detail] .complex .lot-call { justify-content: flex-start; }
  body[data-property-detail] .complex .lot-call-mobile {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 4px);
    background: var(--panel);
    color: var(--accent-hover);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
  }
  body[data-property-detail] .complex .lot-call-mobile .icon { width: 16px; height: 16px; }
}

@media (min-width: 701px) {
  body[data-property-detail] .complex .lot-call-reveal {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 4px);
    background: var(--panel);
    color: var(--accent-hover);
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    cursor: pointer;
  }
  body[data-property-detail] .complex .lot-call-reveal:hover { background: var(--accent-soft); }
}

body[data-property-detail] .complex .lot-plan-note { color: var(--muted); }

/* Пустая выдача квартир — тоже точка звонка: подбор по телефону. */
body[data-property-detail] .complex #lots-empty .section-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
body[data-property-detail] .complex #lots-empty .section-empty-call { gap: 8px; min-height: 44px; padding: 10px 16px; font-size: 14px; }
body[data-property-detail] .complex #lots-empty .section-empty-call .icon { width: 18px; height: 18px; }

/* Просмотрщик фото: на телефоне — прямой `tel:`, на десктопе кнопка открывает
   общее модальное окно телефона поверх просмотрщика. */
body[data-property-detail] .photo-viewer-phone { display: none; margin-left: 6px; font-variant-numeric: tabular-nums; }

@media (min-width: 701px) {
  body[data-property-detail] .photo-viewer-phone { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-property-detail] *, body[data-property-detail] *::before, body[data-property-detail] *::after {
    scroll-behavior: auto;
    transition: none;
  }
}
