/* ОконФорт shop pages. Built on the live home stylesheet (home.css): same tokens, header, buttons, footer. */

/* Header icons: comparison and cart with counters */
.hicon { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); flex-shrink: 0; transition: border-color .2s, color .2s; }
.hicon:hover { border-color: var(--accent); color: var(--accent-2); }
.hicon svg { width: 21px; height: 21px; }
.hicon b { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .875rem; font-weight: 800; line-height: 19px; text-align: center; }
.hicon b[hidden] { display: none; }
.header__actions .hicon + .header__phone { margin-left: .4rem; }
.nav a[aria-current="page"] { color: var(--accent-2); }
.nav a[aria-current="page"]::after { right: 0; }
@media (max-width: 859px) { .header__actions { gap: .35rem; } .hicon { width: 40px; height: 40px; } }

/* Page frame */
.s-page { padding-top: calc(var(--header) + 1.4rem); padding-bottom: 3rem; min-height: 70vh; }
.s-crumbs { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .85rem; color: var(--muted); margin: 0 0 .9rem; }
.s-crumbs a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.s-title { font-family: var(--display); font-size: clamp(1.6rem, 4.5vw, 2.5rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5rem; }
.s-sub { color: var(--muted); max-width: 62ch; margin: 0 0 1.4rem; line-height: 1.55; }
.s-note { font-size: .82rem; color: var(--muted); line-height: 1.5; margin: .8rem 0 0; }
.s-block { margin-top: 2.6rem; }
.s-block > h2 { font-family: var(--display); font-size: clamp(1.25rem, 3.4vw, 1.7rem); letter-spacing: -.02em; margin: 0 0 1rem; }
.s-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* Chips and segmented controls */
.s-tabs { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: .25rem; margin: 0 -.25rem 1rem; }
.s-tabs::-webkit-scrollbar { display: none; }
.s-tab { flex-shrink: 0; min-height: 44px; padding: .55rem 1.05rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 700 .95rem var(--font); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.s-tab:hover { border-color: var(--accent); }
.s-tab[aria-pressed="true"], .s-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.s-tab small { opacity: .65; font-weight: 600; margin-left: .25rem; }
.s-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.s-chip { min-height: 38px; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: 650 .88rem var(--font); color: var(--ink); cursor: pointer; }
.s-chip[aria-pressed="true"] { background: #fff1e6; border-color: var(--accent); color: var(--accent-2); }
.s-seg { display: inline-flex; padding: 4px; border-radius: 14px; background: #e6ebf1; gap: 2px; }
.s-seg button { min-height: 42px; padding: .45rem 1rem; border: 0; border-radius: 11px; background: transparent; font: 700 .92rem var(--font); color: var(--muted); cursor: pointer; }
.s-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(15, 27, 45, .12); }

/* Product grid and cards */
.s-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.s-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
@media (hover: hover) { .s-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); } }
.s-card__img { display: block; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--line); position: relative; }
.s-card__img img { width: 100%; height: 100%; object-fit: contain; padding: .4rem; }
.s-card__img svg { width: 100%; height: 100%; }
.s-card__badge { position: absolute; top: .7rem; left: .7rem; padding: .25rem .6rem; border-radius: 999px; background: var(--navy); color: #fff; font-size: .875rem; font-weight: 800; letter-spacing: .02em; }
.s-card__badge--hot { background: var(--accent); }
.s-card__3d { position: absolute; right: .7rem; top: .7rem; padding: .2rem .5rem; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .9); font-size: .875rem; font-weight: 800; color: var(--frame); }
.s-card__body { display: flex; flex-direction: column; gap: .45rem; padding: .95rem 1rem 1rem; flex: 1; }
.s-card__brand { font-size: .875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.s-card h3 { margin: 0; font-size: 1.12rem; line-height: 1.25; }
.s-card h3 a { color: var(--ink); }
.s-card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable; buttons sit above */
.s-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin: .15rem 0; padding: 0; list-style: none; }
.s-specs li { padding: .4rem .3rem; border-radius: 10px; background: var(--paper); text-align: center; font-size: .875rem; color: var(--muted); line-height: 1.25; }
.s-specs b { display: block; font-size: .98rem; color: var(--ink); }
.s-card__text { font-size: .88rem; color: var(--muted); line-height: 1.45; margin: 0; }
.s-price { font-weight: 800; font-size: 1.12rem; margin-top: auto; padding-top: .3rem; }
.s-price small { display: block; font-size: .875rem; font-weight: 600; color: var(--muted); }
.s-card__actions { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: .45rem; }
.s-card__actions .btn { min-height: 44px; padding: .5rem .8rem; font-size: .92rem; }
.s-cmp { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; min-width: 44px; padding: .4rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: 700 .85rem var(--font); color: var(--ink); cursor: pointer; }
.s-cmp svg { width: 18px; height: 18px; }
.s-cmp[aria-pressed="true"] { background: #fff1e6; border-color: var(--accent); color: var(--accent-2); }
.s-empty { padding: 2rem 1.2rem; border: 1px dashed rgba(15, 27, 45, .2); border-radius: var(--radius); text-align: center; color: var(--muted); }
.s-empty h2 { color: var(--ink); font-size: 1.2rem; margin: 0 0 .4rem; }
.s-empty .s-row { justify-content: center; margin-top: 1rem; }
.s-warn { padding: .7rem .9rem; border-radius: 12px; background: #fff6e9; border: 1px solid #f6d3a8; font-size: .88rem; line-height: 1.45; }

/* Level legend */
.s-levels { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); margin-bottom: 1.4rem; }
.s-level { padding: .8rem .95rem; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); }
.s-level b { display: block; }
.s-level span { font-size: .85rem; color: var(--muted); }
.s-level i { display: block; height: 6px; border-radius: 3px; background: #dbe3ea; margin-top: .55rem; overflow: hidden; }
.s-level i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }

