/* MZD.BY shared styles — header, footer, modal, catalog, product pages */

:root {
  --orange: #F19000;
  --orange-hover: #D87E00;
  --orange-soft: #FFF3E0;
  --ink: #14171A;
  --ink-2: #2A2F36;
  --muted: #6B7280;
  --line: #E6E8EB;
  --line-soft: #EFEDE8;
  --bg: #FFFFFF;
  --bg-soft: #FAF8F4;
  --bg-grey: #F2EFEA;

  --meat: #9A2A2A;
  --poultry: #B96B2A;
  --fish: #1E3A52;
  --veg: #3F7A3A;
  --pack: #5A3E7C;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; width: 100%; }
@media (max-width: 900px){ .wrap { padding: 0 24px; } }
@media (max-width: 640px){ .wrap { padding: 0 16px; } }

/* Body bottom padding to clear mobile bottom nav */
@media (max-width: 900px) { body { padding-bottom: 72px; } }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 14.5px;
  padding: 14px 22px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s, transform .15s, box-shadow .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 22px -10px rgba(241,144,0,.55);
}
.btn-primary:hover { background: var(--orange-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-lg { padding: 18px 28px; font-size: 15.5px; }
.btn-block { width: 100%; }

/* ============ Header ============ */
.header {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 50;
}
.header-row { display: flex; align-items: center; gap: 22px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
  text-decoration: none; color: inherit;
}
.brand-mark {
  width: 44px; height: 44px;
  background: var(--orange);
  display: grid; place-items: center;
  color: #fff;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-name {
  font-weight: 800; font-size: 20px; letter-spacing: 0.5px;
  color: var(--ink);
}
.brand-tag {
  font-size: 12.5px; line-height: 1.35;
  color: var(--muted);
  max-width: 180px;
  border-left: 1px solid var(--line);
  padding-left: 16px; margin-left: -12px;
}
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink-2); text-decoration: none;
  font-size: 14.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.nav a:hover { color: var(--orange); }
.nav a.active { color: var(--ink); border-bottom-color: var(--orange); }
.nav .caret { width: 10px; height: 10px; opacity: .55; }
.phone { text-align: right; flex-shrink: 0; white-space: nowrap; }
.phone-num { font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; display: block; }
.phone-hrs { font-size: 12px; color: var(--muted); margin-top: 2px; }
.header-phone-mobile {
  display: none;
}
.burger {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer;
  align-items: center; justify-content: center;
}
.burger svg { width: 20px; height: 20px; }

/* ============ Breadcrumbs ============ */
.crumbs {
  padding-top: 22px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.crumbs a { color: var(--muted); text-decoration: none; transition: color .15s; }
.crumbs a:hover { color: var(--ink); }
.crumbs li:not(:last-child)::after { content: "/"; opacity: .5; margin-left: 8px; }
.crumbs li:last-child { color: var(--ink-2); }

/* ============ Page header ============ */
.page-head {
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--line-soft);
}
.page-head h1 {
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -1.2px;
  font-weight: 800;
  margin: 0 0 16px;
  text-wrap: balance;
  color: var(--ink);
}
.page-head p.lead {
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 720px;
  margin: 0;
}
.page-head .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag {
  background: var(--bg-grey);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  font-family: 'JetBrains Mono', monospace;
}
.tag-orange { background: var(--orange-soft); color: var(--orange); }

/* ============ Section shell ============ */
.section { padding: 80px 0; }
.section-tight { padding: 56px 0; }
.section-soft { background: var(--bg-soft); }
.section-grey { background: var(--bg-grey); }
.section-dark { background: var(--ink); color: #fff; }
.section-head { max-width: 760px; margin: 0 0 36px; }
.section-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}
h2.section-title {
  font-size: 36px; line-height: 1.1;
  letter-spacing: -1px; font-weight: 800;
  margin: 0 0 14px;
  text-wrap: balance;
  color: var(--ink);
}
.section-dark h2.section-title { color: #fff; }
.section-sub {
  font-size: 16px; line-height: 1.55;
  color: var(--muted);
  margin: 0; max-width: 720px;
}
h3.card-title {
  font-size: 18px; font-weight: 700;
  line-height: 1.25; letter-spacing: -0.2px;
  margin: 0 0 8px;
  color: var(--ink);
}

/* ============ Catalog layout (product / category pages) ============ */
.cat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 48px;
  padding-top: 24px;
  padding-bottom: 80px;
}
.cat-side {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  align-self: start;
  padding-right: 8px;
}
.cat-side::-webkit-scrollbar { width: 6px; }
.cat-side::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.cat-side h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  padding: 0 4px;
}
.cat-tree { list-style: none; padding: 0; margin: 0; }
.cat-tree > li { margin-bottom: 4px; }
.cat-tree .cat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer;
  border-radius: 8px;
  font-weight: 600; font-size: 14px;
  color: var(--ink);
  user-select: none;
  transition: background .15s;
}
.cat-tree .cat-head:hover { background: var(--bg-soft); }
.cat-tree .cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-right: 10px; flex-shrink: 0;
}
.cat-tree li[data-cat="meat"] .cat-dot { background: var(--meat); }
.cat-tree li[data-cat="poultry"] .cat-dot { background: var(--poultry); }
.cat-tree li[data-cat="fish"] .cat-dot { background: var(--fish); }
.cat-tree li[data-cat="veg"] .cat-dot { background: var(--veg); }
.cat-tree li[data-cat="pack"] .cat-dot { background: var(--pack); }
.cat-tree li[data-cat="oborudovanie-dlya-pererabotki-myasa"] .cat-dot { background: var(--meat); }
.cat-tree li[data-cat="oborudovanie-dlya-pererabotki-pticy"] .cat-dot { background: var(--poultry); }
.cat-tree li[data-cat="oborudovanie-dlya-pererabotki-ryby"] .cat-dot { background: var(--fish); }
.cat-tree li[data-cat="oborudovanie-dlya-pererabotki-ovoshchej"] .cat-dot { background: var(--veg); }
.cat-tree li[data-cat="obshchetsekhovoe-i-vspomogatelnoe-oborudovanie"] .cat-dot { background: var(--pack); }
.cat-head .chev {
  width: 14px; height: 14px;
  transition: transform .2s;
  color: var(--muted);
}
.cat-sub-head .chev,
.cat-tree-l3-head .chev,
.cat-tree-l4-head .chev {
  width: 12px; height: 12px;
  transition: transform .2s;
  color: var(--muted);
}
.cat-tree li.open > .cat-head .chev { transform: rotate(90deg); }
.cat-sub > li.open > .cat-sub-head .chev,
.cat-tree-l3 > li.open > .cat-tree-l3-head .chev,
.cat-tree-l4 > li.open > .cat-tree-l4-head .chev { transform: rotate(90deg); }
.cat-sub {
  list-style: none; padding: 4px 0 8px 18px;
  margin: 0;
  display: none;
  border-left: 1px solid var(--line);
  margin-left: 16px;
}
.cat-tree li.open > .cat-sub { display: block; }
.cat-sub > li { margin-bottom: 2px; }
.cat-sub-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; cursor: pointer;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
}
.cat-sub-head:hover { background: var(--bg-soft); color: var(--ink); }
.cat-sub-items {
  list-style: none; padding: 2px 0 6px 12px;
  margin: 0;
  display: none;
}
.cat-sub > li.open .cat-sub-items { display: block; }
.cat-sub > li.open > .cat-sub-head { color: var(--ink); }
.cat-sub-items a {
  display: block;
  padding: 6px 10px;
  font-size: 12.5px; line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color .15s, background .15s, border-color .15s;
}
.cat-sub-items a:hover { color: var(--ink); background: var(--bg-soft); }
.cat-sub-items a.active {
  color: var(--ink); font-weight: 600;
  background: var(--orange-soft);
  border-left-color: var(--orange);
}
.cat-side-counts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-grey);
  padding: 2px 6px;
  border-radius: 4px;
}
.cat-mobile-toggle {
  display: none;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  align-items: center;
  justify-content: space-between;
}

