:root {
  --color-primary: #41494b;
  --color-primary-dark: #273032;
  --color-accent: #164196;
  --color-accent-hover: #12377f;
  --color-bg: #edf1f6;
  --color-white: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius: 6px;
  --radius-lg: 10px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-width: 1280px;
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  overflow-x: hidden;
  max-width: 100vw;
  background:
    linear-gradient(90deg, rgba(22,65,150,.045) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, rgba(22,65,150,.045) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Top bar ── */
.top-bar {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.85);
  font-size: .8125rem;
  padding: 6px 0;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-bar a { color: rgba(255,255,255,.9); }
.top-bar a:hover { color: var(--color-accent); }

/* ── Header ── */
.header {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
}

.header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
}

.logo-icon.logo-image {
  width: auto;
  height: 42px;
  background: transparent;
  border-radius: 0;
}

.logo-icon.logo-image img {
  width: auto;
  height: 100%;
  display: block;
}

.logo-text { line-height: 1.2; }
.logo-text strong { display: block; font-size: 1.25rem; color: var(--color-primary); }
.logo-text span { font-size: .75rem; color: var(--color-text-muted); }

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--color-text);
  transition: background .15s, color .15s;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .8rem;
}

.nav a:hover, .nav a.active {
  background: var(--color-bg);
  color: var(--color-primary);
}

.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 2px solid var(--color-border);
  border-radius: 24px;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s;
}

.header-search input:focus { border-color: var(--color-primary); }

.header-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  width: 18px;
  height: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-phone {
  font-weight: 600;
  color: var(--color-primary);
  font-size: .9375rem;
  white-space: nowrap;
}

.header-phone small {
  display: block;
  font-weight: 400;
  font-size: .75rem;
  color: var(--color-text-muted);
}

.btn-cart {
  position: relative;
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}

.btn-cart:hover { background: var(--color-accent-hover); }

.cart-count {
  background: var(--color-primary);
  color: white;
  font-size: .7rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  color: var(--color-primary);
}

/* ── Hero ── */
.hero {
  background-color: #1d3146;
  background-image: linear-gradient(135deg, #1d3146 0%, #233b55 70%, #294563 100%);
  background-size: cover;
  background-position: center;
  color: white;
  padding: 60px 0;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero::after {
  content: '';
  position: absolute;
  right: -10%; /* Используем проценты вместо жестких пикселей */
  top: -10%;
  width: 50vw; /* Используем vw, чтобы круг уменьшался на мобильных */
  height: 50vw;
  max-width: 400px;
  max-height: 400px;
  border-radius: 50%;
  background: rgba(184,135,70,.16);
  pointer-events: none; /* Чтобы круг не перекрывал клики */
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.hero p {
  font-size: 1.05rem;
  opacity: .9;
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
}

.hero-stat strong {
  display: block;
  font-size: 1.75rem;
  color: var(--color-accent);
}

.hero-stat span { font-size: .875rem; opacity: .8; }

.hero-brands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.brand-tag {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
}

.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.hero-card .icon { font-size: 2rem; margin-bottom: 8px; }
.hero-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.hero-card strong { display: block; font-size: .9rem; }
a.hero-card { text-decoration: none; color: inherit; cursor: pointer; transition: background .15s, transform .15s; }
a.hero-card:hover { background: rgba(255,255,255,.2); transform: translateY(-2px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center; /* Центрируем текст внутри кнопки */
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9375rem;
  border: none;
  transition: all 0.2s ease; /* Более плавный переход */
  text-align: center;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 4px rgba(184, 135, 70, 0.2); /* Легкая тень под цвет акцента */
}

.btn-primary:hover:not([disabled]) {
  background: var(--color-accent-hover);
  transform: translateY(-2px); /* Чуть больше поднимаем */
  box-shadow: 0 4px 8px rgba(184, 135, 70, 0.3); /* Увеличиваем тень при наведении */
}

.btn-primary:active:not([disabled]) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(184, 135, 70, 0.2);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
}

.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid #cbd5e1;
}

.btn-outline:hover { border-color: var(--color-primary); background: var(--color-bg); }

/* Тёмные блоки (геро, шапка страницы) — кнопка остаётся светлой */
.hero .btn-outline, .page-header .btn-outline { color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn-outline:hover, .page-header .btn-outline:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.12); }

.btn-secondary {
  background: var(--color-primary);
  color: white;
}

.btn-secondary:hover { background: var(--color-primary-dark); }

.btn-sm { padding: 8px 16px; font-size: .8125rem; }

/* ── Sections ── */
section { padding: 56px 0; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 1.75rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.section-header p { color: var(--color-text-muted); margin-top: 4px; }

.link-more {
  color: var(--color-accent);
  font-weight: 600;
  font-size: .9rem;
}

.link-more:hover { text-decoration: underline; }

/* ── Categories ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.category-card {
  background: linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid #d6e0eb;
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card .icon {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: #eef2f7;
  border: 1px solid #dbe4ef;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card .category-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #dbe4ef;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--color-accent);
}

.category-card .category-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.category-card h3 {
  font-size: .9rem;
  line-height: 1.35;
  color: var(--color-text);
}

.category-card .count {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ── Category tree (home page): направление → группы → категории ── */
.cat-tree { display: block; }

.cat-dir { margin-bottom: 22px; padding: 0; }  /* padding:0 гасит глобальное section{padding:56px 0} */
.cat-dir:last-child { margin-bottom: 0; }

.cat-dir-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
}
.cat-dir-title::before {
  content: "";
  width: 4px;
  height: 16px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--color-accent);
}

/* ── Плитки-разделы (стиль insklad): фото + подпись по центру ──
   Плитки одинакового размера (max-width их выравнивает), неполный ряд
   центрируется — без «дыры» справа и без разнокалиберных плиток. */
.cat-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.cat-tile {
  flex: 1 1 260px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-white, #fff);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
@media (max-width: 560px) { .cat-tile { flex-basis: 150px; } }
.cat-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(22, 65, 150, .14);
  border-color: #c9d8ef;
}
.cat-tile.is-active { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(22, 65, 150, .18); }