/* Profile page */
.s-hero { display: grid; gap: 1.6rem; }
@media (min-width: 900px) { .s-hero { grid-template-columns: 1.15fr 1fr; align-items: start; gap: 2.4rem; } }
.s-gallery { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.s-gallery__stage { position: relative; aspect-ratio: 9 / 7; touch-action: pan-y; user-select: none; }
.s-gallery__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: .8rem; opacity: 0; transition: opacity .35s var(--ease); }
.s-gallery__stage img.is-on { opacity: 1; }
.s-gallery__nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .92); display: grid; place-items: center; cursor: pointer; color: var(--ink); z-index: 1; }
.s-gallery__nav:hover { border-color: var(--accent); color: var(--accent-2); }
.s-gallery__nav--prev { left: .6rem; } .s-gallery__nav--next { right: .6rem; }
.s-gallery__nav svg { width: 20px; height: 20px; }
.s-gallery__cap { display: flex; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 650; }
.s-gallery__cap span:last-child { color: var(--muted); font-weight: 600; white-space: nowrap; }
.s-thumbs { display: flex; gap: .45rem; padding: 0 1rem 1rem; overflow-x: auto; scrollbar-width: thin; }
.s-thumbs button { flex: 0 0 64px; height: 52px; border-radius: 10px; border: 2px solid transparent; background: var(--paper); padding: 2px; cursor: pointer; }
.s-thumbs button[aria-current="true"] { border-color: var(--accent); }
.s-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.s-info .s-card__brand { display: block; margin-bottom: .4rem; }
.s-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1.1rem 0; }
@media (min-width: 560px) { .s-facts { grid-template-columns: repeat(4, 1fr); } }
.s-facts div { padding: .7rem .6rem; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); text-align: center; }
.s-facts b { display: block; font-size: 1.15rem; }
.s-facts span { font-size: .875rem; color: var(--muted); }
.s-buy { padding: 1rem 1.1rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.s-buy .s-price { font-size: 1.5rem; padding: 0; margin-bottom: .8rem; }
.s-buy__row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.s-buy__row .btn { min-height: 50px; }
.s-buy__row .s-cmp { min-height: 50px; }
.s-fit { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.s-fit li { padding: .35rem .7rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .85rem; font-weight: 650; }

/* 3D viewer with whole/cut switch */
.s-viewer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.s-viewer__bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; padding: .7rem; border-bottom: 1px solid var(--line); }
.s-viewer__status { font-size: .82rem; color: var(--muted); }
.s-viewer__stage { position: relative; height: clamp(340px, 62vw, 560px); background: linear-gradient(180deg, #f7f9fb, #eef2f6); }
/* Desktop: taller stage so the 3D cut canvas is close to the 900x640 frames */
@media (min-width: 640px) { .s-viewer__stage { height: clamp(560px, 60vw, 880px); } }
.s-viewer__stage > [data-pane] { position: absolute; inset: 0; }
.s-viewer__stage > [data-pane][hidden] { display: none; }
.s-viewer__start { position: absolute; inset: 0; display: grid; place-content: center; gap: .8rem; text-align: center; padding: 1rem; color: var(--muted); }
.s-viewer__tools { display: flex; flex-wrap: wrap; gap: .4rem; padding: .7rem; border-top: 1px solid var(--line); }
.s-viewer__tools[hidden] { display: none; }
.s-viewer__tools button { min-height: 40px; padding: .4rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font: 650 .85rem var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
.s-viewer__tools button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.s-viewer__tools i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }
/* Engine inspector inside our stage */
.s-cut .profile-inspector { height: 100%; display: flex; flex-direction: column; }
.s-cut .profile-stage { position: relative; flex: 1; min-height: 0; }
.s-cut .profile-stage model-viewer, .s-cut .profile-stage canvas { width: 100%; height: 100%; display: block; }
.s-cut .profile-stage > img { width: 100%; height: 100%; object-fit: contain; }
.s-cut .profile-loading { position: absolute; inset: 0; display: grid; place-content: center; color: var(--muted); text-align: center; gap: .6rem; }
.s-cut .inspection-tools, .s-cut .part-tools { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem .7rem 0; }
.s-cut .inspection-tools button, .s-cut .part-tools button { min-height: 38px; padding: .3rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: 650 .8rem var(--font); cursor: pointer; }
.s-cut .inspection-tools button[aria-pressed="true"], .s-cut .part-tools button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.s-cut .part-description, .s-cut .profile-provenance { font-size: .875rem; color: var(--muted); padding: 0 .7rem; margin: .35rem 0; }
.s-cut .variant-control { display: flex; align-items: center; gap: .5rem; padding: 0 .7rem .5rem; font-size: .8rem; }
.s-cut .variant-control[hidden] { display: none; }
.s-cut .variant-control select { min-height: 38px; font: inherit; border-radius: 8px; border: 1px solid var(--line); max-width: 100%; }
.s-cut details.profile-provenance { padding-bottom: .5rem; }

/* Spec table */
.s-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.s-table th, .s-table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .95rem; }
.s-table tr:last-child th, .s-table tr:last-child td { border-bottom: 0; }
.s-table th { width: 42%; font-weight: 650; color: var(--muted); }
.s-table td { font-weight: 750; }
.s-sources { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.s-sources li { font-size: .9rem; }
.s-sources li a { font-weight: 650; color: var(--navy, #132238); text-decoration: underline; text-underline-offset: 3px; }
.s-sources small { display: block; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.s-table small { display: block; font-weight: 500; color: var(--muted); font-size: .875rem; margin-top: .2rem; line-height: 1.4; }

/* Comparison */
.s-cmpbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.s-switch { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; cursor: pointer; min-height: 44px; }
.s-switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: #cfd8e1; position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.s-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.s-switch input:checked { background: var(--accent); }
.s-switch input:checked::after { transform: translateX(18px); }
.s-cmpwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; scroll-snap-type: x mandatory; }
.s-cmptable { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.s-cmptable th, .s-cmptable td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; min-width: 170px; scroll-snap-align: start; }
.s-cmptable th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--paper); text-align: left; font-size: .85rem; color: var(--muted); font-weight: 650; min-width: 128px; max-width: 150px; }
.s-cmptable thead td { vertical-align: top; border-bottom: 2px solid var(--line); }
.s-cmptable thead th { background: var(--paper); }
.s-cmptable .s-cmp__img { display: block; aspect-ratio: 4 / 3; margin-bottom: .5rem; }
.s-cmptable .s-cmp__img img { width: 100%; height: 100%; object-fit: contain; }
.s-cmptable .s-cmp__name { display: block; font-weight: 800; color: var(--ink); line-height: 1.25; }
.s-cmptable .s-cmp__brand { display: block; font-size: .875rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.s-cmptable .s-cmp__del { margin-top: .45rem; border: 0; background: none; color: var(--muted); font: 600 .8rem var(--font); text-decoration: underline; cursor: pointer; min-height: 32px; }
.s-cmptable .s-cmp__buy { margin-top: .4rem; min-height: 40px; padding: .35rem .7rem; font-size: .85rem; width: 100%; }
.s-cmptable td.is-best { color: var(--accent-2); font-weight: 800; }
.s-cmptable td.is-best::after { content: " ★"; font-size: .8em; }
.s-cmptable tr.is-same { display: var(--same, table-row); }
.s-cmptable td { font-weight: 700; }
.s-cmptable tr:last-child > * { border-bottom: 0; }
.s-cmptable .s-bar { display: block; height: 6px; border-radius: 3px; background: #e3e9ef; margin-top: .4rem; overflow: hidden; }
.s-cmptable .s-bar::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--frame); border-radius: inherit; }
.s-cmptable td.is-best .s-bar::after { background: var(--accent); }
.s-cmpadd { display: grid; place-content: center; gap: .5rem; min-height: 160px; border: 1px dashed rgba(15, 27, 45, .22); border-radius: 14px; color: var(--muted); font-weight: 650; padding: .6rem; }
.s-cmpadd select { min-height: 42px; font: inherit; border-radius: 10px; border: 1px solid var(--line); padding: 0 .5rem; max-width: 100%; }

/* Cart */
.s-cart { display: grid; gap: 1.4rem; }
@media (min-width: 960px) { .s-cart { grid-template-columns: 1fr 360px; align-items: start; } .s-cart__side { position: sticky; top: calc(var(--header) + 1rem); } }
.s-lines { display: grid; gap: .8rem; }
.s-line { display: grid; grid-template-columns: 84px 1fr; gap: .9rem; padding: .9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.s-line__img { width: 84px; height: 84px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.s-line__img img, .s-line__img svg { width: 100%; height: 100%; object-fit: contain; }
.s-line__head { display: flex; justify-content: space-between; gap: .5rem; align-items: start; }
.s-line__head a { font-weight: 800; color: var(--ink); }
.s-line__sub { font-size: .85rem; color: var(--muted); margin: .15rem 0 .5rem; }
.s-line__del { border: 0; background: none; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 10px; font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.s-line__del:hover { background: var(--paper); color: var(--accent-2); }
.s-line__edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .3rem; }
@media (min-width: 640px) { .s-line__edit { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.s-line__edit label { display: grid; gap: .2rem; font-size: .875rem; font-weight: 650; color: var(--muted); min-width: 0; }
.s-line__edit select, .s-line__edit input, .s-form input, .s-form textarea { width: 100%; min-height: 42px; border-radius: 10px; border: 1px solid rgba(15, 27, 45, .18); padding: .35rem .6rem; font: 600 16px var(--font); color: var(--ink); background: #fff; }
.s-line__foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-top: .7rem; }
.s-qty { display: inline-flex; align-items: center; border: 1px solid rgba(15, 27, 45, .18); border-radius: 12px; overflow: hidden; }
.s-qty button { width: 40px; height: 40px; border: 0; background: var(--paper); font-size: 1.15rem; cursor: pointer; color: var(--ink); }
.s-qty output { min-width: 36px; text-align: center; font-weight: 800; }
.s-line__price { font-weight: 800; text-align: right; }
.s-line__price small { display: block; font-size: .875rem; color: var(--muted); font-weight: 600; }
.s-check { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 650; cursor: pointer; min-height: 40px; }
.s-check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.s-sum { padding: 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.s-sum dl { display: grid; grid-template-columns: 1fr auto; gap: .45rem .8rem; margin: 0 0 .9rem; font-size: .92rem; }
.s-sum dt { color: var(--muted); }
.s-sum dd { margin: 0; font-weight: 750; text-align: right; }
.s-sum__total { font-size: 1.55rem; font-weight: 800; margin: 0; }
.s-form { display: grid; gap: .65rem; margin-top: 1rem; }
.s-form label > span { display: block; font-size: .8rem; font-weight: 650; color: var(--muted); margin-bottom: .2rem; }
.s-form textarea { min-height: 76px; resize: vertical; }
.s-form .consent-check { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; line-height: 1.55; cursor: pointer; }
.s-form .consent-check input { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; margin: 3px 0 0; accent-color: var(--accent); }
.s-form .btn { min-height: 52px; }
.s-ok { padding: 1rem; border-radius: 14px; background: #e9f7ef; border: 1px solid #b9e3c8; font-weight: 650; }
.s-ok[hidden] { display: none; }
.s-upsell { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.s-mini { display: grid; grid-template-columns: 56px 1fr; gap: .6rem; align-items: center; padding: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.s-mini svg { width: 56px; height: 56px; }
.s-mini b { display: block; font-size: .88rem; line-height: 1.25; }
.s-mini button { margin-top: .25rem; border: 0; background: none; color: var(--accent-2); font: 750 .82rem var(--font); cursor: pointer; padding: .2rem 0; min-height: 30px; }

/* Toast */
.s-toast { position: fixed; left: 50%; bottom: calc(1rem + var(--safe-b)); translate: -50% 140%; z-index: 80; max-width: calc(100% - 2rem); padding: .8rem 1.1rem; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 650; font-size: .92rem; box-shadow: 0 12px 30px rgba(15, 27, 45, .3); transition: translate .35s var(--ease); display: flex; gap: .8rem; align-items: center; }
.s-toast.is-on { translate: -50% 0; }
.s-toast a { color: #ffb37a; text-decoration: underline; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .s-card, .s-gallery__stage img, .s-toast { transition: none; } }

/* Fix from the live home: the lead form forced a 436px column on phones (horizontal scroll at 390). */
.lead-grid > * { min-width: 0; }
@media (max-width: 899px) { .lead-grid { grid-template-columns: minmax(0, 1fr); } }
.panel-form { grid-template-columns: minmax(0, 1fr); }
.panel-form > *, .panel-form label { min-width: 0; }
.panel-form select, .panel-form input { width: 100%; min-width: 0; max-width: 100%; }

/* Phones: compact level legend and cart lines */
@media (max-width: 639px) {
  .s-levels { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -.7rem; padding-inline: .7rem; }
  .s-levels::-webkit-scrollbar { display: none; }
  .s-level { flex: 0 0 76%; scroll-snap-align: start; }
  .s-line { grid-template-columns: 56px 1fr; gap: .4rem .7rem; }
  .s-line__img { width: 56px; height: 56px; }
  .s-line > div:last-child { display: contents; }
  .s-line__edit, .s-line__foot { grid-column: 1 / -1; }
}

/* ---- Shell v2: header fit, mobile bottom bar, schematic sections, typical items ---- */
@media (min-width: 860px) and (max-width: 1099px) { .header__phone { display: none; } .nav { gap: .85rem; margin-left: 1rem; } .nav a { font-size: .9rem; } }
@media (min-width: 1100px) { .nav { gap: 1.05rem; margin-left: 1.1rem; } .header__phone { font-size: .88rem; } }
.mbar { display: none; }
@media (max-width: 859px) {
  body { padding-bottom: calc(64px + var(--safe-b)); }
  .mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 22px rgba(15, 27, 45, .08); padding-bottom: var(--safe-b); }
  .mbar a { position: relative; display: grid; justify-items: center; align-content: center; gap: .12rem; min-height: 64px; padding: .35rem .2rem; font-size: .875rem; font-weight: 750; color: var(--ink); }
  .mbar svg { width: 23px; height: 23px; }
  .mbar a[aria-current="page"] { color: var(--accent-2); }
  .mbar__call { color: var(--accent-2) !important; }
  .mbar b { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }
  .mbar b[hidden] { display: none; }
  .s-toast { bottom: calc(76px + var(--safe-b)); }
  .footer { padding-bottom: 1.5rem !important; }
}
.s-card__img--scheme svg { padding: 2.4rem .8rem .6rem; }
.s-card__img--scheme { background: linear-gradient(180deg, #fff, #f3f6f9); }
.s-scheme { display: grid; place-items: center; height: 100%; padding: 1rem; background: linear-gradient(180deg, #fff, #f3f6f9); }
.s-scheme svg { width: 100%; max-height: 100%; }
.s-facts { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .s-facts { grid-template-columns: repeat(5, 1fr); } }
.s-facts div { padding: .6rem .3rem; }
.s-facts b { font-size: 1.02rem; }
.s-typs { display: grid; gap: .6rem; }
.s-typ { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: .5rem .9rem; align-items: center; padding: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.s-typ__art svg { width: 74px; height: 64px; }
.s-typ b { display: block; }
.s-typ span { display: block; font-size: .82rem; color: var(--muted); }
.s-typ .s-price { margin: 0; padding: 0; text-align: right; white-space: nowrap; }
.s-typ .btn { grid-column: 1 / -1; min-height: 44px; }
@media (min-width: 760px) { .s-typ { grid-template-columns: 74px minmax(0, 1fr) 150px auto; } .s-typ .btn { grid-column: auto; } }
.c-table { min-width: 860px; }
.c-table th[scope="row"] { max-width: none; min-width: 190px; color: var(--ink); font-size: .92rem; }
.c-table th[scope="row"] a { font-weight: 800; }
.c-table small, .h-vs small { display: block; font-weight: 500; font-size: .875rem; color: var(--muted); }
.c-table thead th { font-size: .82rem; }
.c-table td { white-space: nowrap; }
.c-none { color: var(--muted); font-weight: 600 !important; }
.c-tier th { text-align: left !important; background: #fff1e6 !important; color: var(--accent-2) !important; font: 800 .8rem var(--font) !important; letter-spacing: .06em; text-transform: uppercase; position: static !important; max-width: none !important; }
.d-cta { margin-bottom: 1rem; }
.d-list { display: grid; gap: .55rem; padding: 0; margin: 0; list-style: none; }
.d-list li { position: relative; padding: .8rem 1rem .8rem 2.6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 650; }
.d-list li::before { content: ""; position: absolute; left: 1rem; top: 50%; width: 14px; height: 14px; translate: 0 -50%; border-radius: 4px; background: var(--accent); }
@media (min-width: 760px) { .d-list { grid-template-columns: 1fr 1fr; } }

/* Phones: a taller 3D stage; inspector controls scroll sideways so the model keeps most of the height */
@media (max-width: 639px) {
  .s-viewer__stage { height: min(80svh, 640px); }
  .s-cut .inspection-tools, .s-cut .part-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .s-cut .inspection-tools::-webkit-scrollbar, .s-cut .part-tools::-webkit-scrollbar { display: none; }
  .s-cut .inspection-tools button, .s-cut .part-tools button { flex-shrink: 0; min-height: 40px; }
  .s-cut .profile-stage { min-height: 320px; }
}
