/* ============================================================
   CONSTRUCTOR — «Комплект своей мечты», десктоп.
   Две колонки: шаги слева, закреплённая панель итога справа.
   Ниже 760px страницу заменяет мобильный экран (constructor-m6.css).
   ============================================================ */
.cn-body { background: var(--cream); }
.cn { display: block; }
/* Сброс живёт на десктопной сетке, а не на всей `.cn`: мобильный экран —
   её сосед со своим сбросом, и `.cn button:not(.btn)` (специфичнее одного
   класса) съедал там у кнопок цвет и типографику. Исключение для `.btn` —
   чтобы сброс не трогал сайтовые кнопки. */
.cn-layout button:not(.btn) { font: inherit; color: inherit; }
.cn [hidden] { display: none !important; }

/* ---------- intro ---------- */
.cn-intro {
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(80px + 32px) 56px 8px;
}
.cn-intro .catalog-breadcrumbs { margin-bottom: 22px; }
.cn-intro h1 {
  font-family: 'Cormorant', serif; font-weight: 400; font-size: 56px;
  line-height: 1; letter-spacing: -0.01em; margin: 0 0 16px;
}
.cn-intro p { color: var(--muted); font-size: 15px; max-width: 60ch; margin: 0; line-height: 1.55; }
.cn-unavailable { color: var(--muted); font-size: 15px; }

/* ---------- layout ---------- */
.cn-layout {
  max-width: 1240px; margin: 0 auto; padding: 36px 56px 100px;
  display: grid; grid-template-columns: 1fr 412px; gap: 64px; align-items: start;
}

/* ---------- step ---------- */
.cn-step { padding: 36px 0; border-top: 1px solid var(--line); }
/* Колонка должна заканчиваться на последней карточке: по её низу
   останавливается закреплённая панель справа. */
.cn-steps > .cn-step:last-child { padding-bottom: 0; }
.cn-step-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 22px; }
.cn-step-num {
  font-family: 'English111VivaceBT', cursive; font-size: 40px; color: var(--accent);
  line-height: 0.8; flex-shrink: 0; min-width: 34px;
}
.cn-step-head .txt { flex: 1; }
.cn-step-title { font-family: 'Cormorant', serif; font-weight: 500; font-size: 30px; line-height: 1; margin: 0; }
.cn-step-hint { font-size: 13px; color: var(--muted); margin: 5px 0 0; line-height: 1.5; }

.cn-sub-label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 12px;
}
.cn-sub-label--gap { margin-top: 24px; }

