/* Демидычъ — помещения. Белая бумага, золото, антиква (как заглушка). */
:root {
  --paper: #ffffff;
  --paper-2: #faf7f0;
  --ink: #1d1a15;
  --ink-2: #4b4640;
  --ink-3: #857e73;
  --gold: #b08d3f;
  --gold-2: #96762e;
  --gold-line: rgba(176, 141, 63, .35);
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --display: "Playfair Display", "PT Serif", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-2); }
img { display: block; max-width: 100%; height: auto; }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.2; }
h1 { font-size: clamp(26px, 3vw, 36px); margin: 4px 0 22px; text-wrap: balance; }
h2 { font-size: 22px; margin: 0 0 14px; }

/* Шапка */
.bar {
  position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--gold-line);
  display: flex; align-items: center; justify-content: space-between; padding: 12px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.links { display: flex; gap: 26px; align-items: baseline; }
.nav { color: var(--gold-2); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
.tel { color: var(--ink-2); font-size: 15px; letter-spacing: .04em; }

/* Раскладка: меню слева, карточка справа */
.wrap {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px;
  max-width: 1280px; margin: 0 auto; padding: 28px 28px 60px;
}

/* Меню */
.menu { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
.menu summary {
  list-style: none; cursor: default; pointer-events: none;
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  padding-bottom: 10px; border-bottom: 1px solid var(--gold-line);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary b { font-weight: 400; color: var(--ink-3); }
.menu h3 { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 20px 0 6px; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li a {
  display: block; padding: 9px 12px; margin: 2px 0; border-radius: 6px;
  border-left: 2px solid transparent;
}
.menu li a:hover { background: var(--paper-2); color: var(--ink); }
.menu li a.on { background: var(--paper-2); border-left-color: var(--gold); }
.menu li span { display: block; font-size: 15px; line-height: 1.3; }
.menu li small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.busy { font-style: normal; color: #a4552f; font-size: 12px; margin-left: 6px; }

/* Карточка */
.card { min-width: 0; }
.crumb { margin: 0; font-size: 13px; color: var(--ink-3); }
.crumb a { color: var(--gold-2); }
.lead { color: var(--ink-2); margin: -8px 0 26px; }
.busy-big { display: inline-block; color: #a4552f; border: 1px solid; border-radius: 4px; padding: 2px 10px; margin: -10px 0 18px; }

.gallery .main { display: block; border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.gallery .main img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button {
  flex: 0 0 96px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 6px;
  overflow: hidden; cursor: pointer; background: none; opacity: .7;
}
.thumbs button.on, .thumbs button:hover { border-color: var(--gold); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.facts {
  margin-top: 26px; padding: 24px 26px; border: 1px solid var(--gold-line); border-radius: 10px;
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
}
.price b { font-family: var(--display); font-weight: 500; font-size: 34px; color: var(--ink); }
.price span { margin-left: 8px; color: var(--ink-2); }
.price small { display: block; color: var(--ink-3); font-size: 14px; }
.facts dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; margin: 18px 0; font-size: 15px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.note { font-size: 14px; color: var(--ink-2); border-left: 2px solid var(--gold); padding-left: 12px; margin: 0 0 20px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 8px; background: var(--gold); color: #fff;
  font-size: 16px; letter-spacing: .02em;
}
.btn:hover { background: var(--gold-2); color: #fff; }
.btn.ghost { background: none; color: var(--gold-2); border: 1px solid var(--gold); }
.btn.ghost:hover { background: var(--paper-2); color: var(--gold-2); }

.text, .pano, .video { margin-top: 34px; }
.pano-box { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #eee; }
.pano-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.pano-tabs button {
  font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--gold-line); background: var(--paper);
}
.pano-tabs button.on { border-color: var(--gold); background: var(--paper-2); }
.hint { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; }
.vbox { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 16px; }
.vbox iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Каталог */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 24px; }
.tile { display: block; border: 1px solid var(--gold-line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.tile:hover { border-color: var(--gold); color: var(--ink); box-shadow: 0 6px 22px rgba(120,95,40,.12); }
.tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tile b, .tile small, .tile .p { display: block; padding: 0 16px; }
.tile b { font-weight: 400; font-size: 16px; line-height: 1.3; margin-top: 12px; }
.tile small { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.tile .p { font-family: var(--display); font-size: 20px; margin: 8px 0 14px; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 20px 28px; border-top: 1px solid var(--gold-line); font-size: 13px; color: var(--ink-3);
}
.foot b { font-weight: 400; color: var(--gold-2); }

/* Телефон: меню сворачивается в список сверху */
@media (max-width: 860px) {
  .bar { padding: 10px 16px; }
  .links .nav { display: none; }
  .wrap { grid-template-columns: 1fr; gap: 18px; padding: 16px 16px 40px; }
  .menu { position: static; max-height: none; }
  .menu details { border: 1px solid var(--gold-line); border-radius: 10px; padding: 12px 14px; }
  .menu summary { pointer-events: auto; cursor: pointer; border: 0; padding: 0; display: flex; justify-content: space-between; }
  .menu summary::after { content: "▾"; color: var(--gold); }
  .menu details[open] summary::after { content: "▴"; }
  .menu details[open] summary { margin-bottom: 4px; }
  .facts { padding: 18px; }
  .facts dl { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .btn { flex: 1 1 auto; text-align: center; }
}

/* Планировщик мебели */
.planner { margin-top: 34px; }
.plan-status { color: var(--ink-2); font-size: 15px; min-height: 24px; margin: 0 0 10px; }
.plan-stage { background: var(--paper-2); border: 1px solid var(--gold-line); border-radius: 14px; padding: 8px; }
.plan-svg { display: block; width: 100%; max-height: 72vh; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.plan-svg text { font-family: var(--serif); text-anchor: middle; pointer-events: none; }
.plan-floor { fill: #fff; }
.plan-grid { stroke: #eee6d4; stroke-width: 1; } .plan-grid.m { stroke: #e2d5b8; }
.plan-doorzone { fill: rgba(176,141,63,.07); }
.plan-wall { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linejoin: round; }
.plan-win { stroke: #7fb2d9; stroke-width: 8; }
.plan-gap { stroke: #fff; stroke-width: 8; }
.plan-leaf { stroke: var(--ink); stroke-width: 2; }
.plan-arc { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 6 5; }
.plan-stair { fill: #f1ece2; }
.plan-step { stroke: #c9bfae; stroke-width: 1.5; }
.plan-up { fill: none; stroke: var(--ink-3); stroke-width: 2; }
.plan-lbl { font-size: 13px; fill: var(--ink-3); }
.plan-dim { font-size: 14px; fill: var(--gold-2); }
.plan-room { font-size: 22px; fill: #d9cdb3; letter-spacing: .05em; }
.plan-item, .plan-btn { touch-action: none; }   /* на предмете палец всегда тащит его, а не страницу */
.plan-item { cursor: grab; }
.plan-item rect { fill: #f3ead6; stroke: var(--gold); stroke-width: 2; }
.plan-item.sel rect { fill: #efe2c4; stroke: var(--ink); stroke-width: 2.5; }
.plan-name { fill: var(--ink); }
.plan-btn { cursor: pointer; }
.plan-btn circle { fill: var(--ink); stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.plan-btn text { fill: #fff; font-family: Arial, sans-serif; }
.plan-search { width: 100%; margin: 18px 0 4px; font: inherit; font-size: 16px; padding: 10px 14px; border: 1px solid var(--gold-line);
  border-radius: 12px; background: #fff; color: var(--ink); outline: none; }
.plan-search:focus { border-color: var(--gold); }
.plan-empty { color: var(--ink-3); margin: 4px 0; }
.plan-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0 10px; padding-bottom: 2px; scrollbar-width: none; }
.plan-tabs button { flex: none; font: inherit; font-size: 14px; letter-spacing: .04em; background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 6px 8px; color: var(--ink-3); cursor: pointer; }
.plan-tabs button.on { color: var(--ink); border-bottom-color: var(--gold); }
.plan-pal { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-pal button { font: inherit; font-size: 15px; line-height: 1.25; background: #fff; color: var(--ink); border: 1px solid var(--gold-line);
  border-radius: 12px; padding: 8px 12px; cursor: pointer; text-align: left; }
.plan-pal button:hover { border-color: var(--gold); }
.plan-pal small { display: block; font-size: 12px; color: var(--ink-3); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.plan-actions .gold { font: inherit; font-size: 15px; letter-spacing: .03em; background: var(--gold); color: #fff; border: 0;
  border-radius: 999px; padding: 10px 20px; cursor: pointer; box-shadow: 0 2px 8px rgba(150,118,46,.25); }
.plan-actions .gold:hover { background: var(--gold-2); }
.planner .hint { margin-top: 10px; }

/* 3D-панорама с мебелью */
.pano-wrap { position: relative; }
#pano3d { touch-action: pan-y pinch-zoom; cursor: grab; overflow: hidden; }
#pano3d canvas { display: block; width: 100%; height: 100%; }
.pano-fs { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 12px; border: 0;
  background: rgba(255,255,255,.88); font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; color: var(--ink); }
/* на весь экран — без Fullscreen API, работает и на iPhone */
.pano-wrap.full { position: fixed; inset: 0; z-index: 1000; background: #000; }
.pano-wrap.full #pano3d { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; touch-action: none; }
.pano-wrap.full .pano-fs { top: max(12px, env(safe-area-inset-top)); right: 12px; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

/* телефон */
@media (max-width: 700px) {
  #pano3d { aspect-ratio: 4 / 5; max-height: 70vh; }
  .plan-pal { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .plan-pal button { flex: none; scroll-snap-align: start; }
  .plan-stage { padding: 4px; }
  .plan-actions .gold { flex: 1 1 auto; text-align: center; }
}

/* 3D-визуализации (15.10): плашка на большом фото и пояснение под галереей */
.gallery .main { position: relative; }
.viz-badge { display: none; position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 4px;
  background: rgba(255, 255, 255, .88); color: var(--ink); font-size: 13px; border: 1px solid var(--gold); }
.gallery .main.is-viz .viz-badge { display: none; }   /* пометка теперь на самой картинке (15.10) */
.viz-note { font-size: 14px; color: var(--ink-2); border-left: 2px solid var(--gold); padding-left: 12px; margin: 12px 0 0; }
