.shop-listing {
  min-height: 55vh;
  padding: 0 0 80px;
}
.shop-crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 20px 0;
  color: var(--mk-color-fg-secondary);
  font-size: 14px;
  line-height: 20px;
}
.shop-crumbs > * { flex: none; }
.shop-crumbs a, .shop-crumbs button, .shop-crumbs [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.shop-crumbs [aria-current] { color: var(--mk-color-fg-primary); }
.shop-crumbs button, .shop-reset {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
}
.shop-heading {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.shop-heading h1 {
  display: flex;
  align-items: start;
  gap: 12px;
  margin: 0;
  font: 700 40px/44px var(--mk-font-heading);
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.shop-heading .mk-thread {
  flex: none;
  height: 1lh;
}
.shop-heading > span {
  padding-bottom: 4px;
  color: var(--mk-color-fg-secondary);
  font-size: 16px;
}
.shop-heading + .shop-category-grid { margin-top: 24px; }
.shop-catalog-root .shop-category b { max-width: 100%; }
.shop-heading + .shop-blank { margin: 24px 0; }
.shop-subcats, .shop-fast, .shop-selected, .shop-facets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.shop-subcats {
  margin-top: 24px;
}
.shop-subcats:not(.expanded) [data-child]:nth-of-type(n+10) { display: none; }
.shop-chip, .shop-facet > span {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 16px;
  border: 1px solid var(--mk-color-border-subtle);
  border-radius: var(--mk-radius-chip);
  color: var(--mk-color-fg-primary);
  background: var(--mk-color-bg-surface);
  font: 500 15px/20px var(--mk-font-body);
  white-space: nowrap;
}
.shop-chip:is(.active,[aria-pressed="true"],[aria-current="page"]),
.shop-facet input:checked + span {
  border-color: var(--mk-color-fg-primary);
  color: var(--mk-color-fg-inverse);
  background: var(--mk-color-fg-primary);
}
.shop-chip.active .shop-icon { filter: invert(1); }
.shop-chip .shop-icon { pointer-events: none; }
.shop-subcats:not(:has([data-child]:nth-of-type(10))) .shop-all-cats { display: none; }
.shop-listframe {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 40px;
  margin-top: 32px;
}
.shop-side { min-width: 0; }
[data-controls] fieldset {
  position: relative;
  margin: 0;
  min-width: 0;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--mk-color-border-subtle);
}
[data-controls] fieldset:first-child { padding-top: 0; }
[data-controls] fieldset:last-child { border-bottom: 0; }
[data-controls] legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font: 600 15px/22px var(--mk-font-body);
}
[data-controls] legend + * { clear: both; }
.shop-ranges { display: flex; gap: 8px; }
.shop-ranges label { flex: 1; min-width: 0; color: var(--mk-color-fg-secondary); font: 400 14px/20px var(--mk-font-body); }
.shop-ranges input {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid var(--mk-color-border-strong);
  border-radius: var(--mk-radius-control);
  color: var(--mk-color-fg-primary);
  background: var(--mk-color-bg-surface);
  font: 400 16px/24px var(--mk-font-body);
}
.shop-filter-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
}
.shop-filter-item input { flex: none; width: 20px; height: 20px; margin: 0; appearance: none; display: grid; place-content: center; cursor: pointer; border: 1px solid var(--mk-color-border-strong); border-radius: 4px; background: var(--mk-color-bg-surface); }
.shop-filter-item input:checked { background: var(--mk-color-action-primary-bg); border-color: var(--mk-color-action-primary-bg); }
.shop-filter-item input:checked::after { content: ""; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.shop-filter-item input:disabled { opacity: .5; cursor: default; }
@media (forced-colors: active) { .shop-filter-item input { appearance: auto; } .shop-filter-item input:checked::after { content: none; } }
.shop-ranges input:focus { border-color: var(--mk-color-border-focus); }
.shop-filter-item input:focus-visible + span { text-decoration: underline; text-underline-offset: .2em; }
.shop-facet { position: relative; max-width: 100%; }
.shop-facet > span { cursor: pointer; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.shop-facet input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.shop-facet input:focus-visible + span { border-color: currentColor; text-decoration: underline; text-underline-offset: .18em; }
.shop-facet small { font-size: 13px; color: var(--mk-color-fg-secondary); }
.shop-facet input:checked + span small { color: var(--mk-color-fg-inverse); }
.shop-results {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.shop-filter-launch, .shop-sort, .shop-modes button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: var(--mk-radius-control);
  color: var(--mk-color-fg-primary);
  background: transparent;
}
.shop-toolbar .shop-filter-launch { display: none; }
.shop-filter-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%;
  color: var(--mk-color-action-primary-fg); background: var(--mk-color-action-primary-bg); font: 600 13px/1 var(--mk-font-body);
}
.shop-sort { position: relative; min-width: 0; }
.shop-sort-face {
  display: grid;
  grid-template-columns: 20px minmax(0, auto) 16px;
  align-items: center;
  gap: 8px;
  padding-block: 6px;
  font: 500 15px/20px var(--mk-font-body);
  text-align: center;
}
.shop-sort select, .shop-sort .mk-select-trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.shop-sort:has(.mk-select-trigger[aria-expanded="true"]) .shop-sort-face > img:last-child { transform: rotate(180deg); }
.shop-sort .mk-select-options { font: 500 15px/20px var(--mk-font-body); }
.shop-sort:has(:focus-visible), .shop-sort:active { background: var(--mk-color-bg-plate); }
.shop-shown { margin-left: auto; font-size: 15px; color: var(--mk-color-fg-secondary); white-space: nowrap; }
.shop-modes { display: flex; border: 1px solid var(--mk-color-border-subtle); border-radius: var(--mk-radius-control); }
.shop-modes button { width: 44px; padding: 0; }
.shop-modes [aria-pressed="true"] { background: var(--mk-color-bg-subtle); }
.shop-fast { scroll-margin-top: calc(var(--listing-header-height, 64px) + 16px); }
.shop-selected .shop-reset { padding: 0 8px; min-height: 44px; font-size: 15px; font-weight: 600; }
.shop-products {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 28px 16px;
}
.shop-placeholder { gap: 12px; }
.pending-count { visibility: hidden; }
.shop-placeholder > div { aspect-ratio: 1; border-radius: var(--mk-radius-plate); background: var(--mk-color-bg-plate); }
.shop-placeholder > i { width: 70%; height: 14px; border-radius: var(--mk-radius-control); background: var(--mk-color-bg-subtle); }
.shop-placeholder > i:last-child { width: 45%; }
.shop-products.shop-rows { display: flex; flex-direction: column; gap: 0; border-bottom: 1px solid var(--mk-color-border-subtle); }
.shop-listing .shop-blank { padding: 32px; text-align: start; }
.shop-listing .shop-blank h2 { font: 600 20px/26px var(--mk-font-body); }
.shop-listing .shop-blank p { margin: 0 0 16px; color: var(--mk-color-fg-secondary); }
.shop-blank:has(> [data-edit-query]) > .mk-button { display: flex; width: 100%; }
.shop-blank:has(> [data-edit-query]) > .mk-button + .mk-button { margin-block-start: 15px; }
.shop-more.mk-button { align-self: center; margin: 16px auto 0; background: transparent; color: var(--mk-color-fg-primary); border-color: var(--mk-color-border-strong); }
.shop-brand-intro { display: flex; align-items: center; gap: 16px; margin-top: 16px; font-size: 18px; }
.shop-brand-intro img { width: 120px; height: 72px; object-fit: cover; border-radius: var(--mk-radius-card); }
@media (hover: hover) {
  :where(body:not(.app-screen)) {
  .shop-crumbs :is(a,button):hover, .shop-reset:hover { color: var(--mk-color-fg-primary); text-decoration: underline; text-underline-offset: 4px; }
  .shop-chip:enabled:hover, .shop-facet:hover > span { border-color: var(--mk-color-border-strong); }
  .shop-chip:enabled:not(.active,[aria-pressed="true"],[aria-current="page"]):hover,
  .shop-facet:hover input:not(:checked) + span, .shop-filter-item:hover input:enabled:not(:checked),
  .shop-filter-launch:hover { background: var(--mk-color-bg-subtle); }
  .shop-filter-item:hover input:enabled:checked { background: var(--mk-color-action-primary-hover); }
  .shop-sort:where(:hover) { background: var(--mk-color-bg-subtle); }
  .shop-modes button:hover, .shop-more.mk-button:hover { background: var(--mk-color-bg-plate); }
  }
}
@media (max-width: 1023px) and (min-width: 768px) {
  .shop-catalog-root .shop-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-listframe { grid-template-columns: 210px minmax(0,1fr); gap: 20px; }
  .shop-products { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px 12px; }
}
@media (max-width: 767px) {
  .shop-listing { padding: 16px 0 48px; }
  .shop-catalog-root { padding-block: 24px 64px; }
  .shop-crumbs, .shop-side, .shop-shown, .shop-filter-launch-desktop { display: none; }
  .shop-heading h1 { font-size: 28px; line-height: 32px; }
  .shop-catalog-root .shop-category-grid { gap: 20px 12px; }
  .shop-subcats, .shop-listframe { margin-top: 16px; }
  .shop-subcats, .shop-fast, .shop-selected {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .shop-subcats.expanded { flex-wrap: wrap; }
  .shop-subcats .shop-all-cats { display: inline-flex; }
  .shop-subcats:not(:has([data-child]:nth-of-type(10))) .shop-all-cats { display: inline-flex; }
  .shop-listframe { display: block; }
  .shop-toolbar {
    position: sticky; top: var(--listing-header-height, 99px); z-index: 3;
    justify-content: flex-start;
    gap: 8px;
    margin-inline: -16px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--mk-color-border-subtle);
    background: var(--mk-color-bg-page);
  }
  .shop-toolbar .shop-filter-launch {
    display: inline-flex; gap: 6px; padding: 0 12px;
    background: var(--mk-color-action-secondary-bg);
    font: 600 15px/20px var(--mk-font-body);
  }
  .shop-sort { flex: 0 1 auto; }
  .shop-modes { margin-left: auto; border: 0; }
  .shop-modes [aria-pressed="true"] { display: none; }
  .shop-products { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 12px; }
  .shop-listing .shop-blank { padding: 24px; }
  .shop-filter-sheet {
    position: fixed;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    max-height: 85dvh;
    margin: auto 0 0;
    padding: 0;
    border-radius: var(--mk-radius-sheet) var(--mk-radius-sheet) 0 0;
    overflow: hidden;
  }
  .shop-filter-sheet[open] { display: flex; }
  .shop-filter-sheet .shop-dialog-title { flex: none; margin: 0; padding: 12px 16px 0; }
  .shop-filter-sheet .shop-dialog-title h2 { font: 600 18px/24px var(--mk-font-body); }
  .shop-filter-sheet [data-controls] { overflow: auto; min-height: 0; padding: 8px 16px; }
  .shop-panel-actions { display: flex; flex: none; gap: 8px; padding: 16px 16px max(32px, env(safe-area-inset-bottom)); border-top: 1px solid var(--mk-color-border-subtle); }
  .shop-panel-actions [data-apply] { flex: 1; }
}
.shop-facets + .shop-ranges { margin-top: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .shop-sort, .shop-filter-item input, .shop-facet > span, .shop-sort [role="option"] {
    transition: background-color .14s, border-color .14s, color .14s;
  }
  /* После пересчёта выдачи выбранный фильтр появляется в новом DOM-узле. */
  @starting-style {
    .shop-chip.shop-toggled[aria-pressed="true"], .shop-facet input.shop-toggled:checked + span,
    .shop-filter-item input.shop-toggled:enabled:checked { background-color: var(--mk-color-bg-surface); }
    .shop-chip.shop-toggled[aria-pressed="false"], .shop-facet input.shop-toggled:not(:checked) + span {
      background-color: var(--mk-color-fg-primary);
    }
    .shop-filter-item input.shop-toggled:not(:checked) { background-color: var(--mk-color-action-primary-bg); }
  }
}
