/* ==========================================================================
   FIRSTSERT — базовая вёрстка. Цвета, радиусы и типографика — в темах.
   Все темы подключаются после этого файла и переопределяют переменные.
   ========================================================================== */

:root {
  --wrap: 1120px;

  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 40px;
  --sp-5: 64px;

  --ink: #12161c;
  --ink-2: #3d4753;
  --muted: #65717f;
  --line: #e2e7ee;
  --line-strong: #cfd7e2;

  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --card-bg: #ffffff;

  --accent: #1548ad;
  --accent-2: #0f3a8c;
  --accent-soft: #eaf0fb;
  --accent-ink: #ffffff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --card-border: 1px solid var(--line);
  --card-shadow: var(--shadow);

  --header-bg: #ffffff;
  --header-ink: #12161c;
  --header-line: #e2e7ee;
  --nav-ink: #3d4753;
  --topbar-bg: #0f1b2d;
  --topbar-ink: #d7dfec;
  --topbar-line: transparent;

  --footer-bg: #0e1420;
  --footer-ink: #c3cbd8;
  --footer-strong: #ffffff;
  --footer-line: #1e2839;
  --footer-muted: #8b97a9;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: var(--font-body);

  --h1-size: 34px;
  --h1-weight: 700;
  --h1-spacing: -.4px;
  --h2-size: 25px;
  --h2-weight: 700;
  --nav-transform: none;
  --nav-size: 15px;
  --nav-weight: 400;

  --btn-radius: 10px;
  --btn-radius-lg: 10px;
  --btn-shadow: none;
  --link-decoration: none;

  --section-pad: 44px;
  --cta-bg: linear-gradient(135deg, #123c8f, #1548ad);
  --cta-ink: #ffffff;
  --cta-muted: #dfe7f7;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: var(--link-decoration); }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 10px 14px; border-radius: 8px; z-index: 99; box-shadow: var(--shadow); color: #12161c; }

/* ---------- верхняя служебная полоса ---------- */
.topbar { background: var(--topbar-bg); color: var(--topbar-ink); border-bottom: 1px solid var(--topbar-line); font-size: 13px; }
.topbar .wrap { display: flex; align-items: center; gap: 20px; min-height: 38px; flex-wrap: wrap; }
.topbar a { color: inherit; opacity: .92; }
.topbar a:hover { opacity: 1; }
.topbar-links { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }

/* ---------- шапка ---------- */
.site-header { background: var(--header-bg); color: var(--header-ink); border-bottom: 1px solid var(--header-line); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark { display: block; width: 34px; height: 40px; flex: 0 0 auto; }
.logo-mark svg { display: block; width: 100%; height: 100%; }
.logo-text { display: flex; flex-direction: column; font-weight: 700; font-size: 17px; line-height: 1.15; letter-spacing: .3px; }
.logo-text small { font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: 0; margin-top: 2px; }

.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--nav-size); }
.nav a { color: var(--nav-ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; font-weight: var(--nav-weight); text-transform: var(--nav-transform); }
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.nav .nav-extra, .nav .nav-more { display: none; }
.nav-toggle { display: none; }

@media (max-width: 980px) {
  .site-header { position: relative; }
  .header-inner { flex-wrap: nowrap; gap: 10px; }
  .header-cta { order: 1; margin-left: auto; flex-direction: row; align-items: center; text-align: left; gap: 8px; }
  .header-cta .hours,
  .header-cta .msg-links,
  .header-cta .header-calc { display: none; }
  .phone { font-size: 15px; }
  .header-search { order: 2; }
  .header-search > summary { width: 42px; height: 42px; }
  .nav-toggle {
    order: 3;
    display: inline-grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--nav-ink);
    cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
  .nav-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); background: var(--card-bg); }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 60;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    padding: 8px 20px 16px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-line);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; white-space: normal; }
  .nav a:last-child { border-bottom: 0; }
  .nav .nav-extra { display: block; }
  .nav .nav-more {
    display: block;
    width: 100%;
    text-align: left;
    margin-top: 10px;
    padding: 10px 0 6px;
    border: 0;
    border-top: 1px solid var(--line-strong);
    background: none;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
  }
  .nav .nav-more:hover { color: var(--accent); }
}

