/* ==========================================================================
   bearing-page.css: страницы подшипников (/bearings-nsk/...). Автономный файл.
   Подключается ПОСЛЕ share.css (хедер, футер, бургер, .btn и переменные :root:
   --bg --text --purple --purple-soft --line --accent --accent-dark --accent-soft
   --lilac-soft). grease-card.css больше не нужен.
   Блоки: каркас, заголовки, крошки, кнопки, секции, таблица, фильтры,
   «соседние типоразмеры», списки каталога, мобильная версия.
   ========================================================================== */


/* ---------- Каркас страницы ---------- */
.bearing-page{
  --bearing-gap:88px;                      /* одинаковый отступ между всеми блоками */
  --bearing-side:380px;                    /* ширина колонки со схемой */
  padding-bottom:90px;
}

.bearing-hero{
  background:linear-gradient(to top, var(--bg) 0%, #ffffff 60%, #ffffff 100%);
  padding:56px 0 var(--bearing-gap);
}
.bearing-header{
  margin-bottom:0;
  text-align:center;
}
.bearing-header h1{ max-width:none; }
.bearing-header.bearing-header-left{ text-align:left; }
.bearing-header.bearing-header-left .bearing-cta{ justify-content:flex-start; margin-top:8px; }

.bearing-header.bearing-header-left .lead{
  margin-left:0;
  margin-right:0;
  max-width:none;
  margin-bottom:52px;            /* пространство между lead и кнопками */
}
.bearing-header.bearing-header-left .bearing-cta{ margin-top:0; }

.bearing-header .lead{
  max-width:900px;
  margin-left:auto;
  margin-right:auto;
}
.bearing-header .bearing-cta{
  justify-content:center;
  margin-top:60px;
}


/* ---------- Заголовки и текст ---------- */
h1,h2,h3,p{ margin-top:0; }
h1{
  font-weight:700;
  word-spacing:0.1em;
  margin-bottom:24px;
  font-size:clamp(34px,3.9vw,48px);
  line-height:1.02;
  letter-spacing:-.055em;
}
h2{
  font-weight:600;
  margin-bottom:20px;
  font-size:clamp(30px,3.5vw,42px);
  line-height:1.06;
  letter-spacing:-.045em;
}
.lead{
  font-weight:400;
  color:var(--purple);
  font-size:clamp(17px,1.6vw,23px);
  line-height:1.6;
}


/* ---------- Хлебные крошки ---------- */
.breadcrumbs{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 10px;
  margin-bottom:34px;
  font-size:14px;
  font-weight:600;
  color:var(--purple-soft);
}
.breadcrumbs a{
  color:var(--purple-soft);
  transition:.18s ease;
}
.breadcrumbs a:hover{ color:var(--text); }
.breadcrumbs .sep{ color:#94a0b2; }
.breadcrumbs [aria-current="page"]{
  color:var(--purple);
  font-weight:700;
}


/* ---------- Кнопки призыва (сами .btn берутся из share.css) ---------- */
.bearing-cta{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px 36px;
  margin-top:31px;
}


/* ---------- Секции ---------- */
.bearing-section{ margin-bottom:var(--bearing-gap); }
.bearing-section h2{ margin-bottom:24px; }

.bearing-section p{
  font-weight:400;
  color:var(--purple);
  font-size:clamp(16px,1.33vw,19px);
  line-height:1.5;
  max-width:80ch;
  margin-bottom:15px;
}
.bearing-section p:last-child{ margin-bottom:0; }

.bearing-section p.bearing-wide{ max-width:none; }

/* лид под заголовком секции */
.bearing-section p.lead{
  max-width:none;
  margin-bottom:28px;
  font-size:clamp(17px,1.6vw,23px);
  line-height:1.6;
}

/* описание: по ширине, по ширине левой части блока характеристик */
.bearing-text p{ max-width:none; text-align:justify; hyphens:auto; }
.bearing-split-side{
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--bearing-side);
  column-gap:16px;                         /* как зазор в блоке характеристик */
}

/* сноска под таблицей (селектор усилен, чтобы не перебивался правилом выше) */
.bearing-section p.bearing-note{
  margin-top:16px;
  color:var(--purple-soft);
}


/* ---------- Таблица ---------- */
.specs-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  background:#fff;
  border:1px solid var(--line);
  border-radius:7px;
}
.specs{
  width:100%;
  border-collapse:collapse;
  border-spacing:0;
  font-size:clamp(16px,1.33vw,19px);
  line-height:1.5;
  color:var(--purple);
}
.specs th,
.specs td{
  padding:.6em .8em;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  vertical-align:top;
  text-align:left;
  overflow-wrap:anywhere;
  background:#fff;
}
.specs th:last-child,
.specs td:last-child{ border-right:none; }
.specs tr:last-child th,
.specs tr:last-child td{ border-bottom:none; }
.specs th{ font-weight:600; color:var(--purple); }
.specs td{ font-weight:400; color:var(--purple); }

