/* ==========================================================================
   Каталог
   ========================================================================== */
.cat-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 48px; flex-wrap: wrap; margin-top: 22px; }
.cat-head__title { display: flex; align-items: baseline; gap: 6px 20px; flex-wrap: wrap; }
.cat-head .h1 { font-size: clamp(3.2rem, 6.6vw, 6.4rem); }
.cat-head__count { font: 800 clamp(1.4rem, 2vw, 1.9rem)/1 var(--f-display); color: var(--ink-3); text-transform: uppercase; }
.cat-head__lead { max-width: 40ch; color: var(--ink-2); }

.cat-tabs { display: flex; gap: 10px; overflow-x: auto; margin: 30px -4px 0; padding: 4px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  display: inline-flex; align-items: center; gap: 12px; flex: none; height: 58px; padding: 6px 20px 6px 6px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 650; white-space: nowrap;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s;
}
.cat-tab:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.cat-tab img, .cat-tab__all { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
.cat-tab__all { display: grid; place-items: center; background: var(--yellow); color: var(--ink); }
.cat-tab small { font-weight: 700; color: var(--ink-3); font-size: 13px; }
.cat-tab[aria-selected='true'] { background: var(--ink); color: var(--bg); box-shadow: none; }
.cat-tab[aria-selected='true'] small { color: var(--on-dark-2); }

.cat-layout { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: clamp(20px, 2.6vw, 36px); margin-top: 28px; align-items: start; }

/* ---------- фильтры ---------- */
.filters {
  position: sticky; top: calc(var(--nav-h) + 26px); max-height: calc(100vh - var(--nav-h) - 44px); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 26px; box-shadow: inset 0 0 0 1px var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.filters__head { display: none; }
.filters__body { padding: 4px 20px 0; }
.filters__foot { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 14px 20px 18px; background: linear-gradient(transparent, var(--surface) 30%); }
.filters__foot [data-apply] { display: none; }
.filters__foot .btn { flex: 1; }
.fgroup { padding: 18px 0; border-bottom: 1px solid var(--line); }
.fgroup:last-child { border-bottom: 0; }
.fgroup__title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font: 750 12.5px/1 var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.fopt { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 15.5px; cursor: pointer; line-height: 1.25; }
.fopt input { appearance: none; width: 22px; height: 22px; flex: none; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--line-2); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s; }
.fopt input::after { content: ''; width: 11px; height: 6px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateY(-2px) rotate(-45deg) scale(0); transition: transform 0.35s var(--ease-spring); }
.fopt input:checked { background: var(--yellow); box-shadow: none; }
.fopt input:checked::after { transform: translateY(-2px) rotate(-45deg) scale(1); }
.fopt input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.fopt:hover input:not(:checked) { box-shadow: inset 0 0 0 1.5px rgba(19, 19, 18, 0.4); }
.fopt__label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fopt__n { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fopt.is-empty { opacity: 0.4; }
.fopt .grade { font-size: 15.5px; font-weight: 500; color: var(--ink); gap: 10px; }
.fopt small { display: block; font-size: 12.5px; color: var(--ink-3); }
.fmore { margin-top: 6px; font-size: 14.5px; font-weight: 650; border-bottom: 1.5px solid currentColor; padding-bottom: 1px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 15.5px; font-weight: 600; }
.switch-row small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
/* цена: два поля и двойной ползунок */
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.price-inputs label { position: relative; }
.price-inputs span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--ink-3); pointer-events: none; }
.price-inputs input { width: 100%; height: 46px; padding: 0 12px 0 34px; border: 0; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line-2); font-size: 15px; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; }
.price-inputs input::-webkit-outer-spin-button, .price-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; }
.price-inputs input:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.range { position: relative; height: 30px; margin: 14px 11px 0; }
.range__track, .range__fill { position: absolute; top: 13px; height: 4px; border-radius: 4px; }
.range__track { left: -11px; right: -11px; background: var(--line-2); }
.range__fill { background: var(--ink); }
.range input { position: absolute; left: -11px; right: -11px; width: calc(100% + 22px); top: 0; height: 30px; margin: 0; appearance: none; background: none; pointer-events: none; }
.range input::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); box-shadow: 0 0 0 2px var(--ink), 0 4px 10px rgba(0, 0, 0, 0.2); cursor: grab; pointer-events: auto; transition: transform 0.3s var(--ease-spring); }
.range input::-moz-range-thumb { width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; background: var(--surface-2); cursor: grab; pointer-events: auto; }
.range input:active::-webkit-slider-thumb { transform: scale(1.15); background: var(--yellow); cursor: grabbing; }
.range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px var(--yellow); }
.price-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.price-presets button { padding: 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 650; box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 0.2s, color 0.2s; }
.price-presets button:hover { background: var(--ink); color: var(--bg); box-shadow: none; }

/* ---------- результаты ---------- */
.results { min-width: 0; }
.results__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; margin-bottom: 18px; }
.results__filter-btn { display: none; gap: 8px; }
.results__filter-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 12.5px; font-weight: 800; line-height: 22px; }
.results__filter-btn:hover .results__filter-n { background: var(--yellow); }
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.achip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; animation: chip-in 0.4s var(--ease-spring); }
.achip .i { width: 16px; height: 16px; opacity: 0.7; transition: opacity 0.2s, transform 0.3s var(--ease); }
.achip:hover .i { opacity: 1; transform: rotate(90deg); }
.achip--clear { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); padding-right: 14px; }
@keyframes chip-in { from { opacity: 0; transform: scale(0.8); } }
.sort { position: relative; display: flex; align-items: center; margin-left: auto; }
.sort .i { position: absolute; left: 14px; pointer-events: none; color: var(--ink-2); }
.sort select {
  height: 44px; padding: 0 40px 0 40px; border: 0; border-radius: 999px; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23131312' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
  box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; font-weight: 600; outline: none;
}
.sort select:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.pgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pgrid .pcard.is-new { animation: card-in 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(22px) scale(0.98); } }
.results__more { display: flex; justify-content: center; margin-top: 40px; }
.empty__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.filters-scrim { display: none; }

/* ---------- адаптив ---------- */
@media (max-width: 1240px) { .pgrid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .cat-layout { grid-template-columns: 1fr; }
  .pgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .results__filter-btn { display: inline-flex; }
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 80; max-height: min(88dvh, 760px); border-radius: 28px 28px 0 0;
    box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.4); transform: translateY(105%); transition: transform 0.55s var(--ease-2); visibility: hidden;
  }
  .filters.is-open { transform: none; visibility: visible; }
  .filters__head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 12px 10px 20px; background: var(--surface); }
  .filters__head::before { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
  .filters__head h2 { font: 900 2rem/1 var(--f-display); text-transform: uppercase; }
  .filters__foot [data-apply] { display: inline-flex; flex: 1.6; }
  .filters-scrim { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(19, 19, 18, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease); }
  .filters-scrim.is-open { opacity: 1; pointer-events: auto; }
}
@media (max-width: 900px) { .pgrid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .cat-head__lead { display: none; }
  .cat-tab { height: 50px; padding-right: 16px; gap: 10px; font-size: 15px; }
  .cat-tab img, .cat-tab__all { width: 38px; height: 38px; }
  .results__bar { gap: 8px; }
  .active-chips { order: 3; flex-basis: 100%; }
  .results__filter-btn { flex: 1; }
  .sort { flex: 1; margin-left: 0; }
  .sort select { width: 100%; font-size: 14px; padding-right: 34px; }
}
@media (max-width: 370px) { .pgrid--3 { grid-template-columns: 1fr; } }
