/* ============================================================
   Страницы каталога: раздел и подраздел
   ============================================================ */

.cat-main{padding-bottom:96px}

/* ---------- шапка ---------- */
.cat-head{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px 28px;
  margin:26px 0 0;
  padding-bottom:22px;
  border-bottom:1px solid var(--line);
}
.cat-head__title{
  font-family:var(--font-heading);
  font-weight:800;
  font-size:clamp(26px,3vw,38px);
  line-height:1.1;
  letter-spacing:-.022em;
  margin:0;
  color:var(--ink-900);
}
.cat-head__count{
  margin:0 0 4px;
  font-size:13.5px;
  color:var(--ink-400);
}
.cat-head__count b{color:var(--ink-900);font-weight:700}

/* ---------- подразделы ---------- */
.cat-subs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:20px 0 0;
}
.cat-sub{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 12px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12.5px;
  line-height:1.2;
  color:var(--ink-600);
  background:var(--white);
  transition:border-color .15s ease,color .15s ease,background .15s ease;
}
.cat-sub:hover{border-color:#C9CDD1;color:var(--ink-900)}
.cat-sub__n{
  font-size:11px;
  font-weight:700;
  color:var(--ink-400);
}
.cat-sub.is-active{
  border-color:var(--red-600);
  color:var(--red-600);
  background:#FFF6F4;
}
.cat-sub.is-active .cat-sub__n{color:var(--red-600)}

/* раскрывающийся список остальных подразделов */
.cat-subs__rest{margin-top:10px}
.cat-subs__toggle{
  display:inline-block;
  cursor:pointer;
  font-size:12.5px;
  font-weight:600;
  color:var(--red-600);
  padding:4px 0;
  list-style:none;
}
.cat-subs__toggle::-webkit-details-marker{display:none}
.cat-subs__toggle::after{content:" ↓";font-weight:400}
.cat-subs__rest[open] .cat-subs__toggle::after{content:" ↑"}
.cat-subs__rest .cat-subs{margin-top:6px}

/* ---------- сетка ---------- */
.cat-grid{margin-top:26px}

/* ---------- пагинация ---------- */
.cat-pager{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin-top:34px;
}
.cat-pager__link{
  min-width:38px;
  height:38px;
  padding:0 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:8px;
  font-size:13px;
  font-weight:600;
  color:var(--ink-600);
  background:var(--white);
  transition:border-color .15s ease,color .15s ease;
}
.cat-pager__link:hover{border-color:#C9CDD1;color:var(--ink-900)}
.cat-pager__link.is-active{
  border-color:var(--ink-900);
  background:var(--ink-900);
  color:var(--white);
}
.cat-pager__link.is-disabled{
  opacity:.4;
  pointer-events:none;
}
.cat-pager__gap{
  padding:0 4px;
  color:var(--ink-400);
  font-size:13px;
}

/* ---------- пустой раздел ---------- */
.cat-empty{
  margin-top:30px;
  padding:34px 26px;
  border:1px dashed var(--line);
  border-radius:var(--radius-md);
  color:var(--ink-600);
  font-size:14.5px;
  line-height:1.6;
}

/* ---------- корневая страница: плитки разделов ---------- */
.cat-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:26px;
}
.cat-card{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:18px 18px 17px;
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  background:var(--white);
  transition:box-shadow .18s ease,border-color .18s ease,transform .18s ease;
}
.cat-card:hover{
  border-color:transparent;
  box-shadow:var(--shadow-md);
  transform:translateY(-1px);
}
.cat-card__icon{
  flex:none;
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cat-card__icon img{width:44px;height:44px;object-fit:contain}
.cat-card__body{display:flex;flex-direction:column;gap:3px;min-width:0}
.cat-card__title{
  font-family:var(--font-heading);
  font-weight:700;
  font-size:15.5px;
  line-height:1.25;
  color:var(--ink-900);
}
.cat-card__count{font-size:12.5px;font-weight:600;color:var(--red-600)}
.cat-card__subs{
  font-size:11.5px;
  line-height:1.45;
  color:var(--ink-400);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

@media (max-width:1100px){
  .cat-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .cat-cards{grid-template-columns:1fr;gap:10px}
  .cat-card{padding:14px}
}

/* ---------- нижний блок «весь каталог» ---------- */
.cat-back{
  display:flex;
  flex-wrap:wrap;
  gap:10px 18px;
  align-items:center;
  margin-top:40px;
  padding-top:22px;
  border-top:1px solid var(--line);
  font-size:13.5px;
  color:var(--ink-400);
}
.cat-back a{color:var(--ink-600);font-weight:600}
.cat-back a:hover{color:var(--red-600)}

@media (max-width:1100px){
  .cat-head{margin-top:20px;padding-bottom:18px}
  .cat-grid{margin-top:22px}
}
@media (max-width:640px){
  .cat-head__title{font-size:24px}
  .cat-sub{font-size:12px;padding:6px 10px 7px}
  .cat-pager__link{min-width:34px;height:34px;font-size:12.5px}
}
