/* Металл-PRO — стили сайта. Mobile-first: базовые правила для телефона, @media (min-width) — планшет и десктоп.
   Цвета — токены :root, тёмная тема — prefers-color-scheme. Без зависимостей. */
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/oswald-600-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/oswald-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #eceef1; --card: #ffffff; --ink: #1f2328; --soft: #555d6a; --line: #d5d9df;
  --accent: #e2561b; --accent-ink: #ffffff; --bar: #1f2328; --bar-ink: #ffffff;
  --head: "Oswald", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  --r: 12px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #121417; --card: #1b1f24; --ink: #eef0f3; --soft: #a3abb7; --line: #2c323a;
  --accent: #ff6a2b; --accent-ink: #160903; --bar: #0b0d10; --bar-ink: #eef0f3; color-scheme: dark;
} }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 72px; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--body); padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  overflow-x: clip; /* страховка: ни один элемент не расширяет страницу (clip, а не hidden — sticky-шапка продолжает работать) */ }
/* заголовки считаются от ширины колонки, а не окна: vw включает классическую полосу прокрутки (17px в десктопном Chrome),
   и длинное «МЕТАЛЛОКОНСТРУКЦИИ» без переноса вылезало за край */
main.wrap, .hero .wrap { container-type: inline-size; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: 16px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .01em; line-height: 1.08; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(22px, 8.6cqi, 48px); }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
.small { font-size: 12px; color: var(--soft); }
.small a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 999px; border: 0;
  font: 600 16px/1 var(--body); text-decoration: none; cursor: pointer; color: var(--accent-ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, white) 0 46%, var(--accent) 54% 100%); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- шапка ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 8px; height: 56px; }
.logo { flex: 1; min-width: 0; }
.logo img { height: 28px; width: auto; }
.logo .dark { display: none; }
@media (prefers-color-scheme: dark) { .logo .light { display: none; } .logo .dark { display: block; } }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 24px; height: 24px; }
.desk-phone, .desk-nav { display: none; }
details.menu > summary { list-style: none; cursor: pointer; }
/* закрытое меню Chrome всё равно раскладывает (content-visibility), и длинные пункты расширяли страницу на несколько px */
details.menu:not([open]) > .menu-panel { display: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; left: 0; right: 0; top: 56px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px -16px rgba(0,0,0,.35); max-height: calc(100dvh - 56px - 68px); overflow-y: auto; }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: flex; justify-content: space-between; gap: 12px; padding: 15px 16px; border-top: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.menu-panel a span { color: var(--soft); font-weight: 400; font-size: 14px; text-align: right; }

/* ---------- крошки и заголовок страницы ---------- */
.crumbs { list-style: none; margin: 0; padding: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--soft); }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }
.crumbs a { text-decoration: none; }
.page-head { padding-block: 12px 4px; }
.page-head h1 { margin-top: 6px; }
.page-head .lead { color: var(--soft); margin: 10px 0 0; max-width: 60ch; }