/* ============ Product detail ============ */
.prod-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  padding: 8px 0 16px;
}
.prod-gallery {
  background: var(--bg-grey);
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
}
.prod-gallery::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(20,23,26,0.03) 0 6px, transparent 6px 14px);
}
.prod-gallery svg {
  position: relative;
  width: 28%; height: 28%;
  color: var(--ink-2); opacity: .35;
  stroke: currentColor; stroke-width: 1; fill: none;
}
.prod-gallery-label {
  position: absolute;
  bottom: 16px; left: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-2); opacity: .55;
  padding: 4px 8px;
  background: rgba(255,255,255,0.6);
  border-radius: 4px;
}
.prod-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.prod-thumb {
  width: 80px; aspect-ratio: 1;
  background: #fff;
  border-radius: 8px;
  border: 2px solid var(--line);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s;
}
.prod-thumb.active { border-color: var(--orange); }
.prod-thumb:hover:not(.active) { border-color: #bbb; }
.prod-info h1 {
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -0.8px;
  margin: 0 0 16px;
  font-weight: 800;
  color: var(--ink);
  text-wrap: balance;
}
.prod-info .lead {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 24px;
}
.prod-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.prod-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.prod-meta {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.prod-meta-item {
  font-size: 13px;
  color: var(--muted);
}
.prod-meta-item .v { color: var(--ink); font-weight: 600; font-size: 14px; }

/* ============ Spec table / lists ============ */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table td {
  padding: 12px 16px;
  vertical-align: top;
}
.spec-table td:first-child { color: var(--muted); width: 38%; }
.spec-table td:last-child { color: var(--ink); }

.bullet-list { padding: 0; margin: 0; list-style: none; }
.bullet-list li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}
.bullet-list li:last-child { border-bottom: 0; }
.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 17px;
  width: 12px; height: 2px;
  background: var(--orange);
}