.header-search { position: relative; flex: 0 0 auto; }
.header-search > summary { list-style: none; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--nav-ink); cursor: pointer; background: var(--bg-soft); }
.header-search > summary::-webkit-details-marker { display: none; }
.header-search > summary:hover,
.header-search[open] > summary { color: var(--accent); border-color: var(--accent); background: var(--card-bg); }
.header-search:focus-within > summary { outline: 2px solid var(--accent); outline-offset: 1px; }
.header-search form { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; display: flex; gap: 6px; width: 320px; padding: 10px; background: var(--card-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.header-search input { flex: 1 1 auto; min-width: 0; height: 36px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: 8px; }
.header-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--card-bg); }
.header-search button { flex: 0 0 auto; height: 36px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
.header-search button:hover { background: var(--accent-2); }

.header-cta { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.header-calc { display: none; }
.phone { font-weight: 700; font-size: 17px; white-space: nowrap; color: inherit; text-decoration: none; }
.hours { font-size: 12px; color: var(--muted); }
.msg-links { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; align-self: flex-end; }
.msg-link { color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--line-strong); }
.msg-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.msg-sep { color: var(--line-strong); }
.header-calc { display: inline-flex; }

/* ---------- каркас страницы ---------- */
main { display: block; }
.section { padding: var(--section-pad) 0; }
.section.soft { background: var(--bg-soft); }
.section.tight { padding: 28px 0; }
.block { margin-bottom: var(--sp-4); }
.block:last-child { margin-bottom: 0; }

.crumbs { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li::after { content: "/"; margin-left: 6px; color: var(--line-strong); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); }

h1 { font-family: var(--font-head); font-size: var(--h1-size); line-height: 1.2; margin: 14px 0 12px; letter-spacing: var(--h1-spacing); font-weight: var(--h1-weight); }
h2 { font-family: var(--font-head); font-size: var(--h2-size); line-height: 1.28; margin: 0 0 14px; letter-spacing: -.2px; font-weight: var(--h2-weight); }
h3 { font-size: 19px; line-height: 1.35; margin: 28px 0 10px; }
p { margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 78ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

ul.checks { list-style: none; padding: 0; margin: 0 0 16px; }
ul.checks li { position: relative; padding-left: 26px; margin-bottom: 9px; }
ul.checks li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
ul.plain { margin: 0 0 16px; padding-left: 20px; }
ul.plain li { margin-bottom: 7px; }

/* ---------- первый экран ---------- */
.hero { padding: 18px 0 8px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 22px 0 6px; }
@media (max-width: 480px) { .badges { grid-template-columns: 1fr; } }
.badge { position: relative; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 18px 18px 46px; min-height: 88px; display: flex; flex-direction: column; justify-content: center; gap: 6px; transition: transform .2s ease, border-color .25s ease, box-shadow .25s ease; }
.badge:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 28px rgba(16, 40, 90, .12); }
.badge-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); }
.badge-ico::before, .badge-ico::after { content: ""; position: absolute; background: var(--accent); }
.badge-ico::before { left: 7px; top: 6px; width: 8px; height: 10px; border-radius: 2px; }
.badge-ico::after { left: 10.5px; top: 4px; width: 1px; height: 4px; box-shadow: 0 11px 0 var(--accent); }
.badge-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.badge b { display: block; font-size: 15px; line-height: 1.45; font-weight: 600; white-space: normal; }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 2px; }
.badge-item { position: relative; padding-left: 14px; display: inline-block; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--ink); white-space: nowrap; }
.badge-item::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@media (max-width: 480px) { .badge-item { white-space: normal; } }
@media (hover: none) { .badge:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .badge { transition: none; } .badge:hover { transform: none; } }