/* ---------- первый экран главной ---------- */
.hero { position: relative; color: #fff; background: #1f2328; }
.hero img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; opacity: .55; }
.hero .wrap { position: absolute; inset: auto 0 0 0; padding-block: 0 20px; }
.kick { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.hero h1 { font-size: clamp(22px, 9cqi, 56px); margin: 8px 0 10px; }
.hero h1 em { font-style: normal; color: #ff7a3d; }
.hero p { margin: 0; font-size: 16px; max-width: 46ch; }
.hero-cta { display: grid; gap: 10px; padding-block: 16px 4px; }

/* ---------- цифры ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-block: 1px solid var(--line); margin-top: 16px; }
.fact { background: var(--card); padding: 14px 16px; }
.fact b { display: block; font: 600 22px/1.1 var(--head); font-variant-numeric: tabular-nums; }
.fact span { font-size: 13px; color: var(--soft); }

section { padding-block: 32px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec-head a { font-size: 14px; color: var(--soft); white-space: nowrap; }

/* ---------- карточки направлений ---------- */
.dirs { display: grid; gap: 10px; }
.dir { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--card); border-radius: var(--r); padding: 8px; text-decoration: none; min-height: 96px; }
.dir img, .dir .noimg { width: 104px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--line); }
.dir p { margin: 3px 0 4px; font-size: 14px; color: var(--soft); line-height: 1.35; }
.dir .pr { font: 600 14px var(--mono); font-variant-numeric: tabular-nums; }
.dir .pr::after { content: " →"; color: var(--accent); }
.pr-request { font: 500 13px var(--body) !important; color: var(--soft); text-transform: none; }
.price-from.pr-request { font-size: 15px !important; margin-top: 4px; }
.dir h3 { overflow-wrap: anywhere; }
@media (max-width: 359px) {
  .dir { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
  .dir img, .dir .noimg { width: 84px; height: 68px; }
  .dir h3 { font-size: 16px; }
}

/* ---------- производство ---------- */
.prod { display: grid; gap: 10px; }
.prod figure { margin: 0; position: relative; border-radius: var(--r); overflow: hidden; }
.prod figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.prod figcaption { position: absolute; left: 10px; bottom: 10px; background: rgba(15,17,20,.78); color: #fff; font-size: 13px; padding: 5px 9px; border-radius: 6px; }
.prod ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prod li { background: var(--card); border-radius: 10px; padding: 12px; font-size: 14px; color: var(--soft); }
.prod li b { display: block; color: var(--ink); font: 600 18px var(--head); }
.prod-note { background: var(--card); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.prod-note p { margin: 0; color: var(--soft); }
.prod-note p b { color: var(--ink); }
.prod-note ul { display: grid; grid-template-columns: 1fr; gap: 6px; padding-left: 0; }
.prod-note li { background: var(--bg); padding: 10px 12px 10px 34px; position: relative; color: var(--ink); }
.prod-note li::before { content: "✓"; position: absolute; left: 12px; color: var(--accent); font-weight: 700; }

/* ---------- объекты: карусель ---------- */
.objects { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
.obj { scroll-snap-align: start; background: var(--card); border-radius: var(--r); overflow: hidden; text-decoration: none; }
.obj img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.obj div { padding: 12px 14px 14px; }
.obj small { font: 500 12px var(--mono); color: var(--soft); }
.obj h3 { font-size: 16px; margin-top: 4px; }

/* ---------- этапы ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; position: relative; }
.steps li::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 16px var(--head); }
.steps strong { display: block; }
.steps span { font-size: 14px; color: var(--soft); }
.steps small { font: 500 12px var(--mono); color: var(--accent); }

/* ---------- форма ---------- */
.form { background: var(--card); border-radius: var(--r); padding: 18px 16px; display: grid; gap: 12px; }
.form p { margin: 0; color: var(--soft); font-size: 14px; }
.form label { display: grid; gap: 4px; font-size: 14px; color: var(--soft); min-width: 0; }
.form input[type=file] { min-width: 0; max-width: 100%; font-size: 14px; }
.form input, .form select, .form textarea { font: 500 16px var(--body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 13px 12px; min-height: 48px; width: 100%; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form .is-invalid { border-color: #d93025; }
.form [data-error] { color: #d93025; font-size: 13px; }
.form [data-error]:empty { display: none; }
.form .hp { position: absolute; left: -9999px; }
.form-ok { background: color-mix(in srgb, #1f7a45 14%, var(--card)); border-radius: 10px; padding: 12px; font-size: 15px; }
.form-err { background: color-mix(in srgb, #d93025 12%, var(--card)); border-radius: 10px; padding: 12px; font-size: 15px; }

/* ---------- страницы продукта и раздела ---------- */
.p-hero { display: grid; gap: 14px; padding-top: 12px; }
.p-hero img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); }
.p-hero h1 { margin-bottom: 8px; }
.p-hero .lead { color: var(--soft); margin: 10px 0 0; }
.p-hero .cta { display: grid; gap: 10px; margin-top: 16px; }
.price-from { font: 600 22px var(--head); text-decoration: none; }
.price-from span { color: var(--soft); font: 400 14px var(--body); text-transform: none; }
.prose { max-width: 72ch; }
.prose > * + * { margin-top: .9em; }
.prose h2 { font-size: 22px; margin-top: 1.4em; }
.prose h3 { font-size: 18px; margin-top: 1.2em; }
.prose p, .prose ul, .prose ol { margin-block: 0; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose a { color: var(--accent); }
.prose img { border-radius: 8px; }
.tbl { overflow-x: auto; background: var(--card); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; }
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); }
.gallery figcaption { font-size: 13px; color: var(--soft); padding-top: 6px; }
.faq details { background: var(--card); border-radius: 10px; margin-bottom: 8px; }
.faq summary { padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq summary::-webkit-details-marker { display: none; }
.faq .a { padding: 0 16px 14px; color: var(--soft); }
.seo-text { color: var(--soft); font-size: 15px; }

/* ---------- калькулятор веса металла ---------- */
.mcalc { display: grid; gap: 14px; margin-top: 18px; }
.mc-dims, .mc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mc-dims label:only-child { grid-column: 1 / -1; }
.mc-res { display: grid; gap: 12px; align-content: start; }
.mc-res table th { font: 400 15px var(--body); text-transform: none; letter-spacing: 0; color: var(--ink); }
.mc-res td.num { text-align: right; font-size: 16px; }
.mc-err { color: #d93025; margin: 0; padding: 12px; }
@media (min-width: 760px) { .mcalc { grid-template-columns: 1.1fr 1fr; align-items: start; } .mc-res { position: sticky; top: 84px; } }

/* ---------- подвал ---------- */
footer { margin-top: 36px; background: var(--bar); color: var(--bar-ink); padding-block: 28px 24px; font-size: 14px; }
footer .wrap { display: grid; gap: 18px; }
footer img { height: 26px; width: auto; }
footer a { text-decoration: none; }
footer .tel { font: 600 22px var(--head); }
footer .muted { opacity: .7; }
footer .muted a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- нижняя панель действий (телефон) ---------- */
.actbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bar); padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.actbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 10px; color: var(--bar-ink); text-decoration: none; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08); }
.actbar a svg { width: 22px; height: 22px; }
.actbar a.main { background: var(--accent); color: var(--accent-ink); font-size: clamp(13px, 4vw, 15px); flex-direction: row; gap: 8px; white-space: nowrap; }

/* ---------- cookie-баннер ---------- */
.cookie { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px -12px rgba(0,0,0,.45);
  padding: 12px 12px 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cookie p { margin: 0; font-size: 13px; line-height: 1.4; }
.cookie a { text-decoration: underline; text-underline-offset: 2px; }
.cookie .btn { min-height: 44px; padding: 0 22px; }

/* ---------- планшет ---------- */
@media (min-width: 760px) {
  .hero img { aspect-ratio: 16 / 7; }
  .hero-cta { grid-template-columns: auto auto; justify-content: start; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .dirs { grid-template-columns: 1fr 1fr; }
  .prod { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .objects { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin-inline: 0; padding-inline: 0; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .p-hero { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 28px; }
  .p-hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
  .gallery { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin-inline: 0; padding-inline: 0; }
}
/* ---------- десктоп ---------- */
@media (min-width: 1100px) {
  body { padding-bottom: 0; }
  .actbar, details.menu { display: none; }
  .cookie { left: auto; right: 24px; bottom: 24px; max-width: 460px; }
  .desk-nav { display: flex; gap: 22px; font-weight: 600; font-size: 15px; }
  .desk-nav ul { display: contents; list-style: none; }
  .desk-nav a { text-decoration: none; }
  .desk-nav a:hover, .desk-nav .active > a { color: var(--accent); }
  .desk-phone { display: block; font: 600 17px var(--head); text-decoration: none; margin-left: 12px; white-space: nowrap; }
  .top .wrap { height: 68px; gap: 24px; }
  .logo { flex: 0 0 auto; }
  .logo img { height: 34px; }
  .top .icon-btn.call { display: none; }
  .hero .wrap { padding-bottom: 40px; }
  .hero h1 { font-size: 60px; }
  h2 { font-size: 32px; }
  .dirs { grid-template-columns: repeat(3, 1fr); }
  .dir { grid-template-columns: minmax(0, 1fr); padding: 0; overflow: hidden; align-items: start; }
  .dir img, .dir .noimg { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
  .dir > div { padding: 4px 16px 16px; }
}
