/* Каталог: заголовок, категории, фильтры (на телефоне и планшете лист снизу), сетка. */
.cat-head { padding-top: 48px; }
.cat-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.cat-top .mk-body { margin-top: 8px; }
.cat-tools { display: flex; align-items: flex-end; gap: 12px; }
.cat-sort { min-width: 220px; }
.cat-open { display: none; }
.cat-cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0 20px; }
.cat-bar { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; min-height: 44px; margin-bottom: 16px; }
.cat-bar[hidden], .cat-qchip[hidden], .cat-linkbtn[hidden] { display: none; }
.cat-count { color: var(--ink-soft); }
.cat-qchip { display: inline-flex; align-items: center; gap: 6px; }
.cat-qchip .mk-i { width: 16px; height: 16px; }
.cat-linkbtn { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--cobalt); font: 600 14px/20px var(--font-sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.cat-linkbtn:hover { color: var(--cobalt-deep); }

.cat-lay { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: var(--space-9); }
.cat-filters { position: sticky; top: 104px; display: grid; gap: 24px; }
.cat-sheet__head { display: block; }
.cat-sheet__grip, .cat-sheet__x, .cat-sheet__foot { display: none; }
.cat-sheet__body { display: grid; gap: 28px; }
.cat-blk { display: grid; gap: 12px; }
.cat-swatches { gap: 14px 12px; }
.cat-swatches .mk-swatch::after { display: none; }
.mk-ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ink); pointer-events: none; opacity: 0; }
.mk-swatch[aria-checked="true"] .mk-ring { opacity: 1; }
.cat-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-blk .mk-options .mk-option { min-height: 40px; padding: 0 14px; font-size: 14px; }

.cat-main { min-width: 0; }
.cat-grid { position: relative; }
.cat-grid .is-flip { transition: none !important; }
.cat-grid .is-leaving { position: absolute; pointer-events: none; margin: 0; }
.cat-empty { grid-column: 1 / -1; display: grid; gap: 20px; justify-items: start; max-width: 560px; }
.cat-empty .mk-btn { justify-self: start; }
.cat-empty--fav { justify-items: center; text-align: center; max-width: none; padding: 48px 0 24px; }
.cat-empty--fav .mk-stitch { width: min(320px, 100%); }
.cat-more { display: flex; justify-content: center; margin-top: 56px; }
.cat-more[hidden] { display: none; }

.cat-dim { position: fixed; inset: 0; z-index: 58; background: rgba(28, 27, 25, .38); }
.cat-dim[hidden] { display: none; }

/* планшет и телефон: фильтры листом снизу */
@media (max-width: 1023px) {
  .cat-open { display: inline-flex; }
  .cat-lay { grid-template-columns: minmax(0, 1fr); padding-bottom: var(--space-8); }
  .cat-filters { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 59; display: none; grid-template-rows: auto minmax(0, 1fr) auto; gap: 0; max-height: min(88dvh, 720px); background: var(--porcelain); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-2); will-change: transform; }
  .cat-filters.is-open { display: grid; }
  .cat-sheet__head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 22px 8px 4px 20px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  .cat-sheet__head.is-drag { cursor: grabbing; }
  .cat-sheet__grip { display: block; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
  .cat-sheet__x { display: grid; }
  .cat-sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 20px; gap: 28px; }
  .cat-sheet__foot { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--porcelain); }
  .cat-swatches { gap: 14px; }
}
@media (max-width: 767px) {
  .cat-head { padding-top: 24px; }
  .cat-top { flex-direction: column; align-items: stretch; gap: 16px; }
  .cat-tools { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 10px; }
  .cat-sort { min-width: 0; }
  .cat-open { padding: 0 16px; }
  .cat-sort .mk-select { padding-left: 12px; padding-right: 34px; background-position: right 10px center; font-size: 15px; }
  .cat-sort > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cat-cats { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px 8px; padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cat-cats::-webkit-scrollbar { display: none; }
  .cat-cats .mk-option { flex: none; }
  .cat-more { margin-top: 36px; }
  .cat-empty--fav { padding-top: 24px; }
}
.cat-cats .mk-option[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--porcelain); }
.mk-swatch:not([aria-checked="true"]) .mk-ring { opacity: 0 !important; }
.mk-swatch[aria-checked="true"] .mk-ring { opacity: 1 !important; animation: mk-ring-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes mk-ring-pop { from { transform: scale(.55); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mk-swatch .mk-ring { animation: none !important; } }
