.cat-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 26px 0 8px; margin: 0 calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding-top: 22px; padding-bottom: 90px; align-items: start; }

/* ---------- Фильтры ---------- */
.filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; scrollbar-width: thin; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.filters-head { display: none; }
.filters-foot { display: none; }
.fgroup { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.fgroup:last-child { border-bottom: 0; }
.fgroup h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.fgroup h4 button { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--text-2); font-weight: 600; }
.opt { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 15px; color: var(--text-2); }
.opt:hover { color: var(--text); }
.opt input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; margin: 0; flex: none; transition: .15s; cursor: pointer; }
.opt input:checked { background: var(--red); border-color: var(--red); }
.opt input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.opt input:disabled + span { opacity: .4; }
.opt .n { margin-left: auto; font-size: 13px; color: var(--muted); }
.opt-more { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 6px; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--text-2); transition: .15s; }
.pill:hover { color: var(--text); border-color: var(--line-3); }
.pill.is-on { background: var(--text); color: var(--on-text); border-color: var(--text); }
.pill:disabled { opacity: .35; pointer-events: none; }

.range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-inputs input { height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 0 12px; width: 100%; font-size: 14px; outline: none; }
.range-inputs input:focus { border-color: var(--red); }
.dual { position: relative; height: 28px; margin-top: 10px; }
.dual input { position: absolute; inset: 0; width: 100%; pointer-events: none; -webkit-appearance: none; appearance: none; background: none; height: 28px; margin: 0; }
.dual input::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid var(--red); cursor: pointer; position: relative; z-index: 2; margin-top: 0; }
.dual input::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 5px solid var(--red); cursor: pointer; }
.dual input::-webkit-slider-runnable-track { background: none; height: 28px; }
.dual input::-moz-range-track { background: none; }
.dual .track { position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 6px; background: var(--surface-3); }
.dual .fill { position: absolute; top: 11px; height: 6px; border-radius: 6px; background: var(--red); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; cursor: pointer; font-size: 15px; color: var(--text-2); }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); position: relative; margin: 0; cursor: pointer; transition: .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s var(--ease); }
.switch input:checked { background: var(--red); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- Результаты ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.search:focus-within { border-color: var(--red); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; background: none; outline: none; width: 100%; height: 100%; font-size: 15px; }
.sort select { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; padding: 0 38px 0 14px; appearance: none; -webkit-appearance: none; font-weight: 600; font-size: 14px; outline: none; cursor: pointer; }
.filters-open { display: none; height: 46px; }
.fcount:not(:empty) { background: var(--red); color: #fff; border-radius: 99px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; display: inline-grid; place-items: center; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.active-chips:empty { display: none; }
.active-chips button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.active-chips button::after { content: "×"; font-size: 17px; line-height: 1; color: var(--muted); }
.active-chips button:hover::after { color: var(--red-hi); }
.active-chips .reset-all { background: none; border: 0; color: var(--muted); }
.active-chips .reset-all::after { content: none; }

.results .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty .hero-cta { justify-content: center; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.cat-note { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 28px; padding: 22px 24px; border-radius: var(--r); background: linear-gradient(100deg, var(--red-soft), transparent 60%), var(--surface); border: 1px solid var(--line); }
.cat-note b { display: block; margin-bottom: 4px; }
.cat-note span { font-size: 14px; }

/* ---------- Адаптив: фильтры — нижняя шторка ---------- */
@media (max-width: 980px) {
  .cat-layout { grid-template-columns: 1fr; }
  .filters-open { display: inline-flex; }
  .filters {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 70; max-height: 88dvh; border-radius: 22px 22px 0 0;
    display: flex; flex-direction: column; transform: translateY(105%); transition: transform .4s var(--ease); border: 1px solid var(--line-2);
  }
  .filters.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .filters-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
  .filters-head b { font-size: 18px; }
  .filters-body { overflow: auto; flex: 1; }
  .filters-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .filters-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transition: .3s; }
  .filters-backdrop.is-on { opacity: 1; visibility: visible; }
}
@media (max-width: 560px) {
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .filters-open, .sort { flex: 1; }
  .sort select { width: 100%; }
  .results .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .results .card-body { padding: 12px; gap: 7px; }
  .results .card-title { font-size: 15px; }
  .results .card-specs span { font-size: 11px; padding: 3px 6px; }
  .results .card-specs span:nth-child(n+3) { display: none; }
  .results .price { font-size: 17px; }
  .results .price-month { font-size: 11px; }
  .results .card-type { font-size: 10.5px; }
  .results .stock { font-size: 11.5px; }
  .results .card-tools button { width: 32px; height: 32px; }
  .cat-note { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 360px) { .results .grid { grid-template-columns: 1fr; } }

/* ---------- Страницы ---------- */
.pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 34px 0 6px; }
.pages:empty { display: none; }
.pg { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; transition: border-color .2s, background .2s; }
.pg:hover:not(:disabled) { border-color: var(--line-2); }
.pg.is-on { background: var(--text); color: var(--on-text); border-color: var(--text); }
.pg:disabled:not(.is-on) { opacity: .35; cursor: default; }
.pg-gap { color: var(--muted); padding: 0 4px; }
.grid.is-loading { opacity: .45; pointer-events: none; transition: opacity .2s; }
.chip:disabled { opacity: .4; cursor: default; }

/* ---------- Навигация по разделам ---------- */
.cat-head { position: relative; }
.cat-all { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.cat-all .ico { width: 16px; height: 16px; }
.cat-all:hover { color: var(--text); }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 4px; }
.subcat { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-2); transition: .2s; }
.subcat span { color: var(--muted); font-weight: 600; font-size: 13px; }
.subcat:hover { border-color: var(--line-3); color: var(--text); }
.subcat.is-on { background: var(--text); color: var(--on-text); border-color: var(--text); }
.subcat.is-on span { color: inherit; opacity: .6; }
.subcats:not(.is-open) [data-extra] { display: none; }
.subcat-more { border-style: dashed; color: var(--text); }
.subcats.is-open .subcat-more { display: none; }

/* корень каталога: разделы плитками */
.cat-search { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; padding: 6px 6px 6px 18px; max-width: 760px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); position: relative; }
.cat-search:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.cat-search .ico { color: var(--muted); }
.cat-search input { flex: 1; min-width: 0; height: 48px; background: none; border: 0; outline: none; font-size: 16px; }
.ctiles-h { font: 800 13px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 40px 0 14px; }
.ctiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.ctile { display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, transform .3s var(--ease); }
.ctile:hover { border-color: var(--red); transform: translateY(-2px); }
.ctile-img { width: 76px; height: 60px; border-radius: 10px; background: #fff; flex: none; overflow: hidden; }
.ctile-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ctile-txt { display: grid; gap: 2px; min-width: 0; }
.ctile-txt b { font-size: 16px; line-height: 1.25; }
.ctile-txt small { color: var(--text-2); font-size: 13px; font-weight: 600; }
.ctile-go { margin-left: auto; color: var(--muted); transition: transform .2s, color .2s; }
.ctile:hover .ctile-go { color: var(--red-hi); transform: translateX(3px); }

/* фильтры: сворачиваемые группы */
.fgroup > h4 { cursor: pointer; user-select: none; align-items: center; }
.fgroup > h4 .fg-arrow { margin-left: 8px; transition: transform .2s; width: 16px; height: 16px; }
.fgroup.is-closed > h4 .fg-arrow { transform: rotate(-90deg); }
.fgroup.is-closed > h4 { margin-bottom: 0; }
.fgroup.is-closed > :not(h4) { display: none; }
.fgroup h4 .fg-title { display: inline-flex; align-items: center; gap: 8px; }
.fgroup h4 .fg-on { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.opt-search { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 0 12px; font-size: 14px; outline: none; margin-bottom: 6px; }
.opt-search:focus { border-color: var(--red); }
.opt-list { max-height: 260px; overflow: auto; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; }
.size-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.size-sub:first-of-type { margin-top: 0; }
.relaxed-note { padding: 10px 14px; border-radius: 12px; background: var(--red-soft); font-size: 14px; margin: 0 0 14px; }
.pg.is-dis { opacity: .35; display: grid; place-items: center; }
a.pg, span.pg { display: inline-grid; place-items: center; }
@media (max-width: 980px) { .cat-all { margin-left: 0; flex-basis: 100%; } }
@media (max-width: 560px) {
  .subcat { height: 36px; padding: 0 12px; font-size: 13.5px; }
  .ctiles { grid-template-columns: 1fr; }
}

/* ---------- Корзина ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin: 18px 0 80px; }
.cart-list { display: grid; gap: 12px; }
.cart-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto 40px; gap: 16px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--card-border, var(--line-2)); }
.cart-img { width: 96px; height: 72px; border-radius: 10px; background: #fff; overflow: hidden; display: block; }
.cart-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-info { display: grid; gap: 4px; min-width: 0; }
.cart-name { font-weight: 700; line-height: 1.25; }
.cart-name:hover { color: var(--red-hi); }
.cart-info .muted { font-size: 13px; }
.cart-info .stock { font-size: 13px; }
.cart-qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.cart-qty button { width: 36px; height: 38px; font-size: 18px; font-weight: 700; color: var(--text-2); }
.cart-qty button:hover { background: var(--tint-2); color: var(--text); }
.cart-qty b { min-width: 28px; text-align: center; }
.cart-price { display: grid; justify-items: end; min-width: 110px; }
.cart-price b { font-size: 18px; white-space: nowrap; }
.cart-price small { font-size: 12.5px; white-space: nowrap; }
.cart-sum { position: sticky; top: calc(var(--header-h, 72px) + 16px); display: grid; gap: 14px; padding: 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--card-border, var(--line-2)); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total b { font-size: 28px; font-weight: 800; }
.cart-sum p { font-size: 13.5px; line-height: 1.5; }
.cart-clear { justify-self: center; font-size: 13.5px; color: var(--muted); }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } .cart-sum { position: static; } }
@media (max-width: 560px) {
  .cart-row { grid-template-columns: 72px minmax(0, 1fr) 32px; gap: 10px 12px; }
  .cart-img { grid-column: 1; grid-row: 1; width: 72px; height: 56px; } .cart-info { grid-column: 2; grid-row: 1; } .cart-del { grid-column: 3; grid-row: 1; align-self: start; width: 32px; height: 32px; }
  .cart-qty { grid-column: 1 / 3; grid-row: 2; justify-self: start; } .cart-price { grid-column: 2 / 4; grid-row: 2; justify-self: end; align-self: center; }
}

/* корзина: «Не забудьте» */
.cart-x { grid-column: 1; margin-top: 18px; }
.cart-x h2 { margin-bottom: 14px; }
.cart-x-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.cart-x-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.cart-x-card > .xs-size, .cart-x-card > .btn { grid-column: 1 / -1; }
.cart-x-img { position: relative; width: 72px; aspect-ratio: 1; border-radius: var(--r-s); background: #fff; overflow: hidden; }
.cart-x-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-x-card > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-x-label { font: 700 10.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cart-x-name { font-size: 14px; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-x-name:hover { color: var(--red); }
.cart-x .xs-size { width: 100%; height: 36px; padding: 0 10px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