/* ---------- живые счётчики ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 8px 0 4px; }
.stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 14px; text-align: center; transition: transform .2s ease, border-color .25s ease, box-shadow .25s ease; }
.stat:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 28px rgba(16, 40, 90, .12); }
.stat .num { display: block; font-size: 34px; font-weight: 800; line-height: 1.15; color: var(--accent); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat .stat-lbl { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.card { background: var(--card-bg); border: var(--card-border); border-radius: var(--radius); padding: 22px; box-shadow: var(--card-shadow); transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease; }
.card:hover, .card:focus-within { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(16, 40, 90, .14); }
.card.sticky { position: sticky; top: 88px; }
.card h2, .card h3 { margin-top: 0; }
.price-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.price-row:last-of-type { border-bottom: 0; }
.price-row b { white-space: nowrap; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: var(--btn-radius); font-weight: 600; font-size: 16px; border: 1px solid transparent; cursor: pointer; text-decoration: none; box-shadow: var(--btn-shadow); font-family: inherit; transition: transform .18s ease, box-shadow .25s ease, filter .25s ease, background .25s ease; }
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 40, 90, .18); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .btn-arr { display: inline-block; transition: transform .22s ease; }
.btn:hover .btn-arr { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 6px; }

/* ---------- сетки ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; background: var(--card-bg); border: var(--card-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--card-shadow); transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease; }
.tile h3 { margin: 0 0 6px; font-size: 18px; transition: color .2s ease; }
.tile p { font-size: 15px; color: var(--ink-2); margin-bottom: 10px; }
.tile .more { margin-top: auto; font-weight: 600; font-size: 15px; }
.tile .tile-price { font-weight: 600; color: var(--ink); }
.tile:hover, .tile:focus-within { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(16, 40, 90, .14); }
.tile:hover h3 { color: var(--accent); }
.tile .more { display: inline-flex; align-items: center; gap: 5px; }
.tile .more::after { content: "→"; transition: transform .22s ease; }
.tile:hover .more::after { transform: translateX(4px); }
@media (hover: none) { .card:hover, .tile:hover, .btn:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .card, .tile, .btn { transition: none; }
  .card:hover, .tile:hover, .btn:hover { transform: none; box-shadow: var(--card-shadow); }
}

/* ---------- образец документа ---------- */
.doc-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.doc-mock { background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; font-size: 14px; }
.doc-mock-title { margin: 0 0 4px; font-weight: 700; letter-spacing: .4px; color: var(--ink); }
.doc-mock-meta { margin: 0 0 12px; font-size: 12.5px; color: var(--accent); font-weight: 600; letter-spacing: .3px; }
.doc-fig { margin: 0; padding: 10px; background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: var(--radius); text-align: center; }
.doc-fig img { display: block; max-width: 100%; height: auto; border-radius: calc(var(--radius) - 4px); margin: 0 auto; }
.doc-fig figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.doc-mock-sub { margin: 0 0 14px; color: var(--muted); }
.doc-mock-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px dashed var(--line); }
.doc-mock-row span { color: var(--muted); }
.doc-mock-ok { color: var(--accent-2); }
@media (max-width: 680px) { .doc-demo { grid-template-columns: 1fr; } }

/* ---------- чипы популярных категорий ---------- */
.tnved-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.tnved-chip {
  padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
  color: var(--ink-2); background: var(--card-bg);
  border: 1px solid var(--line-strong); border-radius: 999px;
  transition: color .15s ease, border-color .15s ease;
}
.tnved-chip:hover { color: var(--ink); border-color: var(--accent); }
.tnved-chip:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* «Показать ещё» в выдаче ТН ВЭД */
.tnved-more {
  display: block; width: 100%; margin-top: 10px; padding: 12px 16px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--ink-2); background: var(--bg-soft);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
}
.tnved-more:hover { color: var(--ink); border-color: var(--accent); }
.tnved-more:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* разделитель и бейдж группы в выдаче ТН ВЭД */
.tnved-sep {
  margin: 14px 0 6px; padding: 8px 0 0; border-top: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted); list-style: none;
}
.tnved-group {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
}

/* подкатегории над выдачей ТН ВЭД */
.tnved-subcats {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 12px 0 4px; padding: 10px 12px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.tnved-subcat-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }

/* каталог товарных страниц в разделе статей */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 8px; }
.product-cat { background: var(--card-bg); border: var(--card-border); border-radius: var(--radius); padding: 14px 16px; }
.product-cat h3 { margin: 0 0 8px; font-size: 15px; }
.product-cat ul.plain { margin: 0; font-size: 14px; }
.product-cat ul.plain li { margin-bottom: 6px; }

/* обложка товарной страницы */
.product-hero-img { margin-bottom: 18px; border-radius: var(--radius); overflow: hidden; }
.product-hero-img img { width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* список городов на хабовой странице регионов */
.region-grid ul.plain { columns: 2; gap: 24px; }
@media (max-width: 680px) { .region-grid ul.plain { columns: 1; } }

/* ---------- фокус с клавиатуры и reduced motion ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- таблицы ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 18px; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
caption { caption-side: top; text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 8px; }

/* ---------- шаги ---------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; margin-bottom: 18px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.steps b { display: block; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 600; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 13px; font-size: 22px; color: var(--accent); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 16px; color: var(--ink-2); }

/* ---------- CTA ---------- */
.cta { background: var(--cta-bg); color: var(--cta-ink); border-radius: var(--radius); padding: 28px; }
.cta h2 { color: var(--cta-ink); margin-top: 0; }
.cta p { color: var(--cta-muted); }
.cta .btn-ghost { background: transparent; color: var(--cta-ink); border-color: rgba(255, 255, 255, .45); }
.cta .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: var(--cta-ink); }
.cta .btn-primary { background: #fff; color: var(--accent-2); }
.cta .btn-primary:hover { background: #eef3fc; color: var(--accent-2); }
.cta .small { color: var(--cta-muted); }
.cta-card { padding: 24px; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-inner h3 { margin: 0 0 6px; font-size: 20px; }
.cta-inner p { margin: 0; max-width: 560px; }
.cta-inner .btn { flex-shrink: 0; }
@media (max-width: 640px) { .cta-inner { flex-direction: column; align-items: flex-start; } .cta-inner .btn { width: 100%; } }

/* ---------- перелинковка ---------- */
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0; margin: 0; list-style: none; }
.related a { display: block; height: 100%; background: var(--card-bg); border: var(--card-border); border-radius: var(--radius-sm); padding: 14px 16px; font-weight: 600; font-size: 15px; color: var(--ink); }
.related a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.related span { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 4px; }

.notice { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 16px; border-radius: 8px; font-size: 15px; margin: 0 0 18px; }

/* ---------- подвал ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 48px; padding: 40px 0 28px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer a { color: var(--footer-strong); }
.site-footer a:hover { color: var(--footer-strong); }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--footer-strong); letter-spacing: .4px; margin-bottom: 10px; }
.footer-brand svg { width: 24px; height: 28px; }
.footer-title { font-weight: 600; color: var(--footer-strong); margin-bottom: 10px; font-size: 15px; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: 7px; }
.footer-note { font-size: 14px; color: var(--footer-ink); opacity: .8; }
.footer-legal { border-top: 1px solid var(--footer-line); margin-top: 26px; padding-top: 18px; font-size: 12.5px; color: var(--footer-muted); line-height: 1.55; }
.footer-legal p { margin: 0 0 8px; }

/* ---------- адаптив ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .card.sticky { position: static; }
  .grid, .related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: calc(var(--h1-size) - 5px); }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .header-inner { gap: 10px; }
  .header-cta { margin-left: 0; text-align: left; align-items: flex-start; }
  .header-calc { display: inline-flex; padding: 9px 14px; font-size: 14px; margin-top: 4px; }
  .header-search { order: 2; }
  .header-search form { position: fixed; left: 12px; right: 12px; top: auto; width: auto; margin-top: 6px; }
  .badges { grid-template-columns: 1fr; }
  .grid, .grid.two, .related, .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: calc(var(--h1-size) - 9px); }
  h2 { font-size: calc(var(--h2-size) - 4px); }
  .lead { font-size: 17px; }
  .section { padding: calc(var(--section-pad) - 12px) 0; }
  .cta { padding: 22px; }
}
@media print {
  .site-header, .site-footer, .cta, .btn, .topbar { display: none; }
}

/* ---------- изображения ---------- */
.figure { margin: 0 0 18px; }
.figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.instr-figure img { max-width: 680px; margin: 0 auto; }
.instr-figure { display: flex; flex-direction: column; }

.media { display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: center; }
.media img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.media-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.media-imgs img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.media-imgs img:first-child { grid-column: 1 / -1; }
.media h2 { margin-top: 0; }
.media.flip { grid-template-columns: .95fr 1.05fr; }
.media.flip img { order: 2; }

.card-cover { display: block; width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 14px; }
.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

@media (max-width: 860px) {
  .media, .media.flip { grid-template-columns: 1fr; }
  .media.flip img { order: 0; }
}

/* ---------- макеты документов ---------- */
.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0 0 8px; }
.doc {
  position: relative; background: #fff; color: #1a1a1a;
  border: 1px solid #d8d8d8; border-radius: 6px; padding: 18px 18px 44px;
  font-size: 12px; line-height: 1.45; min-height: 236px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
}
.doc-head { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: #6b6b6b; margin-bottom: 8px; }
.doc-title { font-size: 13px; font-weight: 700; letter-spacing: .02em; margin-bottom: 10px; }
.doc-row { display: flex; gap: 6px; margin-bottom: 5px; }
.doc-row > span:first-child { color: #7a7a7a; flex: 0 0 72px; }
.doc-row b, .doc-row span:last-child { color: #1a1a1a; }
.doc-line { height: 1px; background: #dcdcdc; margin: 9px 0; }
.doc-stamp {
  position: absolute; right: 12px; bottom: 14px; width: 62px; height: 62px;
  border: 2px solid #b23b3b; border-radius: 50%; color: #b23b3b; font-size: 8px;
  line-height: 1.15; display: grid; place-items: center; text-align: center;
  transform: rotate(-12deg); opacity: .8;
}
.doc-sign { margin-top: 14px; border-top: 1px solid #cfcfcf; width: 62%; padding-top: 4px; font-size: 10px; color: #7a7a7a; }

@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; }
}

/* ---------- мобильная панель действий ---------- */
.mobile-bar { display: none; }
@media (max-width: 720px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body.page-kalkulyator { padding-bottom: 0; }
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--header-bg); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .14);
  }
  .mobile-bar a {
    flex: 1; display: flex; align-items: center; justify-content: center;
    min-height: 44px; border-radius: 10px; font-weight: 700; font-size: 15px;
    text-decoration: none;
  }
  .mobile-bar-call { border: 1px solid var(--line-strong); color: var(--ink); }
  .mobile-bar-wa { border: 1px solid var(--line-strong); color: var(--ink); }
  .mobile-bar-calc { background: var(--accent); color: var(--accent-ink); }
  body.page-kalkulyator .mobile-bar { display: none; }
}

/* ---------- форма заявки на страницах услуг ---------- */
.lead-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.lead-row input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font: inherit;
}
.lead-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lead-consent { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.lead-consent input { margin-top: 2px; width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--accent); }
.lead-msg {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(229, 72, 77, .4); background: rgba(229, 72, 77, .12);
  color: var(--ink); font-size: 13.5px;
}
.lead-done {
  margin: 0; padding: 14px; border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .12);
  color: var(--ink); font-weight: 600;
}
@media (max-width: 560px) {
  .lead-row { grid-template-columns: 1fr; }
}