/* ---------- base card (fabric + shade) ---------- */
.cn-base {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px 26px;
}
.cn-fabric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cn-fabric {
  border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 13px 16px;
  background: var(--paper); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cn-fabric:hover { border-color: var(--muted-2); }
.cn-fabric[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cn-fabric .fn { font-weight: 600; font-size: 13.5px; }
.cn-fabric .fd { font-size: 11px; color: var(--muted); }

.cn-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.cn-sw {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  cursor: pointer; padding: 0;
}
.cn-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }

/* ---------- option list ---------- */
.cn-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cn-opts.cols-1 { grid-template-columns: 1fr; }
.cn-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 15px 18px; background: var(--paper); cursor: pointer; text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cn-opt:hover { border-color: var(--muted-2); }
.cn-opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cn-opt-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.cn-opt-name { font-family: 'Cormorant', serif; font-size: 21px; line-height: 1.05; white-space: nowrap; }
.cn-opt-dim { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.cn-opt-dim:empty { display: none; }
.cn-opt-check {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; flex-shrink: 0; color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.cn-opt-check svg { width: 12px; height: 12px; opacity: 0; transition: opacity 0.15s; }
.cn-opt[aria-pressed="true"] .cn-opt-check { background: var(--ink); border-color: var(--ink); }
.cn-opt[aria-pressed="true"] .cn-opt-check svg { opacity: 1; }

.cn-opt--custom { border-style: dashed; }
.cn-opt--custom[aria-pressed="true"] { border-style: solid; }
.cn-opt--custom .cn-opt-name { display: inline-flex; align-items: center; gap: 8px; }
.cn-opt--custom .cn-opt-name svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.cn-opt--custom.is-none { opacity: 0.55; }

/* ---------- type cards ---------- */
.cn-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cn-cards--2 { grid-template-columns: repeat(2, 1fr); }
.cn-card {
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 16px 16px 15px; background: var(--paper); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 7px; position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cn-card:hover { border-color: var(--muted-2); }
.cn-card[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cn-card .swatch-ico {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; margin-bottom: 3px;
}
.cn-card .swatch-ico svg { width: 18px; height: 18px; }
.cn-card-name { font-family: 'Cormorant', serif; font-size: 19px; line-height: 1; padding-right: 24px; }
.cn-card-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }
.cn-card-price { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: auto; padding-top: 4px; }
.cn-card-price.free { color: var(--ok); }
.cn-card .pick {
  position: absolute; top: 14px; right: 14px;
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; color: #fff;
}
.cn-card .pick svg { width: 11px; height: 11px; opacity: 0; }
.cn-card[aria-pressed="true"] .pick { background: var(--ink); border-color: var(--ink); }
.cn-card[aria-pressed="true"] .pick svg { opacity: 1; }

/* ---------- custom dimensions panel ---------- */
.cn-custom {
  display: none; margin-top: 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--paper); padding: 18px 20px 16px;
}
.cn-custom.on { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 20px; }
.dim-field { display: flex; flex-direction: column; gap: 7px; }
.dim-field > label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.dim-ctrl {
  display: flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); padding: 2px;
}
.dim-ctrl button {
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; font-size: 16px;
  color: var(--ink-2); display: grid; place-items: center; line-height: 1;
}
.dim-ctrl button:hover { background: var(--cream); }
.dim-ctrl input, .dim-ctrl select {
  width: 62px; border: 0; background: transparent; outline: none;
  text-align: center; color: var(--ink);
  font-family: 'Cormorant', serif; font-size: 22px; line-height: 1;
  font-variant-numeric: tabular-nums;
  appearance: textfield; -moz-appearance: textfield;
}
.dim-ctrl--select { padding: 2px 2px 2px 10px; }
.dim-ctrl select { appearance: auto; cursor: pointer; }
.dim-ctrl input::-webkit-outer-spin-button,
.dim-ctrl input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.dim-ctrl .unit { font-size: 11px; color: var(--muted); padding: 0 11px 0 4px; }
.dim-range { font-size: 10px; color: var(--muted-2); letter-spacing: 0.03em; }
.dim-x {
  font-family: 'Cormorant', serif; font-size: 24px; color: var(--muted-2);
  align-self: flex-start; padding-top: 26px;
}
.dim-out { margin-left: auto; text-align: right; padding-top: 2px; }
.dim-out .do-hint { font-size: 10px; color: var(--muted); margin-top: 5px; }
.cn-custom .dim-note {
  flex-basis: 100%; display: flex; align-items: flex-start; gap: 8px;
  font-size: 11px; color: var(--muted); line-height: 1.5;
  border-top: 1px dashed var(--line-2); padding-top: 12px; margin-top: 2px;
}
.cn-custom .dim-note svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }

/* ---------- pillow quantity rows ---------- */
.cn-qty-rows { display: flex; flex-direction: column; gap: 10px; }
.cn-qty-row {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--paper); padding: 12px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cn-qty-row.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cn-qty-row .q-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.cn-qty-row .q-name { font-family: 'Cormorant', serif; font-size: 21px; line-height: 1.05; white-space: nowrap; }
.cn-qty-row .q-hint { font-size: 12px; color: var(--muted); }
.cn-qty-row--custom { border-style: dashed; }
.cn-qty-row--custom.active { border-style: solid; }
.q-dims { display: flex; align-items: baseline; gap: 7px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.q-dims input {
  width: 42px; border: 0; border-bottom: 1px solid var(--line-2);
  background: transparent; outline: none; text-align: center;
  font-family: 'Cormorant', serif; font-size: 18px; color: var(--ink);
  font-variant-numeric: tabular-nums; padding: 0 0 2px;
  appearance: textfield; -moz-appearance: textfield;
}
.q-dims input::-webkit-outer-spin-button,
.q-dims input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.q-dims input:focus { border-color: var(--ink); }
.cn-stepper {
  display: flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper);
  padding: 2px; flex-shrink: 0;
}
.cn-stepper button {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; font-size: 17px;
  color: var(--ink-2); display: grid; place-items: center; line-height: 1;
}
.cn-stepper button:hover:not(:disabled) { background: var(--cream); }
.cn-stepper button:disabled { opacity: 0.25; cursor: default; }
.cn-stepper .q-val { width: 32px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cn-qty-note { font-size: 12px; color: var(--muted); margin: 10px 2px 0; }

/* ---------- summary ---------- */
/* Панель закреплена и едет за прокруткой, чтобы итог и кнопка были на виду.
   Останавливается сама: sticky не выходит за пределы .cn-layout, а тот
   заканчивается до подвала. Панель выше экрана — прокручивается внутри себя,
   иначе кнопка «В корзину» оказалась бы недосягаемой. */
.cn-summary {
  position: sticky; top: 96px; align-self: start;
  max-height: calc(100vh - 120px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden auto;
  scrollbar-width: thin;
}
.cn-sum-preview { position: relative; aspect-ratio: 4 / 4.25; background: var(--cream-2); overflow: hidden; }
/* Схема рисуется движком мобильной версии — растягиваем её на всё превью */
.cn-sum-preview .m6-map { position: absolute; inset: 0; }
.cn-sum-preview .tag {
  position: absolute; left: 12px; top: 10px; z-index: 5;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(4px);
  padding: 6px 13px; border-radius: 999px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink);
}
.cn-sum-preview .tag .dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); }
.cn-sum-preview .tag b { font-weight: 600; }