/* ============ Equipment grid (catalog cards) ============ */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.eq-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.eq-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .2s, box-shadow .2s;
}
.eq-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -22px rgba(20,23,26,.2);
}
.eq-photo {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: var(--bg-grey);
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.eq-photo::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(20,23,26,0.04) 0 6px, transparent 6px 14px);
}
.eq-photo svg {
  position: relative;
  width: 40%; height: 40%;
  color: var(--ink-2); opacity: .35;
  stroke: currentColor; stroke-width: 1; fill: none;
}
.eq-photo-tag {
  position: absolute;
  top: 8px; left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: rgba(255,255,255,0.8);
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--ink-2);
}
.eq-name {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.eq-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.eq-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.eq-tag {
  font-size: 11px;
  background: var(--bg-grey);
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--ink-2);
}
.eq-actions {
  display: flex; gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.link-arrow {
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .15s;
}
.link-arrow:hover { color: var(--orange); }
.link-arrow svg { width: 12px; height: 12px; }
.link-secondary {
  background: none; border: 0; cursor: pointer;
  padding: 0;
  color: var(--orange);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.link-secondary:hover { border-bottom-color: var(--orange); }

/* ============ Category page — group cards ============ */
.cat-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 18px;
}
.cat-group-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.cat-group-head h2 {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
  color: var(--ink);
}
.cat-group-head p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0; max-width: 540px; }
.cat-group-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-grey);
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}
.cat-group-list {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}
.cat-group-list li {
  border-bottom: 1px solid var(--line-soft);
}
.cat-group-list li:last-child, .cat-group-list li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.cat-group-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .15s;
  gap: 12px;
}
.cat-group-list a:hover { color: var(--orange); }
.cat-group-list a svg { width: 14px; height: 14px; opacity: .5; flex-shrink: 0; }

/* ============ Filters ============ */
.filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-right: 8px;
}
.filter-chip {
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--line); background: #fff; }
.filter-chip.active { background: var(--ink); color: #fff; }

/* ============ Product Video ============ */
.prod-video { padding: 48px 0 0; max-width: 880px; }
.prod-video-title { font-size: 24px; letter-spacing: -0.4px; margin: 0 0 18px; }
.prod-video-wrap {
  position: relative; padding-bottom: 56.25%; height: 0;
  overflow: hidden; border-radius: 14px; background: #0f0f0f; cursor: pointer;
}
.prod-video-wrap img.prod-video-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 14px; display: block;
  transition: opacity .2s;
}
.prod-video-wrap:hover img.prod-video-thumb { opacity: .85; }
.prod-video-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: none; border: none; padding: 0; cursor: pointer;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.6));
  transition: transform .15s;
  z-index: 2;
}
.prod-video-wrap:hover .prod-video-play { transform: translate(-50%, -50%) scale(1.08); }
.pvp-bg { fill: rgba(20,20,20,.85); transition: fill .15s; }
.prod-video-wrap:hover .pvp-bg { fill: #ff0000; }
.pvp-arrow { fill: #fff; }
.prod-video-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: 14px;
}

/* ============ FAQ ============ */
.faq-list { max-width: 880px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-q {
  width: 100%; background: none; border: 0;
  text-align: left; padding: 20px 0;
  font-family: inherit; font-size: 16px; font-weight: 600;
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; letter-spacing: -0.2px;
}
.faq-q:hover { color: var(--orange); }
.faq-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: transform .25s, background .15s, border-color .15s, color .15s;
}
.faq-icon svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--orange); color: #fff; border-color: var(--orange); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 60px 20px 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.faq-item.open .faq-a { max-height: 500px; }

/* ============ Forms ============ */
.field { display: block; margin-bottom: 12px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); }
.field textarea { resize: vertical; min-height: 90px; }

.inline-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  max-width: 720px;
}
.inline-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.inline-form h3 {
  font-size: 22px;
  letter-spacing: -0.4px;
  margin: 0 0 6px;
}
.inline-form p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

/* ============ Modal ============ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(20,23,26,0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 18px;
  padding: 36px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.35);
  animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.modal-header h3 { margin: 0; font-size: 24px; letter-spacing: -0.5px; flex: 1; }
.modal-x {
  background: none; border: 0; cursor: pointer; padding: 6px;
  color: var(--muted); line-height: 0; flex-shrink: 0; border-radius: 6px;
  transition: color .15s, background .15s;
}
.modal-x svg { width: 24px; height: 24px; }
.modal-x:hover { color: var(--ink); background: var(--bg-soft); }
.modal > p { color: var(--muted); margin: 18px 0 22px; font-size: 14.5px; }
/* ── Form consent row: container-query adaptive layout ───────────────────────── */
/* Named container on each quote form so @container below responds to form width, not viewport */
form[data-quote-form] { container-type: inline-size; container-name: quote-form; }

/* Modal actions: always narrow — popup is always a constrained container */
.modal-actions { margin-top: 8px; }
.modal-actions .btn { width: 100%; }
.modal-actions .form-consent { margin: 30px 0 0; }
.modal .form-consent { margin: 30px 0 0; }