/* ---------- форма в карточке (партнёрские страницы) ---------- */
.form-card {
  padding: 22px 20px 20px;
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent)));
}
.form-card h2 { margin: 0 0 6px; font-size: 20px; }
.pf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-badge {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent-2, var(--accent));
  border: 1px solid var(--line-strong);
}
.form-card .small { margin: 0 0 16px; }
.pf-field { margin-bottom: 11px; }
.pf-field label {
  display: block; margin: 0 0 5px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); letter-spacing: .1px;
}
.pf-input { position: relative; }
.pf-input svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; transition: color .15s ease;
}
.pf-input input {
  width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font: inherit; box-sizing: border-box;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.pf-input input::placeholder { color: var(--muted); }
.pf-input input:hover { border-color: var(--accent); }
.pf-input input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg);
}
.pf-input:focus-within svg { color: var(--accent); }
.form-card .lead-consent { margin-top: 10px; }
.pf-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2, var(--accent)));
  box-shadow: 0 10px 24px var(--accent-soft);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.pf-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px var(--accent-soft); filter: brightness(1.05); }
.pf-submit:active { transform: translateY(0); box-shadow: 0 8px 18px var(--accent-soft); }
.pf-submit svg { transition: transform .15s ease; }
.pf-submit:hover svg { transform: translateX(3px); }