.cat-tile-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #eef1f5;
}
.cat-tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-tile-media.is-ico { background: linear-gradient(160deg, #f6f9fc, #eaf0f8); }
.cat-tile-media .tool-ico { width: 60px; height: 60px; color: var(--color-accent); opacity: .8; }
.cat-tile-media .tool-ico svg { width: 38px; height: 38px; }

.cat-tile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3em;
  padding: 12px 12px 14px;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.25;
  color: var(--color-accent);
  transition: color .15s;
}
.cat-tile:hover .cat-tile-name { color: var(--color-accent-hover); }

/* Панель подкатегорий — полноширинный элемент грида, встаёт прямо под строкой
   нажатой плитки (аккордеон-грид). Свёрнутая — не занимает места. */
.cat-drawer {
  grid-column: 1 / -1;
  margin: 2px 0 4px;
  border: 1px solid #cdd9ec;
  border-top: 3px solid var(--color-accent);
  border-radius: 10px;
  background: var(--color-white, #fff);
  box-shadow: 0 8px 22px rgba(22, 65, 150, .10);
  overflow: hidden;
}
.cat-drawer:not(.is-open) { display: none; }

.cat-drawer-inner { padding: 14px 16px 16px; }
.cat-drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.cat-drawer-head strong { font-size: .95rem; color: var(--color-primary); }

.cat-drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 210px auto;
  column-gap: 22px;
}
.cat-drawer-list li { break-inside: avoid; -webkit-column-break-inside: avoid; }

.cat-drawer-list li a,
.cat-side-list li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text);
  font-size: .85rem;
  line-height: 1.3;
  transition: background .15s, color .15s;
}
.cat-drawer-list li a:hover,
.cat-side-list li a:hover {
  background: #eef2f7;
  color: var(--color-accent);
}
.cat-drawer-list li a.is-active,
.cat-side-list li a.is-active {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
}
.cat-drawer-list li a.is-active .cat-leaf-n,
.cat-side-list li a.is-active .cat-leaf-n { color: rgba(255, 255, 255, .85); }

.cat-leaf-n {
  flex-shrink: 0;
  font-size: .76rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Category tree (catalog sidebar) ── */
.cat-side-tree { list-style: none; margin: 0; padding: 0; }

.cat-side-all {
  display: block;
  padding: 9px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  color: var(--color-text);
  background: #f1f5f9;
  transition: background .15s, color .15s;
}
.cat-side-all:hover { background: #e6edf5; color: var(--color-accent); }
.cat-side-all.is-active { background: var(--color-accent); color: #fff; }

.cat-side-dir { margin-bottom: 10px; }
.cat-side-dir-title {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  margin: 12px 0 6px;
}

.cat-side-grp { border-radius: 8px; }

.cat-side-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
}
.cat-side-head:hover { background: #eef2f7; }

.cat-side-chev {
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: .75rem;
  transition: transform .18s;
}
.cat-side-grp.is-open > .cat-side-head .cat-side-chev { transform: rotate(90deg); }

.cat-side-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: .87rem;
  line-height: 1.25;
  color: var(--color-text);
}
.cat-side-head:hover .cat-side-name { color: var(--color-accent); }

.cat-side-n {
  flex-shrink: 0;
  font-size: .72rem;
  color: var(--color-text-muted);
  background: #eef2f7;
  border-radius: 10px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}

.cat-side-list {
  display: none;
  list-style: none;
  margin: 0 0 4px;
  padding: 2px 4px 4px 20px;
}
.cat-side-grp.is-open > .cat-side-list { display: block; }

/* ── Products ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: linear-gradient(180deg, #fff 0%, #fdfefe 100%);
  border: 1px solid #d7e0ea;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  box-shadow: 0 14px 30px rgba(15, 40, 64, .13);
  transform: translateY(-4px);
  border-color: #cfdceb;
}

.product-image {
  height: 190px;
  background: linear-gradient(135deg, #e8edf2, #d4dce6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image.has-photo {
  background: linear-gradient(180deg, #fff, #f6f9fd);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
}

.product-image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  letter-spacing: .08em;
  font-weight: 700;
  color: #4b6079;
  text-transform: uppercase;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-success);
  color: white;
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.product-badge.out { background: var(--color-danger); }

.product-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }

.product-brand {
  font-size: .75rem;
  color: #37536f;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.product-name {
  font-size: .9rem;
  font-weight: 600;
  margin: 6px 0 10px;
  line-height: 1.35;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.product-price small {
  font-size: .75rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.product-footer {
  padding: 0 16px 16px;
  display: flex;
  gap: 8px;
}

.product-footer .btn { flex: 1; justify-content: center; }

/* ── Benefits ── */
.benefits {
  background: var(--color-white);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.benefit-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.benefit-card .icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #2f4a66, #355474);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  letter-spacing: .06em;
  font-weight: 700;
  margin: 0 auto 16px;
}

.benefit-card h3 { font-size: 1rem; margin-bottom: 8px; color: var(--color-primary); }
.benefit-card p { font-size: .875rem; color: var(--color-text-muted); }

/* ── Catalog page ── */
.page-header {
  background: var(--color-primary);
  color: white;
  padding: 32px 0;
}

.page-header h1 { font-size: 1.75rem; }
.breadcrumb { font-size: .875rem; opacity: .8; margin-top: 8px; }
.breadcrumb a:hover { opacity: 1; text-decoration: underline; }

.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 32px 0 56px;
  align-items: start;
}

.sidebar {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.sidebar h3 {
  font-size: .9rem;
  color: var(--color-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

.category-list { list-style: none; }

.category-list:not(.cat-side-tree) li a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--color-text);
  transition: background .15s;
}

.category-list:not(.cat-side-tree) li a:hover,
.category-list:not(.cat-side-tree) li a.active {
  background: var(--color-bg);
  color: var(--color-primary);
  font-weight: 600;
}

.filter-group { margin-top: 20px; }
.filter-group label { display: block; font-size: .8125rem; color: var(--color-text-muted); margin-bottom: 6px; }

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .875rem;
  outline: none;
}

/* ── Сворачиваемые секции фильтров (аккордеон) ── */
.filter-section {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.filter-section:last-child { border-bottom: none; margin-bottom: 0; }

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 6px 0;
  user-select: none;
}

.toggle-icon { font-size: .7rem; color: var(--color-text-muted); transition: transform .25s ease; }
.filter-header.collapsed .toggle-icon { transform: rotate(-90deg); }

.filter-content {
  padding-top: 6px;
}
.filter-content.collapsed {
  display: none;
}

.filter-section .category-list { list-style: none; }
.filter-section .filter-group:first-child { margin-top: 8px; }

.filter-row { display: flex; gap: 10px; margin-top: 16px; align-items: flex-end; }
.filter-row .filter-group,
.filter-row .filter-group:first-child { flex: 1; margin-top: 0; }

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Mobile-only controls — hidden on desktop, shown via media query */
.filters-toggle { display: none; }
.sidebar-overlay { display: none; }
.sidebar-close-btn { display: none; }

.catalog-count { font-size: .875rem; color: var(--color-text-muted); }

.catalog-sort select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .875rem;
  outline: none;
}