.bearing-page tr[hidden]{ display:none; }

.bearing-table{ min-width:560px; }
.bearing-table th,
.bearing-table td{ vertical-align:top; }
.bearing-table th.nw,
.bearing-table td.nw{ white-space:nowrap; }                     /* класс nw задаёт профиль (колонки цены и наличия) */

/* линия под шапкой (в .specs у последней строки нижняя граница убрана) */
.specs.bearing-table thead tr:last-child th{ border-bottom:1px solid var(--line); }
.specs.bearing-table thead th{ background:var(--lilac-soft); }   /* цвет шапки */

/* кнопка сортировки в заголовке */
.bearing-sort{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0;
  margin:0;
  border:0;
  background:none;
  font:inherit;
  font-weight:600;
  color:inherit;
  text-align:left;
  white-space:inherit;
  cursor:pointer;
  transition:color .18s ease;
}
.bearing-sort:hover{ color:var(--accent-dark); }
.bearing-sort:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.sort-ico{
  display:inline-flex;
  flex-direction:column;
  gap:2px;
  flex:none;
}
.sort-ico::before,
.sort-ico::after{
  content:"";
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  opacity:.35;
}
.sort-ico::before{ border-bottom:5px solid currentColor; }
.sort-ico::after{ border-top:5px solid currentColor; }
th[aria-sort="ascending"] .sort-ico::before,
th[aria-sort="descending"] .sort-ico::after{ opacity:1; color:var(--accent); }

.bearing-table summary{
  cursor:pointer;
  font-weight:600;
}
.bearing-table details p{
  margin:8px 0 4px;
  line-height:1.6;
}

/* обозначение показываем с пробелами ровно как в Excel */
.bearing-table summary,
.bearing-table .pn{ white-space:pre-wrap; }

/* строка: подсветка при наведении, клик по всей строке (JS) */
.bearing-table tbody tr.is-clickable{ cursor:pointer; }
.bearing-table tbody td{ transition:.18s ease; }
.bearing-table tbody tr:hover > td{
  background:var(--accent-soft);
  color:var(--accent-dark);
}
.bearing-table tr:target > td{ background:var(--accent-soft); }

/* строка со смазкой в расшифровке: заметная ссылка, при наведении приподнимается */
.bearing-table a.grease-link{
  display:inline-block;
  margin:2px 0;
  padding:1px 10px;
  border-radius:7px;
  background:var(--lilac-soft);
  color:var(--accent);
  font-weight:600;
  transition:transform .18s ease, box-shadow .18s ease, color .18s ease;
}
.bearing-table a.grease-link:hover{
  color:var(--accent-dark);
  transform:translateY(-2px);
  box-shadow:0 6px 16px rgba(15,23,42,.12);
}


/* ---------- Характеристики: список слева и схема справа, одинаковой высоты ---------- */
.bearing-char{
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--bearing-side);
  gap:16px;
  align-items:stretch;                     /* обе колонки всегда одной высоты */
}
.bearing-char-nodraw{ grid-template-columns:minmax(0,1fr); }

.bearing-char-list{
  display:flex;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--line);
  border-radius:7px;
}
.bearing-char-list .specs{ height:100%; }   /* строки растягиваются, если схеме нужна высота */
.bearing-specs th{ width:70%; font-weight:400; }
.bearing-specs td{ font-weight:600; white-space:nowrap; }