/* слой фото ткани + переключатель «Кровать / Ткань» */
.cn-scene-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.35s; z-index: 4; pointer-events: none;
}
.cn-sum-preview.photo .cn-scene-photo { opacity: 1; }
.view-toggle {
  position: absolute; top: 10px; right: 12px; z-index: 6;
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(4px);
  border: 1px solid var(--line);
}
.view-toggle button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted); padding: 5px 12px; border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.cn-sum-body { padding: 24px 26px 26px; }
.cn-sum-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cn-sum-body h2 { font-family: 'Cormorant', serif; font-weight: 400; font-size: 26px; margin: 0 0 2px; line-height: 1; }
.cn-sum-body .lead { font-size: 12px; color: var(--muted); margin: 0 0 18px; letter-spacing: 0.02em; }
.cn-share {
  border: 1px solid var(--line-2); background: var(--paper); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%; color: var(--muted);
  display: grid; place-items: center; flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.cn-share:hover { color: var(--ink); border-color: var(--muted-2); }
.cn-share svg { width: 14px; height: 14px; }

.cn-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.cn-line:first-of-type { border-top: none; }
.cn-line.hidden { display: none; }
.cn-line .l-name { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
/* Справа — количество позиции, у доп. опции цена */
.cn-line .l-price { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; align-self: end; }

/* Цвет отделки — прячется у моделей без отделки */
.cn-trim[hidden] { display: none; }

/* Тумблер доп. опции в составе комплекта */
.cn-tgl {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper); cursor: pointer; text-align: left;
}
.cn-tgl:hover { border-color: var(--muted-2); }
.cn-tgl .bx {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--line-2); position: relative; transition: 0.16s;
}
.cn-tgl .bx::after {
  content: ''; position: absolute; left: 5px; top: 2px; width: 6px; height: 11px;
  border: solid var(--cream); border-width: 0 1.8px 1.8px 0;
  transform: rotate(42deg) scale(0.6); opacity: 0; transition: 0.16s;
}
.cn-tgl b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.cn-tgl i { flex: none; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cn-tgl[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cn-tgl[aria-pressed="true"] .bx { background: var(--ink); border-color: var(--ink); }
.cn-tgl[aria-pressed="true"] .bx::after { opacity: 1; transform: rotate(42deg) scale(1); }
.cn-tgl[aria-pressed="true"] i { color: var(--ink); }

.cn-comment { margin-top: 18px; }
.cn-comment textarea {
  width: 100%; resize: vertical; min-height: 76px; padding: 11px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--paper);
  font: inherit; font-size: 13px; color: var(--ink); line-height: 1.45;
}
.cn-comment textarea:focus { outline: none; border-color: var(--ink); }
.cn-comment textarea::placeholder { color: var(--muted-2); }
.cn-line .l-val { font-size: 14px; color: var(--ink-2); grid-column: 1 / -1; line-height: 1.4; }
.cn-line .l-val b { font-family: 'Cormorant', serif; font-size: 17px; font-weight: 500; }
.tag-custom {
  display: inline-block; vertical-align: 1px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 8px; margin-left: 6px;
}
.tag-custom.hidden { display: none; }

.cn-hint {
  display: none; align-items: flex-start; gap: 9px;
  font-size: 12px; color: var(--ink-2); line-height: 1.45;
  background: var(--accent-soft); border-radius: var(--r-md);
  padding: 11px 13px; margin-top: 14px;
}
.cn-hint.show { display: flex; }
.cn-hint svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.cn-hint button {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px;
}

.cn-total {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--ink); margin-top: 14px; padding-top: 18px;
}
.cn-total .t-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cn-total .t-hint { font-size: 10px; color: var(--muted-2); margin-top: 4px; }
.cn-total .t-value {
  font-family: 'Cormorant', serif; font-weight: 500; font-size: 38px; line-height: 0.9;
  font-variant-numeric: tabular-nums; transition: color 0.25s; white-space: nowrap;
}
.cn-total .t-value.flash { color: var(--accent); }