/* btn-consent-row default: narrow — button full-width, consent below with 30 px gap */
.btn-consent-row { margin-top: 8px; }
.btn-consent-row .btn { width: 100%; }
.btn-consent-row .form-consent { margin: 30px 0 0; }

/* btn-consent-row wide: when the form itself is ≥ 460 px wide */
@container quote-form (min-width: 460px) {
  .btn-consent-row { display: flex; align-items: flex-start; gap: 20px; }
  .btn-consent-row .btn { width: auto; flex-shrink: 0; }
  form[data-quote-form] .btn-consent-row .form-consent { flex: 1; min-width: 0; margin: 0; }
}
.form-consent { font-size: 12px; color: var(--muted); margin: 30px 0 0; line-height: 1.5; }
/* Override .inline-form p generic rule (specificity 0,1,1) for consent text */
.inline-form .form-consent { margin: 30px 0 0; font-size: 12px; }
.form-consent a { color: var(--muted); text-decoration: underline; }
.form-consent a:hover { color: var(--orange); }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 14px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }

/* ============ Footer ============ */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 28px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 48px;
}
.footer h4 {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 18px;
  font-weight: 700;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; transition: color .15s; }
.footer a:hover { color: var(--orange); }
.footer-brand p { font-size: 13.5px; line-height: 1.55; margin: 12px 0 0; color: rgba(255,255,255,0.55); max-width: 280px; }
.footer-brand .brand-name { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.footer-contact { font-size: 14px; line-height: 1.6; }
.footer-contact .lead { color: #fff; font-weight: 600; font-size: 15px; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .nav { display: none; }
  .brand-tag { display: none; }
  .burger { display: flex; }
  .header .brand-name { display: none; }
  .header-phone-mobile {
    display: block;
    margin-left: auto;
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.3px;
  }
  .cat-layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .cat-side {
    position: static;
    max-height: none;
    margin-bottom: 24px;
    display: none;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .cat-side.open { display: block; }
  .cat-mobile-toggle { display: flex; margin-top: 20px; margin-bottom: 32px; }
  .eq-grid, .eq-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .prod-hero { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .page-head h1 { font-size: 36px; }
  .prod-info h1 { font-size: 28px; }
  h2.section-title { font-size: 28px; }
  .section { padding: 56px 0; }
  .cat-group-list { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .crumbs {
    padding-top: 0;
    margin-top: 18px;
    margin-bottom: 22px;
  }
  .cat-mobile-toggle {
    margin-top: 24px;
    margin-bottom: 32px;
  }
  .cat-side.open {
    margin-bottom: 32px;
  }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  /* Restore cat-layout bottom padding overridden by .wrap shorthand above */
  .cat-layout { padding-bottom: 80px; }
  .eq-grid, .eq-grid.cols-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .inline-form { padding: 22px; }
  .inline-form .row { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 28px; }
  .prod-info h1 { font-size: 24px; }
  .phone { display: none; }
}


/* ============ Mega menu (Каталог) ============ */
.nav .has-mega { position: relative; }
.mega-menu {
  position: fixed;
  left: 0; right: 0;
  top: var(--mega-top, 92px);
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 40px -28px rgba(0,0,0,.18);
  z-index: 49;
  display: none;
  padding: 28px 0 32px;
}
/* Invisible bridge above the panel so cursor can bridge the gap from the trigger */
.mega-menu::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -16px;
  height: 16px;
}
.mega-menu.open { display: block; }
.mega-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
}
.mega-col h5 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.mega-col h5 .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mega-col h5 a { color: inherit; text-decoration: none; }
.mega-col h5 a:hover { color: var(--orange); }
.mega-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.mega-col li a {
  display: block;
  padding: 5px 0;
  font-size: 13px; line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .15s;
}
.mega-col li a:hover { color: var(--orange); }
.mega-col .empty { font-size: 12.5px; color: var(--muted); font-style: italic; padding: 4px 0; }

/* ============ Mobile bottom nav ============ */
.mobile-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 60;
  box-shadow: 0 -6px 24px -16px rgba(0,0,0,.18);
  padding: 6px 4px 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
}
.mobile-bar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  max-width: 520px;
  margin: 0 auto;
}
.mobile-bar a, .mobile-bar button {
  background: none; border: 0; cursor: pointer;
  text-decoration: none;
  color: var(--ink-2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 11px; line-height: 1.1;
  font-weight: 600;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.mobile-bar a:hover, .mobile-bar button:hover { background: var(--bg-soft); }
.mobile-bar .mb-ic {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.mobile-bar .mb-ic svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mobile-bar a.active, .mobile-bar button.active { color: var(--orange); }
.mobile-bar a.active .mb-ic, .mobile-bar button.active .mb-ic { color: var(--orange); }
.mobile-bar .mb-cta {
  background: var(--orange);
  color: #fff;
}
.mobile-bar .mb-cta .mb-ic, .mobile-bar .mb-cta:hover { color: #fff; background: var(--orange); }
.mobile-bar .mb-cta:hover { background: var(--orange-hover); }
@media (max-width: 900px) {
  .mobile-bar { display: block; }
}

/* ============ Sidebar 4-level tree (refined) ============ */
.cat-tree-l3 {
  list-style: none;
  padding: 4px 0 4px 12px;
  margin: 2px 0 2px 4px;
  border-left: 1px solid var(--line);
  display: none;
}
.cat-sub > li.open > .cat-tree-l3 { display: block; }
.cat-tree-l3 > li.open .cat-tree-l3-items { display: block; }
.cat-tree-l3 > li > .cat-tree-l3-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  gap: 8px;
}
.cat-tree-l3 > li > .cat-tree-l3-head:hover { background: var(--bg-soft); color: var(--ink); }
.cat-tree-l3 > li > .cat-tree-l3-head a,
.cat-tree-l3 > li > .cat-tree-l3-head .cat-label {
  flex: 1; min-width: 0;
  text-decoration: none; color: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.cat-tree-l3-items {
  list-style: none; margin: 0; padding: 2px 0 6px 10px;
  display: none;
}
.cat-tree-l3-items a {
  display: block;
  padding: 5px 8px;
  font-size: 12px; line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color .15s, background .15s, border-color .15s;
}
.cat-tree-l3-items a:hover { color: var(--ink); background: var(--bg-soft); }
.cat-tree-l3-items a.active {
  color: var(--ink); font-weight: 600;
  background: var(--orange-soft);
  border-left-color: var(--orange);
}
/* ============ Sidebar L4 — type level ============ */
.cat-tree-l4 {
  list-style: none;
  padding: 2px 0 2px 10px;
  margin: 1px 0 1px 4px;
  border-left: 1px solid var(--line);
  display: none;
}
.cat-tree-l3 > li.open > .cat-tree-l4 { display: block; }
/* Level-5 nesting: cat-tree-l4 inside open cat-tree-l4 item */
.cat-tree-l4 > li.open > .cat-tree-l4 { display: block; }
.cat-tree-l4 > li.open .cat-tree-l4-items { display: block; }
.cat-tree-l4 > li > .cat-tree-l4-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  gap: 6px;
}
.cat-tree-l4 > li > .cat-tree-l4-head:hover { background: var(--bg-soft); color: var(--ink); }
.cat-tree-l4 > li > .cat-tree-l4-head a,
.cat-tree-l4 > li > .cat-tree-l4-head .cat-label {
  flex: 1; min-width: 0;
  text-decoration: none; color: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.cat-tree-l4-items {
  list-style: none; margin: 0; padding: 1px 0 4px 8px;
  display: none;
}
.cat-tree-l4-items a {
  display: block;
  padding: 4px 8px;
  font-size: 11.5px; line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color .15s, background .15s, border-color .15s;
}
.cat-tree-l4-items a:hover { color: var(--ink); background: var(--bg-soft); }
.cat-tree-l4-items a.active {
  color: var(--ink); font-weight: 600;
  background: var(--orange-soft);
  border-left-color: var(--orange);
}

/* pcat header text styling — production-category level */
.cat-tree .pcat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  gap: 8px;
}
.cat-tree .pcat-head:hover { background: var(--bg-soft); }
.cat-tree .pcat-head > a,
.cat-tree .pcat-head > .cat-label {
  flex: 1; min-width: 0;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.cat-tree .pcat-head:hover > a,
.cat-tree .pcat-head:hover > .cat-label { color: var(--ink); }

/* ============ Direction hero card ============ */
.dir-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.dir-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -22px rgba(20,23,26,.2);
}
.dir-card .dir-ic {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.dir-card .dir-ic svg { width: 32px; height: 32px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.dir-card h3 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.3px; line-height: 1.2; }
.dir-card .dir-meta { font-size: 13px; color: var(--muted); margin: 0 0 16px; line-height: 1.4; }
.dir-card .dir-arrow { font-size: 13.5px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.dir-card.disabled { opacity: .55; pointer-events: none; }
.dir-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 1100px) { .dir-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .dir-grid { grid-template-columns: 1fr; } }

/* ============ pcat card (category page) ============ */
.pcat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .2s, box-shadow .2s;
}
.pcat-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -22px rgba(20,23,26,.2);
}
.pcat-card h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -0.3px; line-height: 1.25; }
.pcat-card p.desc { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin: 0 0 16px; }
.pcat-card ul { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 2px; }
.pcat-card ul li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .15s, color .15s;
  gap: 10px;
}
.pcat-card ul li a:hover { background: var(--bg-soft); color: var(--ink); }
.pcat-card ul li a .ct { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.pcat-card .pcat-cta {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.pcat-card .pcat-cta:hover { color: var(--orange); }
.pcat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 1100px) { .pcat-grid { grid-template-columns: 1fr; } }

/* ============ Section header consistency ============ */
.sec-h2 { font-size: 24px; letter-spacing: -0.4px; margin: 0 0 20px; font-weight: 800; color: var(--ink); }

/* ============ Header tweak: hide phone earlier ============ */
@media (max-width: 1280px) { .phone { display: none; } }
@media (max-width: 1100px) { .mega-menu { display: none !important; } }


/* ============================================================
   MOBILE / RESPONSIVE — unified breakpoints
   desktop  ≥ 1101px
   tablet   641–1100px
   mobile   ≤ 640px
   small    ≤ 390px
   ============================================================ */

/* horizontal overflow safety net */
html, body { max-width: 100%; overflow-x: hidden; }

/* === Mobile nav dropdown (open by burger) === */
@media (max-width: 1100px) {
  .header { padding: 14px 0; }
  /* Hide header CTA on tablet/mobile — заявка живёт в нижнем баре */
  .header .btn-primary { display: none; }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 16px; right: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 40px -22px rgba(0,0,0,.18);
    padding: 10px;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    z-index: 60;
  }
  .nav.open { display: flex; }
  .nav a {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border-bottom: 0;
    font-size: 15px;
  }
  .nav a:hover { background: var(--bg-soft); color: var(--ink); }
  .nav a.active { background: var(--orange-soft); color: var(--ink); border-bottom: 0; }
  .header { position: relative; }
  .header.sticky-mobile { position: sticky; top: 0; }
}

