/* =========================================================
   ЦифроKey — catalog.css (простой каталог)
   ========================================================= */

.cat-page { padding-bottom: 24px; }

.cat-head { padding: 6px 0 22px; }
.cat-head__desc { margin-top: 10px; max-width: 560px; font-size: 17px; color: var(--ink-2); }

/* ---------- панель: поиск · категории · сортировка ---------- */
.cat-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "search brand sort" "chips chips chips" "count count count"; gap: 12px; align-items: center;
}
.cat-search { grid-area: search; position: relative; min-width: 0; }
.cat-search input {
  width: 100%; height: 48px; padding: 0 46px 0 46px; border-radius: 999px; outline: 0;
  background: var(--bg-elev); border: 1.5px solid var(--line); font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.cat-search input::-webkit-search-cancel-button { display: none; }
.cat-search input::placeholder { color: var(--muted); }
.cat-search input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.cat-search__ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: grid; }
.cat-search__ico svg { width: 19px; height: 19px; }
.cat-search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 999px;
  display: grid; place-items: center; background: var(--bg-sunk);
}

.cat-chips {
  grid-area: chips; position: relative; display: flex; gap: 8px; min-width: 0;
  overflow-x: auto; scrollbar-width: none; padding: 2px;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { height: 44px; padding: 0 16px 0 8px; gap: 8px; flex: none; }
.cat-chip__ico { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--bg-sunk); }
.cat-chip__ico svg { width: 16px; height: 16px; }
.cat-chip.is-active .cat-chip__ico { background: var(--accent); color: var(--accent-ink); }
.cat-sort.cat-brand { grid-area: brand; min-width: 0; width: 260px; contain: inline-size; }
.cat-brand select { width: 100%; text-overflow: ellipsis; }

.cat-sort { grid-area: sort; position: relative; color: var(--ink-2); }
.cat-sort::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg);
}
.cat-sort select {
  appearance: none; -webkit-appearance: none; height: 48px; padding: 0 42px 0 18px; border-radius: 999px; outline: 0; cursor: pointer;
  background: var(--bg-elev); border: 1.5px solid var(--line); font-size: 15px; font-weight: 600; color: var(--ink);
}
.cat-sort select:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.cat-sort select option { background: var(--bg-elev); color: var(--ink); }

.cat-count { grid-area: count; margin: 6px 2px 4px; font-size: 15px; color: var(--muted); }
.cat-count b { color: var(--ink); font-weight: 650; }

/* ---------- сетка ---------- */
.cat-grid { min-height: 240px; margin-top: 14px; }
.cat-in { animation: cardIn .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
.cat-grid.is-empty { display: block; }
.cat-more { display: flex; justify-content: center; margin-top: 28px; }

.cat-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 16px 40px; }
.cat-empty__art { width: 72px; height: 72px; margin-bottom: 6px; border-radius: 22px; display: grid; place-items: center; background: var(--bg-sunk); }
.cat-empty__art svg { width: 30px; height: 30px; }
.cat-empty p { max-width: 420px; margin-bottom: 8px; }
.cat-sugg { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 24px 0 16px; }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
}
@media (max-width: 640px) {
  .cat-head { padding: 0 0 16px; }
  .cat-head__desc { font-size: 15px; }
  .cat-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "search search" "chips chips" "brand brand" "count sort"; gap: 10px 8px; }
  .cat-sort.cat-brand { width: auto; }
  .cat-brand select { height: 44px; font-size: 14px; }
  .cat-more .btn { width: 100%; }
  .cat-chips { margin: 0 -16px; padding: 2px 16px; scroll-padding: 0 16px; }
  .cat-chip { height: 40px; padding: 0 14px 0 6px; }
  .cat-chip__ico { width: 28px; height: 28px; }
  .cat-sort:not(.cat-brand) { justify-self: end; }
  .cat-sort:not(.cat-brand) select { height: 38px; font-size: 14px; padding: 0 36px 0 14px; background: transparent; border-color: transparent; }
  .cat-sort::after { right: 14px; }
  .cat-count { margin: 0 2px; font-size: 14px; }
}