.cn-cta { width: 100%; margin-top: 20px; padding: 15px 28px; }
.cn-cta.added { background: var(--ok); border-color: var(--ok); }

/* fly-to-cart dot */
.cn-fly-dot {
  position: fixed; z-index: 1200; width: 14px; height: 14px; border-radius: 50%;
  pointer-events: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.7s cubic-bezier(0.45, 0, 0.6, 1), opacity 0.7s;
}

/* ============================================================
   RESPONSIVE
   Ниже 760px страницу заменяет мобильный экран (constructor-m6.css),
   поэтому здесь только десктоп и планшет.
   ============================================================ */
@media (max-width: 1080px) {
  .cn-intro { padding: calc(80px + 24px) 32px 8px; }
  .cn-layout { grid-template-columns: 1fr; gap: 32px; padding: 28px 32px 80px; }
  .cn-intro h1 { font-size: 44px; }
  /* Одна колонка — закреплять нечего, панель идёт под шагами */
  .cn-summary { position: static; max-height: none; overflow: hidden; }
  .cn-sum-preview { aspect-ratio: 16 / 9; }
}

/* Шапка страницы (крошки, заголовок, интро) остаётся и на мобильном — там её
   показывает мобильный экран, десктопную сетку он заменяет собой. */
@media (max-width: 760px) {
  .cn-intro { padding: calc(70px + 14px) 16px 2px; }
  .cn-intro h1 { font-size: 30px; line-height: 1.03; }
  .cn-intro p { font-size: 13px; }
  .cn-intro .catalog-breadcrumbs { margin-bottom: 14px; }
}