/* === Sticky-catalog sidebar — compact mobile dropdown === */
@media (max-width: 1100px) {
  .cat-side {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cat-tree li.open > .cat-sub { max-height: none; }
}

/* === Forms — single column on mobile === */
@media (max-width: 640px) {
  .inline-form .row,
  .modal form > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* === Modal — fit mobile === */
@media (max-width: 640px) {
  .modal-bg { padding: 12px; align-items: flex-start; padding-top: 24px; }
  .modal {
    padding: 22px;
    max-height: calc(100vh - 96px - env(safe-area-inset-bottom, 0));
    overflow-y: auto;
  }
  .modal-header h3 { font-size: 20px; }
}

/* === Product page hero / meta / specs === */
@media (max-width: 1100px) {
  .prod-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .prod-meta { grid-template-columns: 1fr; gap: 12px; }
  .prod-cta { flex-direction: column; align-items: stretch; }
  .prod-cta .btn { width: 100%; }
  .prod-tags { margin-bottom: 16px; }

  /* Thumbnails row — prevent overflow on mobile with many photos */
  .prod-thumbs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prod-thumb { width: 60px; flex-shrink: 0; }

  /* Spec table — stack rows as blocks */
  .spec-table, .spec-table tbody, .spec-table tr, .spec-table td { display: block; width: 100%; }
  .spec-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .spec-table tr:last-child { border-bottom: 0; }
  .spec-table td { padding: 0; }
  .spec-table td:first-child {
    width: auto;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .spec-table td:last-child { font-size: 14.5px; font-weight: 500; color: var(--ink); }
}

/* === Grids universal — collapse safely === */
@media (max-width: 1100px) {
  .eq-grid, .eq-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .pcat-grid { grid-template-columns: 1fr; }
  .dir-grid  { grid-template-columns: repeat(2, 1fr); }
  .cat-group-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .eq-grid, .eq-grid.cols-4 { grid-template-columns: 1fr; }
  .dir-grid  { grid-template-columns: 1fr; }
  /* Any 2-col / 3-col section grids should fall back to 1 col on small mobile */
  main section[style*="grid-template-columns"]:not([style*="repeat(auto"]) {
    grid-template-columns: 1fr !important;
  }
  /* Same for inline-style direct-children grids (category sub-sections) */
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns:1.1fr 1fr"],
  div[style*="grid-template-columns: 1.1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* === Buttons go full-width inside mobile CTA contexts === */
@media (max-width: 640px) {
  .page-head .btn-lg,
  main .btn-lg,
  section .btn-lg { width: 100%; }
  .btn { white-space: normal; text-align: center; }
}

/* === Filters / chips wrap nicely === */
@media (max-width: 640px) {
  .filters { padding: 14px 16px; gap: 6px; }
  .filter-chip { font-size: 12.5px; padding: 5px 12px; }
}

/* === Page head sizing === */
@media (max-width: 640px) {
  .page-head { padding: 24px 0 28px; }
  .page-head h1 { font-size: 26px; line-height: 1.1; }
  .page-head .lead { font-size: 14.5px; }
  h2.section-title { font-size: 24px; }
  .sec-h2 { font-size: 20px; }
  .crumbs { font-size: 12px; }
}

/* === Sidebar treeitem text wrap, not ellipsis on mobile === */
@media (max-width: 1100px) {
  .cat-sub-items a, .cat-tree-l3-items a, .cat-tree-l4-items a {
    white-space: normal;
    line-height: 1.35;
  }
}

/* === Hide header phone earlier on tablets === */
@media (max-width: 1100px) { .phone { display: none; } }

/* === Body safe-padding for bottom nav === */
@media (max-width: 900px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0)); }
}

/* small-mobile micro polish */
@media (max-width: 390px) {
  .wrap { padding: 0 14px; }
  /* Restore cat-layout bottom padding after wrap shorthand resets it */
  .cat-layout { padding-bottom: 80px; }
  .page-head h1 { font-size: 23px; }
  .brand-name { font-size: 17px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-mark svg { width: 22px; height: 22px; }
}


/* ============ IMAGE SYSTEM (added by processor) ============ */
.prod-main-img,
.eq-photo img,
.product-card img,
.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
}

.prod-gallery,
.eq-photo {
  background: #F5F4F1;
  overflow: hidden;
}

.prod-gallery img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.prod-gallery.has-image::before,
.eq-photo.has-image::before {
  display: none;
}

.prod-gallery.has-image svg,
.prod-gallery.has-image .prod-gallery-label,
.eq-photo.has-image svg,
.eq-photo.has-image .eq-photo-tag {
  display: none;
}

.prod-thumbs img,
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============ MEDIA FRAME SYSTEM ============ */
.media-frame {
  display: block;
  overflow: hidden;
  position: relative;
  background: var(--bg-grey, #F5F4F1);
}
.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.media-frame--contain img { object-fit: contain; }
.media-frame--cover   img { object-fit: cover; }
.media-frame--hero {
  aspect-ratio: 16 / 5;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 28px;
}
.media-frame--card {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
}
.media-frame--logo {
  aspect-ratio: 279 / 147;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.media-frame--product {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #F5F4F1;
}
.media-frame--gallery {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #F5F4F1;
}
.media-frame--product img,
.media-frame--gallery img { object-fit: contain; }

/* page-head hero image block */
.page-head-img {
  aspect-ratio: 16 / 5;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 28px;
  position: relative;
  background: #ECEEF0;
}
.page-head-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

/* hero-image real photo overlay */
.hero-image img.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.hero-image .hero-image-label { z-index: 3; position: relative; }

/* proj-img with real photo */
.proj-img img.proj-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.proj-img .proj-img-label { position: relative; z-index: 2; }

/* ============ PRODUCT DESCRIPTION STRUCTURE ============ */
.prod-desc-heading {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  margin: 28px 0 10px;
}
.prod-desc-heading:first-child { margin-top: 0; }
.prod-desc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prod-desc-list li {
  padding-left: 18px;
  position: relative;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.prod-desc-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-weight: 400;
}
.prod-desc-section p {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.prod-desc-section p:last-child { margin-bottom: 0; }

/* ============ Catalog browser — active sidebar links ============ */
.cat-sub-head a.active,
.cat-tree-l3-head a.active,
.cat-tree-l4-head a.active {
  color: var(--orange);
  font-weight: 700;
}
.cat-sub-head a,
.cat-tree-l3-head a,
.cat-tree-l4-head a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color .15s;
  flex: 1;
  min-width: 0;
}
.cat-sub-head a:hover,
.cat-tree-l3-head a:hover,
.cat-tree-l4-head a:hover { color: var(--orange); }

/* ============ Category pages popup (modal-overlay / modal-box) ============ */
/* .modal-bg is used on index/catalog/about/contacts — .modal-overlay on 5 category pages */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,23,26,0.55);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.35);
  position: relative;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}
.modal-close:hover { color: var(--ink); }
@media (max-width: 640px) {
  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  }
  .modal-box {
    padding: 24px;
    border-radius: 16px 16px 12px 12px;
    max-height: calc(100vh - 80px - env(safe-area-inset-bottom, 0));
  }
}

