/* ===== Лист планировки на всю страницу =====
   Раньше планировка открывалась панелью справа поверх затемнённой страницы.
   Теперь это полноэкранный вид со своей шапкой и адресом (#plan=ID). */

.sheet { position: fixed; inset: 0; z-index: 40; display: block; background: var(--paper); overflow: hidden; }
.sheet__panel { position: relative; width: 100%; max-width: none; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); box-shadow: none; animation: sheetUp .26s var(--ease); -webkit-overflow-scrolling: touch; }
@keyframes sheetUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.sheet__bar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(14px, 3vw, 28px); background: rgba(247,246,243,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.sheet__back { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--card);
  font: 700 14px/1 var(--font-body); color: var(--ink); cursor: pointer; white-space: nowrap; }
.sheet__back:hover { border-color: var(--ink); }
.sheet__back i { font-style: normal; font-size: 16px; }
.sheet__crumb { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet__acts { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }

/* крестик больше не плавает над содержимым — он в шапке листа */
.sheet__close { position: static; float: none; margin: 0; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--card); font-size: 24px; line-height: 1; color: var(--ink-2); cursor: pointer; }
.sheet__close:hover { color: var(--ink); border-color: var(--ink); }

.sheet__body { max-width: 1340px; margin: 0 auto; padding: clamp(18px, 2.6vw, 34px) clamp(14px, 3vw, 28px) 96px; }

/* широкий экран: план стоит на месте, справа прокручиваются этажи и расчёт */
@media (min-width: 1000px) and (max-width: 1699px) {
  /* правая колонка не уходит под плавающие кнопки связи */
  .sheet__body { padding-right: 140px; }
}
@media (min-width: 1000px) {
  .sh-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 34px; }
  #sh-plan { position: sticky; top: 74px; }
  .sh-plan img { max-height: 58vh; }
}

/* ── отправить квартиру и PDF ── */
.deal__share { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.deal__share-t { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.deal__share-b { display: flex; flex-wrap: wrap; gap: 8px; }
.shr { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--card); font: 700 13.5px/1 var(--font-body); color: var(--ink); cursor: pointer; }
.shr:hover { border-color: var(--ink); }
.shr--wa { background: #25D366; border-color: #25D366; color: #08301a; }
.shr--tg { background: #229ED9; border-color: #229ED9; color: #fff; }

/* шапка листа, которая видна только в PDF */
.plan-print { display: none; }

/* ── лист планировки в PDF: печатается только он ── */
@media print {
  body.print-plan > *:not(.sheet) { display: none !important; }
  /* печать сравнения из extra.css не должна лезть в лист планировки */
  body.print-plan .cpop[hidden] { display: none !important; }
  .sheet { position: static; overflow: visible; background: #fff; }
  .sheet__panel { height: auto; overflow: visible; animation: none; }
  .sheet__bar, .dock, .deal__share, .deal__cta, .lightbox { display: none !important; }
  .sheet__body { max-width: none; padding: 0; }
  .plan-print { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #ccc; }
  .plan-print b { font: 800 18px/1 var(--font-display); letter-spacing: -.02em; }
  .plan-print span { font-size: 11px; color: #555; }
  .sh-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
  #sh-plan { position: static; }
  .sh-plan { border-color: #ccc; page-break-inside: avoid; }
  .sh-plan img { max-height: 420px; }
  .fl__grid, .deal { page-break-inside: avoid; }
  .dsch:not(.is-on) { display: none; }
  .deal__more { display: none; }
  a[href]:after { content: ""; }
}

/* телефон: шапка компактнее, план во всю ширину */
@media (max-width: 760px) {
  .sheet__crumb { display: none; }
  .sheet__bar { padding: 8px 12px; gap: 8px; }
  .sheet__back { padding: 0 12px 0 8px; font-size: 13.5px; }
  .sheet__body { padding: 16px 14px 92px; }
  .sh-plan { padding: 12px; }
  .sh-plan img { max-height: none; width: 100%; }
}

/* ── ПЕЧАТЬ ПОДБОРКИ ПЛАНИРОВОК ──
   Клиент просит «скинуть, что есть»: кнопка в блоке планировок печатает список
   так, как он сейчас отфильтрован, — это и есть PDF-подборка для WhatsApp и почты. */
@media print {
  body.print-plans > *:not(main) { display: none !important; }
  body.print-plans main > *:not(#plans) { display: none !important; }
  body.print-plans #plans { padding: 0 !important; }
  body.print-plans .pf,
  body.print-plans .sec-head__note,
  body.print-plans .dock,
  body.print-plans .mfold,
  body.print-plans #types-empty[hidden] { display: none !important; }
  body.print-plans .types { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  body.print-plans .type { break-inside: avoid; border: 1px solid #ddd !important; border-radius: 8px; padding: 8px !important; }
  body.print-plans .type.is-out { display: none !important; }
  body.print-plans .type__img { max-height: 190px; }
  body.print-plans .type__img img { max-height: 190px; object-fit: contain; }
  body.print-plans .plans-print { display: block !important; margin: 0 0 10px; }
  body.print-plans .plans-print b { display: block; font: 800 16px/1.2 var(--font-display); }
  body.print-plans .plans-print span { display: block; font-size: 11px; color: #444; }
}
.plans-print { display: none; }
