/* ==================================================================
   СТРАНИЦА АПАРТАМЕНТА — компоновка от проджект-менеджера
   Базовые стили (бейдж, таблица характеристик, комплектации, карточки)
   берутся из site.css; здесь — раскладка и новые элементы.
   ================================================================== */
.lot-v2{--layout-section-size:clamp(23px,3vw,34px);--layout-card-title:20px;--layout-body-size:14px;--layout-caption-size:13px;
  --layout-label-size:14.5px;--layout-value-size:15px;--layout-choice-size:13.5px;--layout-button-size:15px;padding-bottom:120px}
.lot-v2 .lot-head{padding:4px 0 18px;margin-bottom:20px}
.lot-v2 .lot-head h1{font-size:clamp(28px,4.4vw,46px)}
.lot-v2 .lot-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(340px,1fr);align-items:start;gap:24px}
.lot-v2 .lot-grid>*{min-width:0}
.layout-media{display:grid;gap:16px}
.layout-purchase{position:sticky;top:16px;display:grid;gap:16px}
.layout-purchase .lot-price,.layout-purchase .packs{margin-bottom:0}

/* Планировка */
.layout-viewer{margin-bottom:0;background:var(--white);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.layout-viewer .lot-gallery{border:0;border-radius:0}
.layout-viewer .lot-gallery.empty{aspect-ratio:2/1;min-height:220px}
.lv-plan{position:relative;display:flex;justify-content:center;align-items:center;padding:22px 22px 10px;background:#F2ECE4}
.lv-plan img{display:block;width:auto;height:auto;max-width:100%;max-height:min(620px,70vh);cursor:zoom-in}
.lv-zoom{position:absolute;right:12px;bottom:10px;font-size:12px;color:var(--muted);background:rgba(255,255,255,.86);padding:4px 10px;border-radius:999px;pointer-events:none}
.lv-rooms{list-style:none;display:flex;flex-wrap:wrap;gap:6px 22px;padding:12px 20px 14px;border-top:1px solid var(--line);font-size:var(--layout-body-size)}
.lv-rooms li{display:flex;gap:8px}
.lv-rooms span{color:var(--muted)}
.lv-rooms b{font-family:var(--f-mono);font-weight:500;color:var(--ink)}

/* Характеристики */
.layout-specs{margin:24px 0 0;padding:18px 24px}
.layout-specs h2{margin:0 0 14px;font-size:var(--layout-card-title);line-height:1.3}
.layout-specs .lot-specs{margin:0}
.layout-specs tbody{display:grid;grid-template-columns:repeat(3,1fr);gap:0 36px}
.layout-specs tr{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;border-top:0;padding:0}
.layout-specs .lot-specs tr:first-child{border-top:0}
.layout-specs tr:nth-last-child(-n+3){border-bottom:0}
.layout-specs th{width:auto;font-size:var(--layout-label-size);padding:10px 0;line-height:1.45}
.layout-specs td{font-size:var(--layout-value-size);padding:10px 0;text-align:right;line-height:1.45;overflow-wrap:anywhere}

/* Этажность и PDF */
.layout-extras{display:grid;grid-template-columns:1fr 1.15fr;gap:16px;align-items:stretch}
/* Этажность и PDF — в правой колонке под комплектациями */
.layout-purchase .layout-extras{margin-top:0}
.layout-extras .floor-chart{padding:16px;gap:14px;margin-bottom:0}
.layout-extras .fc-stack{width:44px;gap:3px}
.layout-extras .fc-floor{height:6px}
.layout-extras .fc-title{font-size:var(--layout-value-size)}
.layout-extras .fc-note{font-size:var(--layout-caption-size)}
.layout-extras .lot-pdf{padding:16px;margin:0;gap:12px}
.layout-extras .lot-pdf b{font-size:var(--layout-value-size)}
.layout-extras .lot-pdf small{font-size:var(--layout-caption-size)}

/* Цена и комплектации */
.layout-purchase .lot-price{padding:18px 20px}
.layout-purchase .lot-price strong{font-size:clamp(26px,3.4vw,34px);white-space:nowrap}
.layout-purchase .packs{padding:16px 20px}
.layout-purchase .packs-tabs{margin-bottom:12px}
.layout-purchase .pk-tab{min-height:64px;padding:10px 12px}
.layout-purchase .pk-tab b{font-size:var(--layout-choice-size)}
.layout-purchase .pk-tab small{font-size:var(--layout-caption-size)}
.layout-purchase .pk-note{font-size:var(--layout-body-size);line-height:1.6;margin-bottom:10px}
.layout-purchase .pk-items li{font-size:var(--layout-choice-size)}
.lot-v2 .packs-title,.layout-purchase .pk-draft,.lot-v2 .legend,.lot-v2 .consent{font-size:var(--layout-caption-size)}
.lot-v2 .lot-form .form-lead,.lot-v2 .form-msg,.lot-v2 .lot-price span{font-size:var(--layout-body-size)}
.lot-v2 .btn{font-size:var(--layout-button-size)}
.layout-purchase > .btn{min-height:52px}
.layout-package-details{border-top:1px solid var(--line);padding-top:4px}
.layout-package-details summary{cursor:pointer;color:var(--pine);font-family:var(--f-body);font-size:var(--layout-body-size);font-weight:500;padding:10px 0;min-height:44px}
.layout-package-details .pk-items{margin-top:10px}
.layout-purchase .pk-draft{margin-top:8px;padding-top:10px}

/* На этаже, похожие */
.layout-floor-bottom{width:100%;margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.layout-floor-bottom .sec-head{margin-bottom:14px}
.layout-floor-bottom h2,.lot-v2 .similar h2{font-size:var(--layout-section-size)}
.layout-floor-bottom .sec-head p,.lot-v2 .similar .sec-head p{font-size:16.5px;line-height:1.6;max-width:760px}
.lot-v2 .fp-strip{flex-wrap:wrap}
.lot-v2 .similar{margin-top:28px;padding-top:24px}
.lot-v2 .similar .sec-head{margin-bottom:16px}
.lot-v2 .similar .lot-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.lot-v2 .similar .lot-card{padding:16px}
.lot-v2 .btn:hover,.lot-v2 .btn:active,.lot-v2 .pk-tab:hover,.lot-v2 .pk-tab:active,.lot-v2 .lot-card:hover,.lot-v2 .lot-pdf:hover,.lot-v2 a.fp-unit:hover{transform:none}

/* Нижняя панель бронирования: прилипает к низу экрана и останавливается у подвала */
.layout-booking-bar{position:fixed;left:0;right:0;bottom:0;z-index:80;background:var(--white);border-top:1px solid var(--line);
  box-shadow:0 -10px 32px -20px rgba(16,28,23,.35);padding-bottom:env(safe-area-inset-bottom);
  transform:translateY(var(--booking-offset,0px));will-change:transform}
.layout-booking-inner{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-top:10px;padding-bottom:10px}
.layout-booking-info{display:flex;align-items:center;gap:28px;min-width:0}
.layout-booking-lot{font-family:var(--f-body);color:var(--muted);font-size:14px}
#layout-bar-price{font-family:var(--f-mono);font-size:24px;font-weight:500;white-space:nowrap;color:var(--ink)}
#layout-bar-book{min-width:280px;min-height:52px}
/* Плавающая кнопка связи поднимается над панелью */
body.page-lot .fab{bottom:calc(96px + env(safe-area-inset-bottom))}

/* Окно бронирования */
#layout-dialog{position:fixed;inset:0;padding:0;border:0;border-radius:var(--r);width:min(460px,calc(100% - 32px));height:fit-content;
  max-height:calc(100dvh - 32px);overflow:auto;margin:auto;background:var(--white);color:var(--text)}
#layout-dialog::backdrop{background:rgba(10,31,24,.65)}
#layout-close{position:absolute;right:12px;top:12px;font-size:28px;line-height:1;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;display:flex;align-items:center;justify-content:center;z-index:1}
#layout-dialog .lot-form{padding-top:56px;border:0;box-shadow:none}
.lot-v2 .lot-form h2{font-size:var(--layout-card-title);line-height:1.3}
.layout-field-label{display:block;font-size:var(--layout-body-size);margin:0 0 6px;color:var(--text)}
.layout-field-error{font-size:var(--layout-caption-size);line-height:1.4;color:#B3453A;margin:-6px 0 14px}
.lot-v2 .lot-form input[aria-invalid="true"]{border-color:#B3453A}
.layout-phone-group{display:flex;align-items:stretch;margin-bottom:14px}
.layout-phone-prefix{display:flex;align-items:center;justify-content:center;padding:0 14px;background:var(--paper-2);color:var(--ink);
  border:1.5px solid var(--line-hi);border-right:0;border-radius:var(--r-sm) 0 0 var(--r-sm);font-family:var(--f-body);font-size:16px;flex-shrink:0}
.layout-phone-group input{margin:0;border-top-left-radius:0;border-bottom-left-radius:0;min-width:0;flex:1;width:0}
.lot-v2 [hidden]{display:none!important}
.lot-v2 .lot-form .form-msg:empty{display:none}

@media(max-width:1000px){
  .lot-v2 .lot-grid{gap:20px}
  .layout-specs tbody{grid-template-columns:1fr 1fr;gap:0 20px}
  .layout-specs tr:nth-last-child(-n+3){border-bottom:1px solid var(--line)}
  .layout-specs tr:nth-last-child(-n+2){border-bottom:0}
  .layout-purchase .pk-tab{padding:10px}
  .layout-extras{grid-template-columns:1fr}
  .layout-extras .lot-pdf{min-height:80px}
}
@media(max-width:800px){
  .lot-v2 .lot-grid{grid-template-columns:1fr;gap:16px}
  .layout-purchase{position:static}
  .layout-extras{grid-template-columns:1fr 1fr}
  .layout-specs{margin-top:16px}
  .lv-plan img{max-height:62vh}
}
@media(max-width:540px){
  .layout-specs tbody{grid-template-columns:1fr}
  .layout-specs tr:nth-last-child(2){border-bottom:1px solid var(--line)}
  .layout-specs{padding:16px 18px}
  .layout-extras{grid-template-columns:1fr}
  .layout-purchase .pk-tab{min-height:48px}
  .layout-viewer .lot-gallery.empty{aspect-ratio:3/2;min-height:200px}
  .lv-plan{padding:14px 10px 8px}
  .lv-zoom{display:none}
}
@media(max-height:800px){.layout-purchase{position:static}}
@media(max-width:740px){
  .layout-booking-inner{gap:12px;padding:12px 16px}
  .layout-booking-info{display:block;flex:0 1 auto}
  .layout-booking-lot{display:block;font-size:var(--layout-caption-size);margin-bottom:3px}
  #layout-bar-price{font-size:20px}
  #layout-bar-book{flex:1;min-width:0;max-width:250px;min-height:50px;white-space:normal;line-height:1.3;padding:10px 14px}
  body.page-lot .fab{bottom:calc(88px + env(safe-area-inset-bottom))}
}
.layout-specs .lot-desc{margin:14px 0 0;padding-top:12px;border-top:1px solid var(--line);font-size:var(--layout-body-size);max-width:none}

/* ------------------------------------------------------------------
   Компоновка по макету «А-101» (октябрь 2026): обе колонки одной высоты.
   Слева планировка растягивается на всю высоту, справа карточка комплектации
   заполняет свободное место (пункты состава распределяются по высоте),
   блок «корпус + PDF» — внизу, вровень с нижней гранью планировки.
   ------------------------------------------------------------------ */
.layout-purchase .layout-extras{margin-top:0;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:16px;min-width:0}
.layout-purchase .layout-extras>*{min-width:0;max-width:100%;box-sizing:border-box}
.layout-purchase .lot-pdf>span:last-child,.layout-purchase .fc-body{min-width:0;overflow-wrap:anywhere}
.layout-purchase .floor-chart{align-items:center}
.layout-purchase .fc-stack{align-self:center;justify-content:center}
@media(min-width:801px){
  .lot-v2 .lot-grid{align-items:stretch}
  .layout-media{display:flex;align-items:stretch;align-self:stretch}
  .layout-media .layout-viewer{flex:1;width:100%;display:flex;flex-direction:column}
  .layout-viewer .lv-plan{flex:1;min-height:0}
  .layout-viewer .lv-plan img{max-height:min(620px,70vh);max-width:100%;object-fit:contain}
  .layout-viewer .lv-rooms{flex-shrink:0}
  .lot-v2 .layout-purchase{position:static;align-self:stretch;display:flex;flex-direction:column;gap:16px}
  .layout-purchase>.lot-price,.layout-purchase>.btn{flex-shrink:0}
  .layout-purchase>.packs{flex:1;margin-bottom:0;display:flex;flex-direction:column}
  .layout-purchase .packs-title,.layout-purchase .packs-tabs{flex-shrink:0}
  .layout-purchase .pk-body{flex:1;display:flex;flex-direction:column}
  .layout-purchase .pk-body[hidden]{display:none}
  .layout-purchase .pk-note{flex-shrink:0}
  .layout-purchase .pk-items{flex:1;display:flex;flex-direction:column;justify-content:space-evenly}
  .layout-purchase>.layout-extras{margin-top:0;flex-shrink:0}
}
@media(min-width:801px) and (max-width:1000px){.layout-purchase .layout-extras{grid-template-columns:minmax(0,1fr)}}
@media(max-width:540px){.layout-purchase .layout-extras{grid-template-columns:1fr}}

/* ------------------------------------------------------------------
   Без «прыжков» при переключении комплектации: описания всех вариантов
   лежат в одной ячейке сетки, карточка всегда высотой с самый длинный,
   скрытые варианты только невидимы. Строка «₽/м²» тоже держит место.
   ------------------------------------------------------------------ */
.lot-v2 .layout-purchase > .packs{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto 1fr auto;align-content:start}
.lot-v2 .layout-purchase .packs-title{grid-row:1}
.lot-v2 .layout-purchase .packs-tabs{grid-row:2}
.lot-v2 .layout-purchase .pk-body{grid-row:3;grid-column:1;display:flex;flex-direction:column}
.lot-v2 .layout-purchase .pk-body[hidden]{display:flex!important;visibility:hidden;pointer-events:none}
.lot-v2 .layout-purchase .pk-draft{grid-row:4}
.lot-v2 .lot-price strong{display:block;line-height:1.15}

/* Планировка / Фото из фида */
.lv-tabs{display:flex;gap:4px;padding:8px 8px 0;border-bottom:1px solid var(--line);background:var(--white)}
.lv-tab{appearance:none;border:0;background:none;font:inherit;font-size:var(--layout-body-size);color:var(--muted);padding:9px 14px 10px;border-bottom:2px solid transparent;margin-bottom:-1px;cursor:pointer}
.lv-tab span{font-family:var(--f-mono);font-size:.85em;margin-left:4px;opacity:.8}
.lv-tab[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--pine);font-weight:600}
.lv-tab:focus-visible{outline:2px solid var(--pine);outline-offset:-2px;border-radius:6px}
.lv-pane{display:flex;flex-direction:column}
.lv-pane[hidden]{display:none!important}
.lv-photos{background:#F2ECE4}
.lv-ph-main{position:relative;aspect-ratio:4/3;background:#E7E0D6;overflow:hidden}
.lv-ph-main img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;cursor:zoom-in}
.lv-ph-nav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:50%;border:0;background:rgba(255,255,255,.9);display:grid;place-items:center;cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.12)}
.lv-ph-nav svg{width:20px;height:20px;fill:none;stroke:var(--ink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lv-ph-nav.prev{left:12px}.lv-ph-nav.next{right:12px}
.lv-ph-nav:hover{background:#fff}
.lv-ph-count{position:absolute;right:12px;bottom:10px;font-family:var(--f-mono);font-size:12px;color:#fff;background:rgba(0,0,0,.5);padding:3px 9px;border-radius:999px;pointer-events:none}
.lv-ph-thumbs{display:flex;gap:8px;padding:10px 12px;overflow-x:auto;scrollbar-width:thin;background:var(--white);border-top:1px solid var(--line)}
.lv-ph-th{flex:0 0 auto;width:84px;aspect-ratio:4/3;padding:0;border:2px solid transparent;border-radius:var(--r-sm);overflow:hidden;background:#E7E0D6;cursor:pointer;opacity:.75}
.lv-ph-th img{display:block;width:100%;height:100%;object-fit:cover}
.lv-ph-th[aria-current="true"]{border-color:var(--pine);opacity:1}
.lv-ph-th:hover{opacity:1}
@media(min-width:801px){
  .layout-viewer .lv-pane{flex:1;min-height:0}
  .layout-viewer .lv-photos .lv-ph-main{flex:1;aspect-ratio:auto;min-height:360px}
}
@media(max-width:800px){
  .lv-ph-nav{width:38px;height:38px}
  .lv-ph-th{width:68px}
}

/* Нет схемы этажей — кнопка презентации на всю ширину */
.layout-purchase .layout-extras.is-single{grid-template-columns:minmax(0,1fr)}
.lot-promo{display:flex;flex-direction:column;gap:2px;margin:0 0 12px;padding:10px 14px;border-radius:12px;background:#FCE9E1;color:#B5370F;font-size:14px}.lot-promo b{font-weight:600}

/* Рассрочка и мессенджеры в блоке цены */
.lot-inst{display:flex;flex-direction:column;gap:3px;margin:-4px 0 14px;padding:12px 16px;border-radius:14px;background:var(--sage-soft,#e7efe9);color:var(--ink,#101C17);font-size:14px;line-height:1.4}
.lot-inst b{font-weight:600;color:var(--pine,#064E3B)}
.lot-inst i{font-style:normal;font-weight:600;white-space:nowrap}
.lot-msg{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.lot-msg-btn{flex:1 1 calc(50% - 4px);display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 12px;border:1.5px solid var(--line-hi,#cfd4cc);border-radius:12px;color:var(--ink,#101C17);font-size:14px;font-weight:600;text-align:center;text-decoration:none;line-height:1.2}
.lot-msg-btn:hover{border-color:var(--pine,#064E3B);color:var(--pine,#064E3B)}
.lot-msg-btn.is-show{background:var(--paper-2,#f3efe8)}
/* «Забронировать» и «Записаться на показ» — две широкие кнопки-кубика в ряд */
.lot-top-acts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.lot-top-acts .lot-top-btn{min-height:64px;padding:10px 14px;white-space:normal;line-height:1.25;border-radius:12px;font-size:15px}
.lot-top-acts .lot-top-btn:only-child{grid-column:1 / -1}
@media(max-width:380px){#layout-bar-price{font-size:16px}#layout-bar-book{font-size:12px;padding:8px 4px;max-width:150px}}

/* v75: корпус А — ремонт уже в цене */
.pk-plus{margin:6px 0 12px;padding:10px 14px;border-radius:var(--r);background:var(--sage-soft,#E6F0E8);color:var(--ink);font-size:14px;line-height:1.5}
.pk-plus b{color:var(--pine)}

/* v75: «Как оплатить» — примеры в цифрах */
.lot-pay-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.lot-pay-item{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border-radius:14px;background:var(--sage-soft,#E6F0E8);font-size:14.5px;line-height:1.45;color:var(--ink)}
.lot-pay-item b{color:var(--pine);font-weight:600}
.lot-pay-item small,.lot-pay-alt{font-size:12.5px;color:var(--muted)}
.lot-pay-alt i{font-style:normal}
@media(max-width:820px){.lot-pay-grid{grid-template-columns:1fr}}

/* подпись к визуализациям отделки */
.lv-ph-note{margin:8px 14px 10px;font-size:12.5px;color:var(--muted,#6b6b6b);line-height:1.4}