/* высоту ячейки задаёт список слева; схема вписывается в неё (absolute не влияет на высоту) */
.bearing-drawing{
  position:relative;
  box-sizing:border-box;
  min-height:280px;                        /* защита, если в списке всего 2-3 строки */
  background:#fff;                         /* белая подложка: обводка цифр на схеме тоже белая */
  border:1px solid var(--line);
  border-radius:7px;
  color:var(--purple);
}
.bearing-svg{
  position:absolute;
  top:16px;
  left:16px;
  width:calc(100% - 32px);
  height:calc(100% - 32px);                /* viewBox сохраняет пропорции, схема по центру */
}
.bd-body{ fill:#dfe3e8; stroke:currentColor; stroke-width:5; stroke-linejoin:round; }
.bd-bore{ stroke:currentColor; stroke-width:5; }
.bd-ball{ fill:#fff; stroke:currentColor; stroke-width:5; }
.bd-line{ fill:none; stroke:currentColor; stroke-width:2; }
.bd-text{
  fill:currentColor;
  font-family:inherit;
  text-anchor:middle;
  dominant-baseline:central;
  paint-order:stroke;                      /* белая обводка скрывает линию под цифрами */
  stroke:#fff;
  stroke-width:14px;
  stroke-linejoin:round;
}


/* ---------- Фильтры (множественный выбор) ---------- */
.bearing-filters{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px 24px;
  margin:0 0 20px;
  font-size:clamp(16px,1.33vw,19px);
  line-height:1.5;
  color:var(--purple);
}
.bearing-filter{
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.bearing-filter-label{ font-weight:600; }
.bearing-count{ color:var(--purple-soft); }

.bearing-multi{ position:relative; }
.bearing-multi > summary{
  position:relative;
  min-width:170px;
  max-width:260px;
  padding:.35em 2em .35em .7em;
  background:#fff;
  border:1px solid var(--line);
  border-radius:7px;
  color:var(--purple);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:pointer;
  list-style:none;
}
.bearing-multi > summary::-webkit-details-marker{ display:none; }
.bearing-multi > summary::after{
  content:"";
  position:absolute;
  right:.8em;
  top:50%;
  margin-top:-3px;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-top:6px solid currentColor;
}
.bearing-multi > summary:focus-visible,
.bearing-multi[open] > summary{ border-color:var(--accent); outline:none; }

.bearing-multi-list{
  position:absolute;
  z-index:20;
  top:calc(100% + 4px);
  left:0;
  min-width:100%;
  max-height:260px;
  overflow:auto;
  padding:6px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:7px;
  box-shadow:0 8px 25px rgba(15,23,42,.12);
}
.bearing-multi-list label{
  display:flex;
  align-items:center;
  gap:8px;
  padding:.3em .5em;
  border-radius:5px;
  font-weight:400;
  white-space:nowrap;
  cursor:pointer;
  transition:.18s ease;
}
.bearing-multi-list label:hover{
  background:var(--accent-soft);
  color:var(--accent-dark);
}
.bearing-multi-list input{ accent-color:var(--accent); }


/* ---------- Карточки: «соседние типоразмеры» и выбор типа ---------- */
.related{ margin-bottom:var(--bearing-gap); }
.related h2{ margin-bottom:24px; }

.related-list{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:14px;
}
.related-list a{
  box-sizing:border-box;
  display:block;
  height:100%;
  padding:16px 20px;
  background:var(--lilac-soft);
  border-radius:15px;
  font-size:16px;
  font-weight:400;
  line-height:1.5;
  color:var(--text);
  transition:transform .18s ease, box-shadow .18s ease;
}
.related-list a:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 25px rgba(15,23,42,.08);
}
.related-list strong{
  display:block;
  margin-bottom:4px;
  font-size:22px;
  font-weight:600;
  color:var(--purple);
}


/* выбор типа на /bearings-nsk/: одна колонка, прижата влево */
.related-list.related-list-one a{ padding:26px 20px; }   /* карточки выбора типа остаются крупными */
.related-list.related-list-one{
  grid-template-columns:minmax(0,520px);
  justify-content:start;
}

/* названия групп на странице типа: по центру */
.bearing-group-title{ text-align:center; }


/* ---------- Ссылка назад ---------- */
.back-to-catalog{
  display:inline-block;
  font-size:16px;
  font-weight:600;
  color:var(--accent);
  transition:.18s ease;
}
.back-to-catalog:hover{
  color:var(--accent-dark);
  transform:translateY(-1px);
}


/* ---------- Каталог типа: списки номеров ---------- */
.bearing-index{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:8px 16px;
  font-size:clamp(16px,1.33vw,19px);
  line-height:1.5;
}
.bearing-index a{
  display:block;
  padding:.45em .8em;
  background:var(--lilac-soft);
  border-radius:7px;
  font-weight:600;
  color:var(--purple);
  transition:.18s ease;
}
.bearing-index a:hover{
  background:var(--accent-soft);
  color:var(--accent-dark);
}


/* ==========================================================================
   Мобильный ≤650px
   ========================================================================== */
@media (max-width:860px){
  .bearing-char,
  .bearing-split-side{ grid-template-columns:minmax(0,1fr); }
  .bearing-drawing{ min-height:0; padding:16px; }
  .bearing-svg{
    position:static;
    display:block;
    width:100%;
    max-width:300px;
    height:auto;
    margin:0 auto;
  }
}

@media (max-width:650px){
  h1{ font-size:34px; }
  h2{ font-size:30px; }

  .bearing-page{ --bearing-gap:56px; padding-bottom:60px; }
  .bearing-hero{ padding:40px 0 var(--bearing-gap); }

  .bearing-filters{ gap:10px 16px; }
  .bearing-filter{ width:100%; justify-content:space-between; }
}