/* Карлсон, страница «Металлокаркасы для мебели» (/metallokarkasy-dlya-mebeli/).
   Дополняет home.css и page.css, те же токены, сетка и шапка. */

/* ---------- первый экран ---------- */
.hero-k .hero-main { grid-template-columns: 52% 48%; }
.hero-k .hero-l { padding-top: calc(var(--hd) + 44px); }
.hero-k .crumbs { margin-bottom: 22px; }
.hero-k .h1k { font-size: min(4.4cqi, 64px); }
.hero-k .hero-sub { max-width: 560px; }
.hero-k .hero-mark { left: 50%; }
/* знак не заходит на заголовок и на полосу фактов: полоса лежит поверх него (правка 05.10, в макете контур перекрывал «Ы» и подпись «гарантия на изделия») */
.hero-k .facts { z-index: 2; }
.fam-chip { display: flex; gap: 16px; align-items: center; margin-top: 34px; max-width: 580px; padding: 16px 18px; background: rgba(255, 255, 255, .62); border: 1px solid var(--line); }
.fam-chip svg { width: 38px; height: 26px; fill: var(--red); flex: none; }
.fam-chip b { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; }
.fam-chip span span { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.fact .num small { font-size: 20px; letter-spacing: 0; margin-left: 4px; }

/* ---------- из цеха на объект ---------- */
.k-cmp .cmp { height: 560px; }
.cmp-seg { margin-top: 32px; }
.cmp-seg button { min-height: 44px; }
.cmp-legend span:last-child { text-align: right; max-width: 70%; }

/* ---------- каркасы карточками ---------- */
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tcard { background: var(--white); display: flex; flex-direction: column; }
.tcard .ph { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ti); }
.tcard .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.tcard .ph img.kimg { opacity: 0; }
.tcard.k .ph img.kimg { opacity: 1; }
.tcard.k .ph img.fimg { opacity: 0; }
.tcard:hover .ph img { transform: scale(1.04); }
.tcard .tnum { position: absolute; left: 12px; top: 12px; z-index: 2; background: var(--white); padding: 7px 10px; }
.tcard .ph .seg { position: absolute; left: 12px; bottom: 12px; z-index: 2; background: rgba(255, 255, 255, .94); }
.tcard .ph .seg button { min-height: 44px; }
.tcard .bd { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.tcard .disp { font-size: 26px; line-height: 1; }
.tcard .p { font-size: 15px; line-height: 1.5; }
.tadd { margin-top: auto; align-self: flex-start; }
.kw .tadd.on { background: var(--steel); border-color: var(--steel); color: var(--white); }
.tsel { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; padding: 20px 24px; background: var(--white); border: 1px solid var(--line); }
.tsel .p { max-width: 760px; }
.tsel .p b { color: var(--ink); font-weight: 600; }

/* ---------- каталог ---------- */
.cat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.cat-l { grid-column: 1 / 7; }
.cat-l .lead { margin: 26px 0 34px; }
.cat-r { grid-column: 7 / 13; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: 210px 210px; gap: 12px; }
.cat-r figure { margin: 0; position: relative; overflow: hidden; background: var(--white); }
.cat-r figure:first-child { grid-row: span 2; }
.cat-r img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.cat-r figure:hover img { transform: scale(1.05); }
.cat-r .lbl { position: absolute; left: 12px; bottom: 12px; background: var(--white); padding: 7px 10px; }
.cat-on { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--corten); font-weight: 500; }

