/* АЙРТЕХНО — запчасти Atlas Copco.
   Графитовая шапка, холодный серый фон, янтарный акцент для действий.
   Главный образ — табличка-шильдик с номером детали. */
:root {
  --ink: #22282E;
  --ink-2: #3A434B;
  --steel: #56616B;
  --line: #D3D9DD;
  --fog: #EDF0F1;
  --paper: #FFFFFF;
  --amber: #E3A21A;
  --amber-deep: #B47C0B;
  --blue: #1D5B9E;
  --ok: #2E7D4F;
  --bad: #B3261E;
  --font: "Golos Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --r: 4px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55;
  color: var(--ink); background: var(--fog);
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: .8em 1.25em; border-radius: var(--r); border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.btn-primary:hover { background: #F0B232; color: var(--ink); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { color: inherit; background: rgba(255,255,255,.08); }
.link-btn { font: inherit; color: var(--blue); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* ---------- Шапка ---------- */
.site-head { background: var(--ink); color: #fff; }
.head-row { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
.logo { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; flex-shrink: 0; }
.logo:hover { color: #fff; }
.logo-name { font-weight: 700; font-size: 1.3rem; letter-spacing: .06em; }
.logo-sub { font-size: .8rem; color: #AEB8C0; }
.head-search { flex: 1; display: flex; max-width: 520px; }
.head-search input {
  flex: 1; min-width: 0; font: inherit; padding: .6em .8em; border: 0; border-radius: var(--r) 0 0 var(--r);
  background: #fff; color: var(--ink);
}
.head-search button {
  font: inherit; font-weight: 600; padding: 0 1em; border: 0; border-radius: 0 var(--r) var(--r) 0;
  background: var(--amber); color: var(--ink); cursor: pointer;
}
.head-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.head-phone { color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.head-phone:hover { color: var(--amber); }
.cart-btn {
  font: inherit; font-weight: 600; color: #fff; background: transparent; cursor: pointer;
  border: 1px solid #5B666F; border-radius: var(--r); padding: .45em .8em; white-space: nowrap;
}
.cart-btn:hover { border-color: var(--amber); }
.cart-count { display: inline-block; min-width: 1.5em; margin-left: .3em; padding: 0 .35em; border-radius: 99px; background: var(--amber); color: var(--ink); text-align: center; font-size: .85em; }
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; padding-bottom: 12px; font-size: .95rem; }
.nav a { color: #D6DCE0; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--amber); }

.tender-btn {
  color: var(--amber); text-decoration: none; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--amber); border-radius: var(--r); padding: .45em .8em;
}
.tender-btn:hover { background: var(--amber); color: var(--ink); }
.nav .nav-tender { display: none; color: var(--amber); }

/* ---------- Тендер ---------- */
#tender, #request { scroll-margin-top: 16px; }
.band-form { background: var(--fog); }
.tender-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 48px; align-items: start; }
.tender-intro p { color: var(--ink-2); }
.tender-list { margin: 0 0 1em; padding-left: 1.2em; color: var(--ink-2); }
.tender-list li { margin-bottom: 4px; }
.tender-form { margin-top: 0; max-width: none; }
.field input[type="file"] { padding: .45em; background: var(--fog); }

/* ---------- Главный экран ---------- */
.hero { background: var(--ink); color: #fff; padding: 40px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1fr minmax(320px, 520px); gap: 48px; align-items: center; }
.hero h1 { max-width: 16ch; font-size: clamp(2rem, 4.6vw, 3.3rem); }
.lead { font-size: 1.12rem; color: #C9D1D6; max-width: 58ch; }
.page .lead { color: var(--steel); }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero .btn-ghost { color: #fff; }

/* Шильдик */
.plate {
  position: relative; color: var(--ink);
  background: linear-gradient(170deg, #F6F8F9 0%, #E2E7EA 55%, #EEF1F3 100%);
  border: 1px solid #A9B2B9; border-radius: 6px;
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #C3CAD0, 0 18px 40px -24px rgba(0,0,0,.55);
  padding: 30px 34px 26px;
}
.rivet {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, #B4BCC2 45%, #7E8890 100%);
  box-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.r1 { top: 10px; left: 10px; } .r2 { top: 10px; right: 10px; }
.r3 { bottom: 10px; left: 10px; } .r4 { bottom: 10px; right: 10px; }
.plate-brand { font-size: .88rem; color: var(--steel); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #BFC7CD; }
.plate-label { display: block; font-weight: 600; margin-bottom: 8px; }
.plate-row { display: flex; gap: 8px; }
.plate-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.35rem; font-weight: 600; letter-spacing: .04em;
  padding: .5em .6em; border: 1px solid #8F99A1; border-radius: var(--r); background: #fff; color: var(--ink);
}
.plate-row input::placeholder { color: #9AA3AA; }
.plate-hint { font-size: .88rem; color: var(--steel); margin: 12px 0 0; }

/* ---------- Секции ---------- */
.band { background: var(--paper); padding: 56px 0; border-bottom: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; padding-top: 56px; padding-bottom: 56px; align-items: start; }
.page .split { padding-top: 8px; }
.section-lead { color: var(--steel); max-width: 62ch; }

.steps { list-style: none; counter-reset: s; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.steps li { counter-increment: s; padding: 0 24px 0 0; position: relative; }
.steps li::before {
  content: counter(s); display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); font-weight: 700; margin-bottom: 14px; background: var(--paper);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: 44px; right: 8px; border-top: 2px dashed #B5BEC4; }
.steps p { color: var(--steel); margin: 0; }
.steps-plain { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.steps-plain li::after { display: none; }

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 32px; margin: 20px 0 0; }
.facts div { border-top: 2px solid var(--ink); padding-top: 10px; }
.facts dt { font-weight: 700; margin-bottom: 4px; }
.facts dd { margin: 0; color: var(--steel); }
.note-price { background: var(--paper); border-left: 4px solid var(--amber); padding: 24px 26px; }
.note-price p { color: var(--ink-2); }
.note-price p:last-child { margin: 0; }

/* ---------- Формы ---------- */
.req-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; max-width: 820px; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; font-weight: 500; }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink);
  padding: .6em .7em; border: 1px solid #A7B0B7; border-radius: var(--r); background: #fff; width: 100%;
}
.field textarea { resize: vertical; }
.field small { color: var(--steel); font-weight: 400; }
.req-submit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.req-note { font-size: .85rem; color: var(--steel); margin: 0; }
.req-msg { margin: 0; min-height: 1.4em; }
.req-msg.is-ok { color: var(--ok); font-weight: 600; }
.req-msg.is-error { color: var(--bad); }
.req-cart { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: var(--r); background: var(--fog); padding: 10px 14px; }
.req-cart ul { list-style: none; margin: 0; padding: 0; }
.req-cart li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.req-cart li:last-child { border-bottom: 0; }
.req-cart li span { flex: 1; min-width: 0; }
.req-cart .qty { width: 4.2em; font: inherit; padding: .25em .4em; border: 1px solid #A7B0B7; border-radius: var(--r); }
.req-cart .rm { font: inherit; font-size: .85rem; background: none; border: 0; color: var(--bad); cursor: pointer; }

.req-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 6px; padding: 24px 26px; color: var(--ink); }
.req-dialog::backdrop { background: rgba(34,40,46,.6); }
.req-dialog .req-form { margin-top: 8px; }
.req-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.req-dialog-head h2 { font-size: 1.3rem; margin: 0; }
.req-close { font: inherit; font-size: 1.8rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--steel); padding: 0 4px; }

/* ---------- Внутренние страницы ---------- */
.page { padding-top: 24px; padding-bottom: 64px; }
.prose { max-width: 820px; margin-left: max(20px, calc((100vw - var(--wrap)) / 2 + 20px)); }
.prose h2 { margin-top: 1.6em; }
.crumbs ol { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .88rem; color: var(--steel); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: #9AA3AA; }
.crumbs a { color: var(--steel); }

.cat-search { display: flex; gap: 8px; max-width: 640px; margin-bottom: 14px; }
.cat-search input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: .7em .8em; border: 1px solid #8F99A1; border-radius: var(--r); background: #fff; }
.cat-meta { color: var(--steel); font-size: .95rem; }
.empty { background: var(--paper); padding: 28px; border-left: 4px solid var(--amber); max-width: 720px; }

.parts { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); }
.parts th { text-align: left; font-size: .85rem; font-weight: 600; color: var(--steel); padding: 10px 14px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.parts td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.parts tbody tr:hover { background: #F7F9FA; }
.c-pn { white-space: nowrap; }
.c-pn a { font-weight: 600; font-size: 1.05rem; letter-spacing: .03em; color: var(--ink); text-decoration: none; }
.c-pn a:hover { color: var(--blue); text-decoration: underline; }
.pn-alt { display: block; font-size: .8rem; font-weight: 400; color: var(--steel); letter-spacing: .02em; }
.near .pn-alt { display: inline; margin-right: 10px; }
.part-h2 { font-size: 1.15rem; margin: 1.6em 0 .5em; }
.cat-about { margin-top: 48px; max-width: 760px; }
.cat-about h2 { font-size: 1.25rem; }
.cat-about p { color: var(--ink-2); }
.n-main { display: block; }
.n-en { display: block; font-size: .85rem; color: var(--steel); }
.c-price { width: 190px; }
.c-add { width: 120px; text-align: right; }

.price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-price {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: .4em .8em; border-radius: var(--r); border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.btn-price:hover { background: var(--ink); color: #fff; }
.btn-price:disabled { cursor: progress; border-style: dashed; background: transparent; color: var(--steel); }
.price-val { font-weight: 700; }
.price.is-shown .price-val { animation: reveal .35s ease-out; box-shadow: inset 0 -6px 0 rgba(227,162,26,.45); }
.price.is-error .price-val { font-weight: 400; font-size: .85rem; color: var(--bad); }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.btn-add {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  padding: .4em .8em; border-radius: var(--r); border: 1px solid var(--amber); background: var(--amber); color: var(--ink);
}
.btn-add:hover { background: #F0B232; }
.btn-add.is-added { background: transparent; border-color: var(--ok); color: var(--ok); }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.pager a, .pager span { padding: .4em .75em; border-radius: var(--r); text-decoration: none; }
.pager a { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.pager a:hover { border-color: var(--ink); }
.pager span[aria-current] { background: var(--ink); color: #fff; }

/* Карточка детали */
.part { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.plate-part { display: inline-block; padding: 26px 40px 22px; margin-bottom: 24px; }
.plate-part .plate-label { font-size: .85rem; font-weight: 500; color: var(--steel); margin: 0 0 2px; }
.plate-num { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 700; letter-spacing: .05em; margin: 0; line-height: 1.1; white-space: nowrap; }
.h1-sub { display: block; font-size: 1rem; font-weight: 500; color: var(--steel); margin-top: .4em; letter-spacing: 0; }
.specs { margin: 0 0 20px; background: var(--paper); border: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--steel); }
.specs dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.part-text { color: var(--ink-2); max-width: 66ch; }
.buy { background: var(--paper); border-top: 4px solid var(--amber); padding: 22px 24px; position: sticky; top: 16px; }
.buy-h { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; }
.buy .price { margin-bottom: 14px; }
.price-big .price-val { font-size: 1.7rem; }
.price-big .btn-price { font-size: 1rem; padding: .7em 1.1em; }
.buy .btn-add { font-size: 1rem; padding: .7em 1.1em; width: 100%; }
.buy-note { font-size: .88rem; color: var(--steel); margin: 14px 0 0; }
.near { margin-top: 48px; }
.near ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
.near li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.near li a:hover { color: var(--blue); }
.near-pn { font-weight: 600; letter-spacing: .03em; margin-right: 10px; }

/* ---------- Подвал ---------- */
.site-foot { background: var(--ink); color: #BCC5CB; padding: 44px 0 28px; font-size: .92rem; }
.site-foot a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 32px; }
.foot-logo { color: #fff; font-weight: 700; letter-spacing: .06em; font-size: 1.15rem; margin-bottom: 8px; }
.foot-h { color: #fff; font-weight: 600; margin-bottom: 8px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 6px; }
.foot-legal { border-top: 1px solid #3B454D; margin-top: 28px; padding-top: 18px; font-size: .82rem; color: #8F9AA2; }
.foot-legal p { margin: 0 0 4px; }

/* ---------- Админка ---------- */
.alert { padding: 12px 16px; border-radius: var(--r); background: var(--paper); border-left: 4px solid; }
.alert.ok { border-color: var(--ok); } .alert.bad { border-color: var(--bad); }
.admin-login, .admin-import { display: grid; gap: 14px; max-width: 560px; background: var(--paper); padding: 20px; margin-bottom: 24px; }
.table-scroll { overflow-x: auto; }
.admin-table td { vertical-align: top; font-size: .9rem; }
.admin-table pre { white-space: pre-wrap; font: inherit; margin: 0; }

/* ---------- Адаптивность ---------- */
@media (max-width: 960px) {
  .hero-grid, .split, .part { grid-template-columns: 1fr; }
  .buy { position: static; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .steps li::after { display: none; }
  .head-row { flex-wrap: wrap; }
  .head-search { order: 3; flex-basis: 100%; max-width: none; }
  .tender-grid { grid-template-columns: 1fr; gap: 20px; }
  .tender-btn { display: none; }
  .nav .nav-tender { display: inline; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .head-phone { display: none; }
  .hero { padding: 28px 0 40px; }
  .plate { padding: 26px 20px 22px; }
  .plate-part { display: block; padding: 22px 20px 18px; }
  .plate-row { flex-direction: column; }
  .steps, .steps-plain, .facts, .near ul, .foot-grid { grid-template-columns: 1fr; }
  .req-form { grid-template-columns: 1fr; }
  .specs div { grid-template-columns: 1fr; gap: 2px; }
  .parts thead { display: none; }
  .parts, .parts tbody, .parts tr, .parts td { display: block; width: 100%; }
  .parts tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .parts td { padding: 0; border: 0; }
  .parts td.c-name { margin: 2px 0 10px; }
  .parts td.c-price, .parts td.c-add { display: inline-block; width: auto; vertical-align: middle; }
  .parts td.c-add { margin-left: 8px; text-align: left; }
  .prose { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
