/* см. docs/design/07-asset-notes.md */
:root {
  --pf-brand: #379ccb;
  --pf-brand-700: #147aa8;
  --pf-border: #d8dfe1;
  --pf-muted: #808080;
  --pf-text: #2b2f33;
  --pf-bg: #fff;
  --pf-radius: 8px;
  --pf-radius-sm: 4px;
  --pf-shadow: 0 4px 16px rgba(0, 0, 0, .16);
  --pf-transition: .2s ease;
}
.pf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--pf-text);
}

.cat-layout { display: grid; gap: 20px; }
.cat-layout__main { min-width: 0; }
.cat-layout__side { min-width: 0; }

.cat-layout__side #column-left { float: none; width: auto; margin: 0 0 16px; }
@media (min-width: 960px) {
  .cat-layout--has-filter { grid-template-columns: 264px minmax(0, 1fr); gap: 28px; }
  .cat-layout--has-filter .cat-layout__side { align-self: start; }
}

.pf__head { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 2px 8px; }
.pf__title { font-size: 17px; font-weight: 700; }
.pf__reset { font-size: 13px; color: var(--pf-brand); text-decoration: none; border-bottom: 1px dashed currentColor; transition: color var(--pf-transition); }
.pf__reset:hover { color: var(--pf-brand-700); }
.pf__reset--hidden { display: none; }

.pf__group { border-top: 1px solid var(--pf-border); }
.pf__summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 2px; font-weight: 600; font-size: 14px;
}
.pf__summary::-webkit-details-marker { display: none; }
.pf__summary::after {
  content: ""; width: 8px; height: 8px; margin-left: 8px; flex: none;
  border-right: 2px solid var(--pf-muted); border-bottom: 2px solid var(--pf-muted);
  transform: rotate(45deg); transition: transform var(--pf-transition);
}
.pf__group[open] > .pf__summary::after { transform: rotate(-135deg); }
.pf__summary:focus-visible { outline: 2px solid var(--pf-brand); outline-offset: 2px; border-radius: var(--pf-radius-sm); }
.pf__body { padding: 2px 2px 14px; }

.pf__opts { display: flex; flex-direction: column; gap: 2px; }
.pf__opt {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 6px; border-radius: var(--pf-radius-sm); cursor: pointer;
  transition: background var(--pf-transition);
}
.pf__opt:hover { background: #f3f7fa; }
.pf__opt input { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--pf-brand); cursor: pointer; }
.pf__opt-label { flex: 1 1 auto; line-height: 1.3; }
.pf__opt-count { flex: none; font-size: 12px; color: var(--pf-muted); font-variant-numeric: tabular-nums; }
.pf__opt--empty { opacity: .45; cursor: default; }
.pf__opt--empty:hover { background: none; }

.pf__slider { padding: 6px 4px 2px; }
.pf__slider-track { position: relative; height: 4px; margin: 14px 8px 20px; background: var(--pf-border); border-radius: 2px; }
.pf__slider-fill { position: absolute; height: 100%; background: var(--pf-brand); border-radius: 2px; }
.pf__slider-h {
  position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px;
  background: #fff; border: 2px solid var(--pf-brand); border-radius: 50%;
  transform: translateY(-50%); cursor: grab; box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: border-color var(--pf-transition), box-shadow var(--pf-transition);
}
.pf__slider-h:hover { box-shadow: 0 0 0 4px rgba(55,156,203,.15); }
.pf__slider-h:active { cursor: grabbing; }
.pf__slider-h[data-drag] { border-color: var(--pf-brand-700); box-shadow: 0 0 0 5px rgba(55,156,203,.22); }
.pf__slider-fields { display: flex; align-items: center; gap: 8px; }
.pf__num {
  flex: 1 1 0; width: 100%; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--pf-border); border-radius: var(--pf-radius-sm);
  font: inherit; font-size: 13px; color: var(--pf-text); text-align: center;
  transition: border-color var(--pf-transition);
  -moz-appearance: textfield;
}
.pf__num::-webkit-outer-spin-button, .pf__num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pf__num:focus { outline: none; border-color: var(--pf-brand); }
.pf__num-sep { color: var(--pf-muted); flex: none; }