/* ---------- путь от чертежа до серии ---------- */
.path-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; margin-bottom: 56px; }
.path-top .disp { grid-column: 1 / 8; }
.path-top .lead { grid-column: 8 / 13; color: #D5DEE2; }
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, .22); }
.pstep { position: relative; padding: 28px 22px 8px 0; }
.pstep + .pstep { padding-left: 22px; border-left: 1px solid rgba(255, 255, 255, .14); }
.pstep::before { content: ''; position: absolute; left: 0; top: -2px; height: 3px; width: 0; background: var(--red); transition: width .6s ease; }
.pstep:hover::before { width: 100%; }
.pstep .pn { display: block; color: #FF8A7D; font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.pstep .disp { font-size: 28px; line-height: 1; margin: 18px 0 14px; }
.pstep p { margin: 0; color: #C3CED3; font-size: 15px; line-height: 1.5; }
.path-cta { margin-top: 56px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.path-cta .p { color: #C3CED3; }

/* ---------- заявка ---------- */
.fgrp { display: flex; flex-direction: column; gap: 10px; }
.fgrp .flab { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.calc-chip a { color: var(--corten); text-underline-offset: 3px; }
.fsum { list-style: none; padding: 0; margin: 0; width: 100%; }
.fsum li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fsum li span:first-child { color: var(--muted); flex: none; }
.fsum li span:last-child { text-align: right; }

/* ---------- планшет ---------- */
@container k (min-width: 821px) and (max-width: 1100px) {
  .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path { grid-template-columns: 1fr; }
  .pstep, .pstep + .pstep { padding: 22px 0; border-left: 0; border-bottom: 1px solid rgba(255, 255, 255, .14); display: grid; grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 24px; align-items: baseline; }
  .pstep .disp { margin: 0; font-size: 24px; }
  .cat-r { grid-template-rows: 170px 170px; }
}

/* ---------- телефон ---------- */
@container k (max-width: 820px) {
  .hero-k .hero-l { padding-top: 28px; }
  .hero-k .h1k { font-size: 9cqi; }
  .hero-k .crumbs { margin-bottom: 16px; }
  .fam-chip { margin-top: 24px; padding: 14px; gap: 12px; }
  .fam-chip svg { width: 30px; height: 20px; }
  .fact .num small { font-size: 14px; }

  .k-cmp .cmp { height: 300px; }
  .cmp-seg { display: flex; margin-top: 22px; }
  .cmp-seg button { flex: 1; }
  .k-cmp .cmp-l .btn { width: 100%; }

  .types { grid-template-columns: 1fr; gap: 12px; }
  .tcard .bd { padding: 18px 18px 20px; }
  .tcard .disp { font-size: 22px; }
  .tadd { align-self: stretch; }
  .tsel { padding: 16px; }
  .tsel .btn { flex: 1 1 100%; }

  .cat { display: flex; flex-direction: column; align-items: stretch; gap: 28px; }
  .cat-l .btn { width: 100%; }
  .cat-r { grid-template-rows: 150px 150px; gap: 8px; }

  .path-top { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
  .path { grid-template-columns: 1fr; }
  .pstep, .pstep + .pstep { padding: 20px 0; border-left: 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
  .pstep .disp { font-size: 24px; margin: 10px 0 8px; }
  .path-cta { margin-top: 36px; }
  .path-cta .btn { flex: 1 1 100%; }
}

/* ---------- галерея объекта на телефоне: фото на всю ширину, стрелки под ним (как в макете) ---------- */
@media (max-width: 820px) {
  .kw[data-page="karkas"] .gal { padding: 16px; }
  .kw[data-page="karkas"] .gal-main { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
  .kw[data-page="karkas"] .gal-main > img { grid-column: 1 / -1; grid-row: 1; max-height: none; }
  .kw[data-page="karkas"] .gal-main > .ibtn:first-child { grid-column: 1; grid-row: 2; justify-self: start; }
  .kw[data-page="karkas"] .gal-main > .ibtn:last-child { grid-column: 2; grid-row: 2; justify-self: end; }
  .kw[data-page="karkas"] .gal-th { justify-content: flex-start; overflow-x: auto; }
}

/* телефон: контур знака остаётся на фото и не заходит на крошки и заголовок (правка 05.10) */
@container k (max-width: 820px) {
  .hero-k .hero-mark { left: 14%; top: 60px; width: 380px; }
}