/* ── Product detail ── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px 0 56px;
}

.product-detail-image {
  background: linear-gradient(135deg, #e8edf2, #d4dce6);
  border-radius: var(--radius-lg);
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  overflow: hidden;
  border: 1px solid #d8e2ee;
}

.product-detail-image.has-photo {
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
}

.product-detail-image .product-image-fallback {
  font-size: 5rem;
}

.product-detail-info h1 {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.product-detail-brand {
  color: #37536f;
  font-weight: 600;
  font-size: .875rem;
  text-transform: uppercase;
}

.product-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 20px 0;
}

.product-detail-price small { font-size: .875rem; font-weight: 400; color: var(--color-text-muted); }

.stock-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.stock-status.in { background: #dcfce7; color: var(--color-success); }
.stock-status.out { background: #fee2e2; color: var(--color-danger); }

.product-description {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.specs-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: .875rem;
}

.specs-table td:first-child { color: var(--color-text-muted); width: 40%; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qty-control button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  border-radius: var(--radius);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-control input {
  width: 60px;
  text-align: center;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
}

/* ── Contacts ── */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 40px 0 56px;
}

.contact-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid #d6e0eb;
}

.contact-card h3 {
  color: var(--color-primary);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.contact-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  font-size: .9375rem;
}

.contact-item .icon { font-size: 1.25rem; flex-shrink: 0; }
.contact-item .icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef2f7;
  border: 1px solid #dbe4ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: #3f5871;
  flex-shrink: 0;
}

.manager-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.manager-card strong { display: block; color: var(--color-primary); }
.manager-card a { color: var(--color-accent); font-weight: 600; }
.manager-card span { font-size: .8125rem; color: var(--color-text-muted); }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: .9rem;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--color-primary); }

.contact-form textarea { resize: vertical; min-height: 100px; }

/* ── Cart modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h2 { font-size: 1.1rem; color: var(--color-primary); }

.modal-close {
  background: none;
  border: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-modal { max-width: 560px; }

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}

.cart-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-item-name { font-size: .875rem; font-weight: 600; line-height: 1.3; }
.cart-item-unit { font-size: .75rem; color: var(--color-text-muted); }
.cart-item-price { font-weight: 700; color: var(--color-primary); white-space: nowrap; min-width: 84px; text-align: right; }

.cart-item-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: .95rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
.cart-item-remove:hover { color: var(--color-danger); }

/* Quantity stepper */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty-control button {
  width: 30px;
  height: 30px;
  background: var(--color-bg);
  border: none;
  font-size: 1rem;
  color: var(--color-primary);
  cursor: pointer;
}
.qty-control button:hover { background: var(--color-border); }
.qty-control span { min-width: 34px; text-align: center; font-weight: 600; font-size: .875rem; }

.cart-empty { text-align: center; color: var(--color-text-muted); padding: 40px 0; line-height: 1.8; }

.cart-ship-note {
  margin: 14px 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(184,135,70,.1);
  color: var(--color-accent-hover);
  font-size: .8125rem;
}
.cart-ship-note.ok { background: rgba(34,139,87,.1); color: #1f7a4d; }

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-size: .95rem;
  color: var(--color-text-muted);
}
.cart-summary strong { font-size: 1.35rem; color: var(--color-primary); }

.btn-block { width: 100%; justify-content: center; }

/* Checkout step */
.checkout-summary {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.checkout-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .8125rem;
  padding: 4px 0;
  color: var(--color-text);
}
.checkout-line em { color: var(--color-text-muted); font-style: normal; }
.checkout-line.total {
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1rem;
}
.checkout-line.total strong { color: var(--color-primary); }

.checkout-form { display: flex; flex-direction: column; gap: 14px; }
.checkout-form .field { display: flex; flex-direction: column; gap: 6px; }
.checkout-form .field > span { font-size: .8125rem; font-weight: 600; color: var(--color-text); }
.checkout-form .field i { color: var(--color-danger); font-style: normal; }
.checkout-form input,
.checkout-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
}
.checkout-form input:focus,
.checkout-form textarea:focus { border-color: var(--color-primary); outline: none; }
.checkout-form textarea { resize: vertical; min-height: 70px; }

.delivery-options { display: grid; gap: 10px; }
.delivery-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.delivery-option:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(31,52,74,.04);
}
.delivery-option input[type="radio"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
.delivery-option span { display: flex; flex-direction: column; flex: 1; align-items: flex-start; text-align: left; }
.delivery-option strong { font-size: .875rem; }
.delivery-option small { font-size: .75rem; color: var(--color-text-muted); }

.checkout-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.checkout-actions .btn[type="submit"] { flex: 1; justify-content: center; }
.btn-back-link { display: block; width: 100%; margin-top: 10px; background: none; border: none; color: var(--color-text-muted); font-size: .85rem; padding: 6px; text-align: center; }
.btn-back-link:hover { color: var(--color-primary); }

/* Order success */
.order-success { text-align: center; padding: 16px 0 8px; }
.order-success-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #1f7a4d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: .05em;
}
.order-success h3 { color: var(--color-primary); margin-bottom: 8px; }
.order-success p { color: var(--color-text-muted); font-size: .9rem; margin-bottom: 16px; }
.order-success-total { margin-bottom: 20px; font-size: .95rem; }
.order-success-total strong { color: var(--color-primary); font-size: 1.15rem; }