.pf__actions { padding: 12px 0 4px; margin-top: 4px; }
.pf__apply {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border: none; border-radius: var(--pf-radius);
  background: var(--pf-brand); color: #fff; font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: background var(--pf-transition), transform var(--pf-transition);
}
.pf__apply:hover { background: var(--pf-brand-700); }
.pf__apply:active { transform: translateY(1px); }
.pf__apply:focus-visible { outline: 2px solid var(--pf-brand-700); outline-offset: 2px; }
.pf__apply-total { font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }
.pf__apply-total::before { content: "("; }
.pf__apply-total::after { content: ")"; }
.pf.is-loading { opacity: .6; pointer-events: none; }

@media (max-width: 959px) {
  .cat-layout--has-filter { grid-template-columns: 1fr; }
  .pf { margin-bottom: 0; }

  .pf__opt { min-height: 44px; }
  .pf__summary { min-height: 44px; }
  .pf__apply { min-height: 44px; }

  .pf__num { font-size: 16px; min-height: 44px; box-sizing: border-box; }
}
@media (prefers-reduced-motion: reduce) { .pf__slider-h { transition: none; } }

.pf__toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 16px;
  padding: 0 16px;
  background: var(--pf-bg);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  color: var(--pf-text);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: border-color var(--pf-transition), box-shadow var(--pf-transition);
}
.pf__toggle:hover { border-color: var(--pf-brand); }
.pf__toggle:active { background: #f3f7fa; }
.pf__toggle:focus-visible { outline: 2px solid var(--pf-brand); outline-offset: 2px; }
.pf__toggle-icon { flex: none; color: var(--pf-brand); }
.pf__toggle-label { flex: 1 1 auto; text-align: left; }
.pf__toggle-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--pf-brand); color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pf__toggle-badge[hidden] { display: none; }

@media (max-width: 959px) {
  .pf__toggle { display: inline-flex; }

  .pf__scrim {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1000;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--pf-transition), visibility 0s linear .2s;
  }
  .pf__scrim.is-open {
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: opacity var(--pf-transition);
  }

  .pf__drawer {
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    width: min(86vw, 360px);
    height: 100vh;
    height: 100dvh;
    background: var(--pf-bg);
    box-shadow: var(--pf-shadow);
    z-index: 1001;
    transform: translateX(-100%);
    visibility: hidden; pointer-events: none;
    transition: transform var(--pf-transition), visibility 0s linear .2s;
  }
  .pf__drawer.is-open {
    transform: translateX(0);
    visibility: visible; pointer-events: auto;
    transition: transform var(--pf-transition);
  }
  .pf__drawer:focus { outline: none; }

  .pf__drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    flex: none;
    padding: 14px 8px 14px 16px;
    border-bottom: 1px solid var(--pf-border);
  }
  .pf__drawer-title { font-size: 17px; font-weight: 700; }
  .pf__drawer-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: none; border: none; border-radius: var(--pf-radius-sm);
    color: var(--pf-text); cursor: pointer;
    transition: background var(--pf-transition);
  }
  .pf__drawer-close:hover { background: #f3f7fa; }
  .pf__drawer-close:focus-visible { outline: 2px solid var(--pf-brand); outline-offset: -2px; }

  .pf__drawer-body {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 0 16px;
  }

  .pf__drawer-body .pf__actions {
    position: sticky; bottom: 0;
    margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--pf-bg);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf__scrim, .pf__drawer { transition: none; }
}

@media (min-width: 960px) {
  .pf__toggle, .pf__scrim, .pf__drawer-head { display: none; }
  .pf__drawer {
    position: static; width: auto; height: auto;
    transform: none; box-shadow: none; background: none; z-index: auto;
  }
  .pf__drawer-body { overflow: visible; padding: 0; }
}