/* ---------- форма заявления на сертификацию ---------- */
.app-form { max-width: 860px; }
.app-form-h { margin: 22px 0 12px; font-size: 18px; }
.app-form-h:first-child { margin-top: 0; }
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.app-field { display: flex; flex-direction: column; gap: 5px; }
.app-field.full { grid-column: 1 / -1; }
.app-field label { font-size: 13px; color: var(--muted); }
.app-field input, .app-field textarea {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font: inherit; box-sizing: border-box;
}
.app-field textarea { resize: vertical; }
.app-field input:focus, .app-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.app-form .lead-consent { margin-top: 16px; }
.app-form .lead-msg { margin: 0 0 12px; }
@media (max-width: 560px) {
  .app-grid { grid-template-columns: 1fr; }
}

/* ---------- подбор документа на главной ---------- */
.search-input {
  width: 100%;
  height: 76px;
  padding: 0 22px;
  font: inherit;
  font-size: 20px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}
.search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-hint { margin-top: 8px; }

/* ---------- результаты поиска ТН ВЭД ---------- */
.search-results { list-style: none; margin: 16px 0 0; padding: 0; }
.search-results li { margin-bottom: 10px; }
.search-results a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-results a:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(21,72,173,.12);
  text-decoration: none;
}
.tnved-main { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.tnved-code {
  flex: 0 0 auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 3px 10px;
  white-space: nowrap;
}
.tnved-name { color: var(--ink); font-size: 15.5px; line-height: 1.45; }
.tnved-name small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tnved-empty {
  margin: 16px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.tnved-empty p { margin: 0 0 12px; }
.tnved-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.tnved-go:hover { color: var(--accent-2); }
.tnved-go::after { content: "→"; }
.tnved-doc { display: block; margin: 4px 0 0; font-size: 13px; color: var(--accent-2); }
.tnved-alias { color: var(--muted); }
@media (max-width: 680px) {
  .search-results a { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tnved-main { flex-direction: column; gap: 6px; }
  .tnved-go::after { content: ""; }
  .tnved-go { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 8px; }
}
.picker { display: grid; gap: 16px; }
.picker-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.picker label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.picker select {
  width: 100%; height: 46px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--card-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer;
}
.picker select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.picker .btn { height: 46px; }
.picker-result { padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-soft); }
.picker-result h3 { margin: 0 0 6px; font-size: 18px; }
.picker-result p { margin: 0 0 10px; }
.picker-result p:last-child { margin-bottom: 0; }
@media (max-width: 680px) {
  .picker-row { grid-template-columns: 1fr; }
  .picker .btn { width: 100%; }
}

/* ---------- контекстный блок в статьях ---------- */
.article-cta {
  margin: 26px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.article-cta h3 { margin: 0 0 8px; font-size: 19px; }
.article-cta p { margin: 0 0 14px; }
@media (max-width: 560px) {
  .article-cta { padding: 16px 16px; }
  .article-cta .btn { width: 100%; }
  .article-cta .btn + .btn { margin-top: 8px; }
}

/* ---------- автор материала ---------- */
.author-box { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
.author-avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 15px; }
.author-name { font-weight: 700; margin-bottom: 4px; }
@media (max-width: 560px) { .author-box { padding: 14px 16px; } }

/* ---------- подпись автора в статьях ---------- */
.article-byline {
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
  max-width: 760px;
}
.article-byline a { color: var(--accent); }