/* ── Footer ── */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.85);
  margin-top: auto;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer h4 {
  color: white;
  font-size: .9rem;
  margin-bottom: 16px;
}

.footer p, .footer a {
  font-size: .875rem;
  color: rgba(255,255,255,.7);
  line-height: 1.8;
}

.footer a:hover { color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: .8125rem;
  color: rgba(255,255,255,.5);
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s;
  font-size: .9rem;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ── Top Turn Tools redesign ── */
:root {
  --color-primary: #41494b;
  --color-primary-dark: #252b2d;
  --color-accent: #164196;
  --color-accent-hover: #0f347d;
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-surface-soft: #eef2f6;
  --color-text: #20282b;
  --color-text-muted: #697478;
  --color-border: #d9e0e5;
  --shadow-sm: 0 1px 2px rgba(20, 32, 36, .06);
  --shadow-md: 0 12px 30px rgba(20, 32, 36, .09);
  --shadow-lg: 0 22px 54px rgba(20, 32, 36, .16);
  --radius: 4px;
  --radius-lg: 12px;
}

body {
  background:
    linear-gradient(90deg, rgba(65,73,75,.045) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(65,73,75,.035) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(180deg, #f7f9fb 0%, #eef2f6 100%);
}

/* Каталог: спокойные боковые поля (тональная панель + еле заметная сетка).
   Центр (колонка до --max-width) остаётся чистым. Без иконок. */
body.page-catalog {
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f6 100%);
}
body.page-catalog::before,
body.page-catalog::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: max(0px, calc((100vw - var(--max-width)) / 2));
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27150%27%20height%3D%27330%27%20viewBox%3D%270%200%20150%20330%27%3E%3Cg%20fill%3D%27none%27%20stroke%3D%27rgba%2860%2C68%2C72%2C0.17%29%27%20stroke-width%3D%271.4%27%20stroke-linejoin%3D%27round%27%20stroke-linecap%3D%27round%27%3E%3Cg%20transform%3D%27translate%2830%2C24%29%20rotate%28-6%29%27%3E%3Crect%20x%3D%276%27%20y%3D%270%27%20width%3D%2712%27%20height%3D%2730%27%20rx%3D%271.5%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%2730%27%20width%3D%2720%27%20height%3D%2774%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M4%2040%20L20%2052%20M4%2054%20L20%2066%20M4%2068%20L20%2080%20M4%2082%20L20%2094%27%2F%3E%3Cpath%20d%3D%27M2%20104%20h20%27%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%27translate%28108%2C70%29%20rotate%2810%29%27%3E%3Crect%20x%3D%27-5%27%20y%3D%270%27%20width%3D%2710%27%20height%3D%2730%27%20rx%3D%271.5%27%2F%3E%3Cpath%20d%3D%27M-8%2030%20h16%20v58%20l-8%2015%20-8%20-15%20z%27%2F%3E%3Cpath%20d%3D%27M-4%2036%20C%204%2052%20-5%2068%203%2084%27%2F%3E%3Cpath%20d%3D%27M4%2036%20C%20-4%2052%205%2068%20-3%2084%27%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%27translate%2816%2C250%29%20rotate%28-16%29%27%3E%3Crect%20x%3D%270%27%20y%3D%270%27%20width%3D%2788%27%20height%3D%2717%27%20rx%3D%272.5%27%2F%3E%3Cpath%20d%3D%27M88%20-3%20l28%207%20-6%2018%20-22%203%20z%27%2F%3E%3Cpath%20d%3D%27M100%206%20l10%207%20-7%2010%20-10%20-7%20z%27%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E") repeat,
    linear-gradient(180deg, #edf1f7 0%, #e7ecf3 100%);
  z-index: -1;
  pointer-events: none;
}
body.page-catalog::before { left: 0;  border-right: 1px solid rgba(22, 65, 150, .08); }
body.page-catalog::after  { right: 0; border-left:  1px solid rgba(22, 65, 150, .08); }

.top-bar {
  background: #20282b;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.78);
}

.top-bar a:hover { color: #8fb2ff; }

.header {
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #d8e0e7;
  box-shadow: 0 8px 26px rgba(27, 36, 40, .06);
}

.header .container { gap: 22px; }

.logo { gap: 12px; }
.logo-icon.logo-image { width: auto; height: 44px; }
.logo-text strong {
  color: #333a3d;
  font-weight: 800;
  letter-spacing: .02em;
}
.logo-text span {
  color: #6d777b;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav {
  padding: 4px;
  background: #f0f3f6;
  border: 1px solid #dce3e9;
  border-radius: 999px;
}

.nav a {
  border-radius: 999px;
  color: #354044;
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  background: #fff;
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.header-search input,
.admin-form input,
.admin-form textarea,
.admin-form select,
.filter-group input,
.filter-group select,
.catalog-sort select,
.contact-form input,
.contact-form textarea,
.checkout-form input,
.checkout-form textarea {
  background: #fff;
  border: 1px solid #d5dde4;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.header-search input {
  border-radius: 999px;
  border-width: 1px;
}

.header-search input:focus,
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.filter-group input:focus,
.filter-group select:focus,
.catalog-sort select:focus,
.contact-form input:focus,
.contact-form textarea:focus,
.checkout-form input:focus,
.checkout-form textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(22,65,150,.12);
}

.btn,
.btn-cart,
.admin-tab,
.filters-toggle {
  border-radius: 8px;
  letter-spacing: .02em;
}

.btn-primary,
.btn-cart {
  background: linear-gradient(180deg, #1d52b6 0%, var(--color-accent) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(22,65,150,.18);
}

.btn-primary:hover:not([disabled]),
.btn-cart:hover {
  background: linear-gradient(180deg, #245fc9 0%, #123b8d 100%);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(22,65,150,.24);
}

.btn-secondary {
  background: #41494b;
  color: #fff;
}

.btn-secondary:hover { background: #252b2d; }

/* Белая полупрозрачная кнопка — только на тёмном hero-блоке.
   Без .hero это правило делало кнопки невидимыми на белых карточках. */
.hero .btn-outline {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
}

.hero {
  background:
    radial-gradient(circle at 75% 20%, rgba(45, 97, 194, .34), transparent 34%),
    linear-gradient(135deg, #252b2d 0%, #343d40 42%, #164196 100%);
  padding: 82px 0 74px;
  border-bottom: 1px solid rgba(22,65,150,.25);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 44px 44px;
  pointer-events: none;
}

.hero::after {
  right: 5%;
  top: 16%;
  width: 360px;
  height: 360px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  transform: rotate(12deg);
}

.hero h1 {
  max-width: 760px;
  font-weight: 800;
  letter-spacing: .01em;
}

.hero p {
  color: rgba(255,255,255,.82);
  opacity: 1;
}

.hero-stat {
  padding-left: 14px;
  border-left: 2px solid rgba(143,178,255,.55);
}

.hero-stat strong { color: #fff; }
.hero-stat span { color: rgba(255,255,255,.72); opacity: 1; }

.brand-tag {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.84);
}

.hero-card {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.hero-card .icon {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.24);
  color: #fff;
}

section { padding: 64px 0; }

.section-header h2 {
  color: #30383b;
  font-weight: 800;
  letter-spacing: .02em;
}

.section-header p { color: #687276; }

.link-more {
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .78rem;
}

.category-card,
.product-card,
.benefit-card,
.sidebar,
.contact-card,
.modal,
.admin-card,
.admin-login,
.admin-table-wrap,
.checkout-summary {
  background: var(--color-surface);
  border: 1px solid #d8e0e7;
  box-shadow: 0 10px 28px rgba(36,47,52,.06);
}

.category-card {
  padding: 18px;
  border-left: 4px solid var(--color-accent);
}

.category-card:hover,
.product-card:hover {
  border-color: rgba(22,65,150,.38);
  box-shadow: 0 18px 40px rgba(36,47,52,.12);
}

.category-card .icon,
.contact-item .icon,
.benefit-card .icon {
  background: #edf2f8;
  border-color: #d7e1ec;
  color: var(--color-accent);
}

.products-grid { gap: 22px; }

.product-card { border-radius: 14px; }

.product-image,
.product-detail-image {
  background:
    linear-gradient(90deg, rgba(65,73,75,.04) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(0deg, rgba(65,73,75,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    #f2f5f8;
}

.product-image.has-photo,
.product-detail-image.has-photo {
  background: #fff;
}

.product-brand,
.product-detail-brand {
  color: var(--color-accent);
  letter-spacing: .08em;
}

.product-name { color: #222b2f; }
.product-price,
.product-detail-price {
  color: #20282b;
}

.product-price small,
.product-detail-price small {
  display: block;
  margin-top: 2px;
}

.product-footer {
  border-top: 1px solid #edf1f4;
  padding-top: 14px;
}

.benefits {
  background: linear-gradient(180deg, #fff 0%, #f2f5f8 100%);
  border-top: 1px solid #dfe6ec;
  border-bottom: 1px solid #dfe6ec;
}

.benefit-card {
  text-align: left;
  padding: 28px;
}

.benefit-card .icon {
  margin: 0 0 18px;
  border-radius: 12px;
}

.page-header {
  background:
    linear-gradient(90deg, #252b2d 0%, #333d40 48%, #164196 100%);
  border-bottom: 1px solid rgba(22,65,150,.25);
}

.breadcrumb { opacity: .75; }

.sidebar {
  border-radius: 14px;
  padding: 22px;
}

.filter-section { border-color: #e4e9ee; }
.filter-header { color: #30383b; }
.category-list:not(.cat-side-tree) li a {
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.category-list:not(.cat-side-tree) li a:hover,
.category-list:not(.cat-side-tree) li a.active {
  background: #eef4ff;
  border-color: #d5e2ff;
  color: var(--color-accent);
}

.catalog-toolbar {
  background: #fff;
  border: 1px solid #d8e0e7;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 22px rgba(36,47,52,.05);
}

.catalog-count {
  color: #536064;
  font-weight: 600;
}

.empty-state {
  display: none;
  text-align: center;
  padding: 54px 20px;
  color: var(--color-text-muted);
  background: #fff;
  border: 1px dashed #cfd9e4;
  border-radius: 14px;
}

.empty-state p:first-child {
  font-size: 1.25rem;
  font-weight: 800;
  color: #30383b;
  margin-bottom: 8px;
}

.empty-state a {
  color: var(--color-accent);
  font-weight: 700;
}

.empty-state-visible { display: block; }

.product-detail-info {
  background: #fff;
  border: 1px solid #d8e0e7;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 10px 28px rgba(36,47,52,.06);
}

.specs-table {
  border: 1px solid #e0e7ed;
  border-radius: 10px;
  overflow: hidden;
}

.specs-table tr:nth-child(odd) { background: #f7f9fb; }

.contact-card {
  border-radius: 14px;
  border-top: 4px solid var(--color-accent);
}

.manager-card {
  background: #f4f7fa;
  border: 1px solid #dde5ec;
}

.modal-overlay { background: rgba(20, 29, 32, .62); }
.modal { border-radius: 16px; }
.modal-header { background: #f7f9fb; }

.cart-ship-note {
  background: #edf4ff;
  color: #164196;
  border: 1px solid #d7e5ff;
}

.delivery-option:has(input:checked) {
  border-color: var(--color-accent);
  background: #eef4ff;
}

.footer {
  background:
    linear-gradient(135deg, #20282b 0%, #252f32 52%, #102b63 100%);
}

.footer a:hover { color: #8fb2ff; }

.footer-compact {
  margin-top: 40px;
  padding: 24px 0;
}

.footer-compact .footer-bottom {
  border-top: none;
  padding-top: 0;
}

.contact-card-spaced { margin-top: 24px; }

.contact-card p {
  font-size: .9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.contact-card p + p { margin-top: 12px; }

.related-section {
  background: #fff;
  padding-top: 24px;
}

.product-help {
  margin-top: 16px;
  font-size: .875rem;
  color: var(--color-text-muted);
}

.product-help a {
  color: var(--color-accent);
  font-weight: 700;
}

.admin-tab {
  background: #fff;
  color: #30383b;
}

.admin-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.admin-table th {
  background: #eef3f8;
  color: #30383b;
}

.admin-stat-value { color: var(--color-accent); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .benefits-grid { grid-template-columns: 1fr; }
}

/* ── Mobile (768px) ── */
@media (max-width: 768px) {
  /* Top bar */
  .top-bar { display: none; }

  /* Сплошной фон вместо сетки — меньше перерисовок при прокрутке */
  body { background: var(--color-bg); }

  /* Header: ряд 1 — логотип (слева) + корзина и меню (справа), ряд 2 — поиск */
  .header .container {
    height: auto;
    min-height: 56px;
    gap: 8px 10px;
    padding: 8px 14px;
    flex-wrap: wrap;
  }

  .logo {
    flex: 0 1 auto;
    min-width: 0;          /* позволяет логотипу ужиматься, без выхода за экран */
    margin-right: auto;    /* прижимает корзину и меню к правому краю */
    gap: 8px;
  }
  .logo-text { min-width: 0; overflow: hidden; }
  .logo-text span { display: none; }
  .logo-icon { width: 36px; height: 36px; font-size: .9rem; }
  .logo-icon.logo-image { width: auto; height: 34px; }
  .logo-text strong { font-size: 1.05rem; white-space: nowrap; }

  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--color-border);
    z-index: 99;
  }
  .nav.open a { padding: 12px 14px; font-size: .95rem; }

  .header-actions { flex: 0 0 auto; gap: 8px; }
  .menu-toggle { display: inline-flex; align-items: center; padding: 8px 10px; }
  .header-phone { display: none; }
  .btn-cart { padding: 8px 12px; font-size: .8rem; white-space: nowrap; }

  .header-search {
    order: 3;              /* поиск уходит на отдельную строку под шапкой */
    flex: 1 1 100%;
    max-width: none;
    margin-top: 2px;
  }
  .header-search input { font-size: 16px; } /* 16px — чтобы iOS не зумил */

  /* Hero */
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: .9rem; margin-bottom: 18px; }
  .hero-stats { flex-direction: column; gap: 12px; margin-top: 20px; }
  .hero-stat strong { font-size: 1.4rem; }

  /* Sections */
  section { padding: 32px 0 !important; }
  h2 { font-size: 1.25rem; }

  /* Products grid — 2 cols */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-image { height: 150px; }
  .product-body { padding: 10px 10px 6px; }
  .product-name { font-size: .82rem; }
  .product-price { font-size: 1.05rem; }
  .product-footer { padding: 0 10px 10px; }
  .product-footer .btn { font-size: .78rem; padding: 8px 10px; }

  /* Catalog */
  .page-header { padding: 18px 0; }
  .page-header h1 { font-size: 1.3rem; }
  .catalog-layout { padding: 18px 0 48px; gap: 0; }
  .catalog-toolbar {
    padding: 0;
    margin: 0 0 16px;
    align-items: center;
    gap: 10px 8px;
  }
  /* Кнопка фильтров — отдельной строкой на всю ширину */
  .catalog-count { order: 2; flex: 1 1 auto; font-size: .8rem; margin: 0; }
  .catalog-sort { order: 3; flex: 0 0 auto; margin-left: auto; }
  .catalog-sort select { width: auto; }

  /* Catalog sidebar — выезжающая панель (drawer) */
  .sidebar-title { display: none; }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    height: 100%;
    width: 86%;
    max-width: 340px;
    z-index: 1000;
    border-radius: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 20px 80px;
    transform: translateX(-100%);
    transition: transform .2s ease-out;
    will-change: transform;
    box-shadow: none;
    background: #fff;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 2px 0 16px rgba(0,0,0,.25);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease-out;
  }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .sidebar-close-btn {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    border-bottom: 2px solid var(--color-accent);
    padding: 0 0 12px;
    margin-bottom: 12px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .sidebar-close-btn span { font-size: 1.4rem; font-weight: 300; color: var(--color-text-muted); }
  .filters-toggle {
    order: 1;
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
  }
  .category-list li a { padding: 11px 10px; }

  /* Inputs — 16px чтобы iOS не зумил */
  input, select, textarea { font-size: 16px !important; }

  /* Contacts / product detail */
  .product-detail { grid-template-columns: 1fr; }
  .contacts-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer { padding: 32px 0 20px; }

  /* Benefits */
  .benefits-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Cart modal — bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .cart-modal {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 94vh;
  }

  /* Checkout actions — вертикально */
  .checkout-actions { flex-direction: column; }
  .checkout-actions .btn { width: 100%; justify-content: center; }
  .checkout-actions .btn[type="submit"] { order: -1; }
}

/* ── Very small (480px) ── */
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-image { height: 130px; }
  .hero-brands { display: none; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── Redesign mobile polish ── */
@media (max-width: 768px) {
  .header {
    position: sticky;
    box-shadow: 0 8px 22px rgba(20,29,32,.08);
  }

  .nav {
    border-radius: 0;
    padding: 10px 14px;
    background: #fff;
  }

  .header-search input { min-height: 42px; }

  .hero {
    padding: 42px 0 34px;
    background:
      radial-gradient(circle at 100% 0%, rgba(45,97,194,.28), transparent 38%),
      linear-gradient(135deg, #252b2d 0%, #333d40 55%, #164196 100%);
  }

  .hero::before,
  .hero::after { display: none; }

  .hero h1 {
    font-size: clamp(1.55rem, 8vw, 2rem);
    letter-spacing: .005em;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    min-height: 46px;
  }

  .hero-stats {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    padding: 14px;
  }

  .hero-stat {
    padding-left: 10px;
  }

  .section-header {
    margin-bottom: 20px;
  }

  .category-card,
  .benefit-card,
  .contact-card,
  .product-detail-info {
    border-radius: 12px;
  }

  .products-grid {
    align-items: stretch;
  }

  .product-card {
    border-radius: 12px;
  }

  .product-brand {
    font-size: .68rem;
  }

  .product-price small {
    font-size: .65rem;
  }

  .catalog-toolbar {
    padding: 12px;
    border-radius: 12px;
  }

  .filters-toggle {
    border-color: #cfd9e4;
    color: var(--color-accent);
    background: #f8fbff;
  }

  .sidebar {
    border-radius: 0 14px 14px 0;
    border-left: none;
  }

  .filter-row {
    align-items: stretch;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* SVG-иконки в плитках/контактах и заглушка фото товара */
.hero-card .icon svg,
.contact-item .icon svg { width: 58%; height: 58%; }
.tool-ico { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.tool-ico svg { width: 62%; height: 62%; }
.category-card .category-thumb .tool-ico { color: var(--color-accent); }
.product-image:not(.has-photo) { background: #f6f8fb; }
.product-image-fallback .tool-ico { color: #c0ccdb; }
.product-image-fallback .tool-ico svg { width: 40%; max-width: 84px; height: auto; }

/* ── Согласие на обработку персональных данных ── */
.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 0 6px;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  cursor: pointer;
}
.consent-field input[type="checkbox"] {
  width: 16px !important;
  height: 16px;
  flex: 0 0 16px;
  min-width: 0;
  margin: 2px 0 0;
  padding: 0 !important;
  border-radius: 3px;
  box-shadow: none;
}
.consent-field span { flex: 1; }
.consent-field a { color: var(--color-accent); text-decoration: underline; }

/* ── Меню: не разрывать названия пунктов по словам ── */
.nav { flex-wrap: wrap; }
.nav a { white-space: nowrap; }

/* ── Тумблер «Физлицо / Юрлицо» в оформлении ── */
.ctype-toggle{display:flex;gap:8px}
.ctype-opt{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;border:1px solid #d5dde4;border-radius:9px;cursor:pointer;font-size:.9rem;background:#fff}
.ctype-opt:has(input:checked){border-color:var(--color-accent);background:rgba(22,65,150,.06);font-weight:600}
.ctype-opt input{width:16px;height:16px;margin:0;flex:0 0 16px}

/* ── Автокомплит-подсказки (DaData) ── */
.suggest-box{
  position:absolute; top:100%; left:0; right:0; z-index:60;
  margin-top:4px; max-height:290px; overflow-y:auto;
  background:#fff; border:1px solid var(--color-border); border-radius:10px;
  box-shadow:0 12px 28px rgba(22,65,150,.14);
}
.suggest-item{ padding:8px 12px; cursor:pointer; border-bottom:1px solid #f1f5f9; line-height:1.3; }
.suggest-item:last-child{ border-bottom:0; }
.suggest-item:hover, .suggest-item.active{ background:#eef4ff; }
.suggest-item .s-main{ display:block; font-size:.88rem; color:var(--color-text); font-weight:500; }
.suggest-item .s-sub{ display:block; font-size:.76rem; color:var(--color-text-muted); margin-top:1px; }

/* === ВАРИАНТЫ ФОНА (раскомментировать ОДИН блок) ===================
   Текущий активный фон — «чертёжная» сетка выше (body в ~строке 1560).
   Чтобы сменить: закомментируй тот body и раскомментируй один вариант ниже.

// Вариант A: тёплый нейтральный (спокойный, без паттерна)
// body {
//   background: linear-gradient(180deg, #f6f4f1 0%, #eef1f4 100%);
// }

// Вариант B: технический blueprint (синеватая сетка, «инженерный» вид)
// body {
//   background:
//     linear-gradient(90deg, rgba(22,65,150,.05) 1px, transparent 1px) 0 0 / 28px 28px,
//     linear-gradient(0deg,  rgba(22,65,150,.05) 1px, transparent 1px) 0 0 / 28px 28px,
//     linear-gradient(160deg, #eef3fb 0%, #e4ecf7 100%);
// }

// Вариант C: мягкий градиент (два лёгких световых пятна, современно)
// body {
//   background:
//     radial-gradient(900px 500px at 12% -8%, rgba(22,65,150,.08), transparent 60%),
//     radial-gradient(800px 500px at 100% 0%, rgba(65,73,75,.06), transparent 55%),
//     linear-gradient(180deg, #f4f7fb 0%, #eaeff5 100%);
//   background-attachment: fixed;
// }

// Вариант D: точечная сетка (dot-grid, деликатный паттерн)
// body {
//   background-color: #eef2f6;
//   background-image: radial-gradient(rgba(22,65,150,.14) 1px, transparent 1.4px);
//   background-size: 22px 22px;
// }
=================================================================== */

/* Каталог: техничный blueprint-фон «рамкой» — графика по левому и правому
   краю, центр пуст под контент (файл /images/blueprint-frame.svg).
   Переопределяет прежние боковые полосы выше. */
body.page-catalog { background: linear-gradient(180deg, #f6f8fb 0%, #eef2f6 100%); }
body.page-catalog::after { content: none; }
body.page-catalog::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: auto;
  border: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/images/blueprint-frame.svg") center center / cover no-repeat;
  opacity: .85;
}

/* ── Декодер обозначения пластины (главная) ── */
.idc { max-width: 940px; }
.idc-input { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.idc-input input {
  font-size: 1.15rem; letter-spacing: 2px; font-weight: 700; color: var(--color-accent);
  border: 1px solid #cdd9ec; border-radius: 10px; padding: 11px 16px; width: 250px; text-transform: uppercase;
}
.idc-input input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(22,65,150,.12); }
.idc-ex { font-size: .8rem; color: var(--color-text-muted); margin-bottom: 14px; }
.idc-ex button { border: none; background: none; color: var(--color-accent); font-weight: 600; cursor: pointer; font-size: .8rem; padding: 0; font-variant-numeric: tabular-nums; }
.idc-ex button:hover { text-decoration: underline; }
.idc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.idc-chip { position: relative; min-width: 36px; text-align: center; background: var(--color-accent); color: #fff; font-weight: 700; border-radius: 8px; padding: 9px 11px 15px; font-size: 1rem; }
.idc-chip small { position: absolute; left: 0; right: 0; bottom: 3px; font-size: .55rem; font-weight: 500; opacity: .75; }
.idc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.idc-card { position: relative; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; padding: 11px 12px; box-shadow: var(--shadow-sm); }
.idc-cardsh { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; }
.idc-p { font-size: .7rem; color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.idc-v { font-size: .95rem; font-weight: 600; color: var(--color-accent); margin-top: 3px; padding-right: 40px; line-height: 1.3; }
.idc-toggle { margin-top: 14px; background: #eef2f7; border: 1px solid var(--color-border); border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: .85rem; color: var(--color-primary); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.idc-toggle:hover { background: #e6edf5; }
.idc-cheat { margin-top: 12px; }
.idc-cheat[hidden] { display: none; }
.idc-sec { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.idc-sec-t { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.idc-sec-n { width: 24px; height: 24px; flex: 0 0 24px; background: var(--color-accent); color: #fff; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.idc-sec-t b { font-size: .9rem; color: var(--color-primary); }
.idc-sec-t span { color: var(--color-text-muted); font-size: .78rem; }
.idc-row { display: flex; flex-wrap: wrap; gap: 6px; }
.idc-i { display: flex; align-items: center; gap: 6px; background: #f6f9fc; border: 1px solid #e6ecf4; border-radius: 8px; padding: 4px 9px; }
.idc-i k { color: var(--color-accent); font-weight: 700; font-variant-numeric: tabular-nums; font-size: .82rem; }
.idc-i span { color: var(--color-text); font-size: .78rem; }
.idc-sh { width: 22px; height: 22px; flex: 0 0 22px; }
.idc-note { font-size: .78rem; color: var(--color-text-muted); margin-top: 4px; }
@media (max-width: 560px) { .idc-input input { width: 100%; } }

/* живой чертёж пластины + карточки в два столбца */
.idc-main { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.idc-drawwrap { flex: 0 0 260px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; padding: 12px; }
.idc-draw { width: 100%; height: auto; max-height: 190px; }
.idc-main .idc-grid { flex: 1 1 320px; align-content: start; }
.idc-dim { fill: #164196; font-family: monospace; font-size: 11px; font-weight: 700; }
.idc-dim2 { fill: #8a94a0; font-family: sans-serif; font-size: 9px; }
@media (max-width: 620px) { .idc-drawwrap { flex-basis: 100%; } }

/* конструктор: подсказка, сброс, кликабельные позиции */
.idc-hint { font-size: .82rem; color: var(--color-text-muted); margin: 0 0 12px; }
.idc-reset { background: #eef2f7; border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: .85rem; color: var(--color-primary); cursor: pointer; }
.idc-reset:hover { background: #e6edf5; }
.idc-side { flex: 1 1 320px; display: flex; flex-direction: column; gap: 10px; }
.idc-chip-empty { background: #e8edf3 !important; color: #9aa4b0 !important; }
.idc-warn { font-size: .8rem; color: #8a5a12; background: #fff7e6; border: 1px solid #f2d9a8; border-radius: 8px; padding: 7px 10px; margin-top: 4px; }
.idc-pos { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; padding: 11px 13px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.idc-pos-t { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.idc-pos-n { width: 24px; height: 24px; flex: 0 0 24px; background: var(--color-accent); color: #fff; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.idc-pos-t b { font-size: .9rem; color: var(--color-primary); }
.idc-pos-t span { color: var(--color-text-muted); font-size: .78rem; }
.idc-pos-row { display: flex; flex-wrap: wrap; gap: 6px; }
.idc-optchip { display: inline-flex; align-items: center; gap: 5px; background: #f6f9fc; border: 1px solid #e6ecf4; border-radius: 8px; padding: 5px 9px; font-size: .8rem; color: var(--color-text); cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.idc-optchip b { color: var(--color-accent); font-weight: 700; }
.idc-optchip:hover { border-color: #c9d8ef; background: #eef4ff; }
.idc-optchip.is-on { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.idc-optchip.is-on b { color: #fff; }
.idc-optsh { width: 16px; height: 16px; flex: 0 0 16px; }
.idc-optchip.is-on .idc-optsh { filter: brightness(0) invert(1); }

/* живая расшифровка выбранного (меняется при любом клике) */
.idc-readout { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
@media (max-width: 520px) { .idc-readout { grid-template-columns: 1fr; } }
.idc-rd { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 5px 9px; background: #f6f9fc; border: 1px solid #eef1f5; border-radius: 7px; }
.idc-rd.on { background: #eef4ff; border-color: #d5e2ff; }
.idc-rd-l { font-size: .72rem; color: var(--color-text-muted); }
.idc-rd-v { font-size: .8rem; font-weight: 600; color: var(--color-text); text-align: right; }
.idc-rd.on .idc-rd-v { color: var(--color-accent); }

/* живая подсказка наличия по мере выбора */
.idc-live { margin: 14px 0 4px; min-height: 20px; }
.idc-live-empty { font-size: .82rem; color: var(--color-text-muted); }
.idc-live-h { font-size: .85rem; color: var(--color-primary); font-weight: 600; margin-bottom: 6px; }
.idc-live-h b { color: var(--color-accent); }
.idc-live-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.idc-live-item { font-size: .78rem; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 7px; padding: 4px 9px; color: var(--color-text); text-decoration: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idc-live-item:hover { background: #eef4ff; color: var(--color-accent); border-color: #c9d8ef; }
.idc-live-more { font-size: .78rem; color: var(--color-accent); font-weight: 600; text-decoration: none; padding: 4px; }

/* ── Кнопка «показать пароль» ── */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 42px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--color-text-muted); border-radius: 8px; padding: 0; }
.pw-eye:hover { background: #eef2f7; color: var(--color-accent); }
.pw-eye svg { width: 18px; height: 18px; }

/* ── Восстановление пароля ── */
/* Ссылка-кнопка: форма — flex-колонка, поэтому прижимаем вправо и сжимаем по тексту */
.pw-forgot {
  align-self: flex-end;
  width: fit-content;
  margin: -8px 0 0 auto;
  padding: 2px 0;
  background: none;
  border: none;
  font-size: .8rem;
  line-height: 1.2;
  color: var(--color-accent);
  cursor: pointer;
}
.pw-forgot:hover { text-decoration: underline; }
.pw-reset-box { background: #f6f9fc; border: 1px solid var(--color-border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.pw-reset-box p { font-size: .82rem; color: var(--color-text-muted); margin: 0 0 8px; }