/* ============ Contacts page map ============ */
.contact-map {
  width: 100%;
  height: 360px;
}
.contact-map iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
@media (max-width: 768px) {
  .contact-map {
    height: 260px;
    border-radius: 14px !important;
  }
}

/* ============ Mobile fixes: contacts, about, nav caret ============ */

/* Hide the catalog caret arrow inside the mobile dropdown nav */
@media (max-width: 1100px) {
  .nav .caret { display: none; }
}

/* Contacts page — collapse two-column main to single column */
@media (max-width: 768px) {
  .contacts-main {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .contacts-main .inline-form {
    max-width: 100%;
  }
  .contacts-main .field input,
  .contacts-main .field textarea,
  .contacts-main .field select {
    width: 100%;
    box-sizing: border-box;
  }
}

/* About page — collapse two-column main and inner cards grid */
@media (max-width: 768px) {
  .about-main {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .about-cards-grid {
    grid-template-columns: 1fr !important;
  }
  .about-cards-grid > div[style*="grid-column"] {
    grid-column: auto !important;
  }
}

/* ============ Manufacturers grid (public) ============ */
.mfr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mfr-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .2s, box-shadow .2s;
}
.mfr-card:hover {
  border-color: var(--ink); transform: translateY(-2px);
  box-shadow: 0 16px 36px -22px rgba(20,23,26,.2);
}
.mfr-card-badge {
  width: 56px; height: 56px; border-radius: 12px; color: #fff;
  display: grid; place-items: center; font-weight: 800;
  font-family: 'JetBrains Mono', monospace; font-size: 16px;
  letter-spacing: 0.5px; margin-bottom: 18px;
}
.mfr-card-name { font-size: 20px; margin: 0 0 4px; letter-spacing: -0.3px; }
.mfr-card-country { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.mfr-card-desc { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
.mfr-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.mfr-card-count { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--muted); }

/* ============ Catalog manufacturer filter ============ */
.catalog-mfr-filter {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.mfr-filter-btn {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--ink-2);
  font-family: inherit; transition: background .15s, border-color .15s, color .15s;
}
.mfr-filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.mfr-filter-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ============ Header search button ============ */
.header-search-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; color: var(--ink-2);
  text-decoration: none; transition: background .15s, color .15s; flex-shrink: 0;
}
.header-search-btn:hover { background: var(--bg-soft); color: var(--ink); }
@media (max-width: 767px) { .header-search-btn { display: none; } }

/* ============ Search page ============ */
.search-page-wrap { max-width: 780px; }
.search-page-field { position: relative; margin-bottom: 16px; }
.search-page-input {
  width: 100%; padding: 14px 18px; font-size: 16px; font-family: inherit;
  border: 2px solid var(--line); border-radius: 12px; outline: none;
  transition: border-color .15s; background: #fff; color: var(--ink);
}
.search-page-input:focus { border-color: var(--ink); }
.search-count { font-size: 13px; color: var(--muted); margin-bottom: 16px; min-height: 18px; }
.search-results { display: flex; flex-direction: column; gap: 1px; }
.search-result {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line-soft);
  text-decoration: none; color: inherit; transition: background .1s;
}
.search-result:hover .search-result-name { color: var(--orange); }
.search-result-img { width: 72px; height: 54px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--bg-soft); }
.search-result-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-name { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 3px; transition: color .15s; }
.search-result-mfr { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.search-result-desc { font-size: 13px; color: var(--muted); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { color: var(--muted); font-size: 15px; padding: 24px 0; }

@media (max-width: 767px) {
  .mfr-grid { grid-template-columns: 1fr; }
  .catalog-mfr-filter { gap: 6px; }
  .mfr-filter-btn { font-size: 12px; padding: 5px 11px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .mfr-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Footer newsletter subscription ──────────────────────────── */
.footer-sub { margin-top: 30px; }
.footer-sub .footer-sub-label { font-size: 12.5px; color: rgba(255,255,255,0.55); margin: 0 0 10px; line-height: 1.5; }
.footer-sub-row { display: flex; gap: 8px; }
.footer-sub-input { width: 140px; flex-shrink: 0; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 9px 12px; font-size: 13px; color: #fff; outline: none; }
.footer-sub-input::placeholder { color: rgba(255,255,255,0.4); }
.footer-sub-input:focus { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.12); }
.footer-sub-btn { background: var(--orange); color: #fff; border: none; border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; }
.footer-sub-btn:hover { background: var(--orange-hover,#d97706); }

/* ============ Read / article pages ============ */
.read-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.read-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .2s; text-decoration: none; color: inherit; }
.read-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.read-card-img { background: #ECEEF0; aspect-ratio: 16/9; position: relative; overflow: hidden; }
.read-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.read-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.read-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.read-tag, .art-tag { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--orange); background: rgba(241,144,0,.08); border-radius: 4px; padding: 2px 7px; }
.read-date, .art-date { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted); letter-spacing: .3px; }
.read-card-title { font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -.2px; color: var(--ink); margin: 0 0 8px; }
.read-card-desc { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 0 16px; flex: 1; }
.read-cat-tag, .art-cat { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg-soft); border-radius: 6px; padding: 3px 8px; }
.read-cat-tag { margin-bottom: 10px; align-self: flex-start; }
.article-wrap { max-width: 760px; margin: 0 auto; padding: 0 0 80px; }
.article-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.article-hero-img { width: 100%; aspect-ratio: 16/7; background: #ECEEF0; border-radius: 16px; overflow: hidden; position: relative; margin: 28px 0 36px; }
.article-hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article-body h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; color: var(--ink); margin: 40px 0 14px; }
.article-body p { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 18px; }
.article-body ul { margin: 0 0 18px; padding-left: 0; list-style: none; }
.article-body ul li { font-size: 16px; line-height: 1.65; color: var(--ink-2); padding-left: 22px; position: relative; margin-bottom: 8px; }
.article-body ul li::before { content: "—"; position: absolute; left: 0; color: var(--muted); font-weight: 400; }
.article-links { background: var(--bg-soft); border-radius: 16px; padding: 28px 32px; margin: 40px 0; }
.article-links h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 14px; letter-spacing: -.1px; }
.article-links ul { margin: 0; padding: 0; list-style: none; }
.article-links ul li { margin-bottom: 8px; }
.article-links ul li::before { display: none; }
.article-links a { font-size: 14.5px; color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.article-links a:hover { color: var(--orange); }
.article-cta { background: var(--ink); color: #fff; border-radius: 16px; padding: 36px 40px; text-align: center; margin-top: 48px; }
.article-cta h3 { font-size: 22px; font-weight: 800; margin: 0 0 10px; color: #fff; }
.article-cta p { font-size: 15px; color: rgba(255,255,255,.65); margin: 0 0 22px; }
.cat-label.active { color: var(--orange); font-weight: 700; }
@media (max-width: 900px) { .read-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .read-grid { grid-template-columns: 1fr; } }
