/* HomeFine: фильтр товаров (new.homefine.ru, 03.10.2026). Цвета и шрифт — из /hf/nav.css (--hf-*) */
.hf-fpanel { font-family: var(--hf-font); color: var(--hf-ink); }
/* Тема делает текст всех <button> заглавным — у наших кнопок обычный регистр */
button.hf-fg__toggle, button.hf-fmore, button.hf-fpanel__apply, button.hf-ftab { text-transform: none; }
.hf-fpanel .hf-i, .hf-fbar .hf-i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hf-fpanel__head { display: flex; align-items: center; gap: 8px; padding: 0 0 10px; }
.hf-fpanel__title { flex: 1; font: 700 17px/1.2 var(--hf-font); }
.hf-fpanel__clear { font: 600 14px/1 var(--hf-font); color: var(--hf-accent); text-decoration: none; }
.hf-fpanel__clear:hover { color: var(--hf-accent); text-decoration: underline; }
.hf-fpanel__clear.is-hidden, .hf-fpanel__x { display: none; }
.hf-fpanel__foot { display: none; }

/* Группа */
.hf-fg { border-top: 1px solid var(--hf-line); }
h3.hf-fg__h, .hf-fg__h { margin: 0; font: inherit; }
.hf-fg__toggle, button.hf-fg__toggle:hover, button.hf-fg__toggle:focus, button.hf-fg__toggle:active {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; padding: 8px 0; margin: 0;
  border: 0; border-radius: 0; background: none; text-align: left; color: var(--hf-ink); font: 600 15px/1.25 var(--hf-font);
}
.hf-fg__toggle > span { flex: 1; }
.hf-fg__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hf-accent); opacity: 0; transition: opacity .15s; }
.hf-fg.is-active .hf-fg__dot { opacity: 1; }
.hf-fg__chev { color: var(--hf-muted); transition: transform .2s ease-out; }
.hf-fg.is-open .hf-fg__chev { transform: rotate(180deg); }
.hf-fg__body { display: none; padding: 0 0 14px; }
.hf-fg.is-open .hf-fg__body { display: block; }

/* Значения */
.hf-fl { margin: 0; padding: 0; list-style: none; }
.hf-fv.is-extra { display: none; }
.hf-fg.is-more .hf-fv.is-extra { display: block; }
.hf-check {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; margin: 0; padding: 3px 0;
  font: 500 14px/1.25 var(--hf-font); color: var(--hf-ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.hf-check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.hf-check__box {
  position: relative; width: 20px; height: 20px; flex: none; border: 1.5px solid #c9c8c3; border-radius: 6px; background: #fff;
  transition: background-color .12s ease-out, border-color .12s ease-out;
}
.hf-check__box::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(.6); opacity: 0; transition: opacity .12s ease-out, transform .12s ease-out;
}
.hf-check:hover .hf-check__box { border-color: var(--hf-ink); }
.hf-check input:checked + .hf-check__box { background: var(--hf-ink); border-color: var(--hf-ink); }
.hf-check input:checked + .hf-check__box::after { opacity: 1; transform: rotate(45deg) scale(1); }
.hf-check input:focus-visible + .hf-check__box { outline: 2px solid var(--hf-accent); outline-offset: 2px; }
/* Обводка выбранного цвета — внутри кружка: у списка на десктопе своя прокрутка, всё, что снаружи, обрезается по краю */
.hf-swatch {
  position: relative; width: 22px; height: 22px; margin: -1px -2px -1px 0; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  transition: box-shadow .12s ease-out;
}
.hf-check input:checked + .hf-swatch { box-shadow: inset 0 0 0 2px var(--hf-ink), inset 0 0 0 4px #fff, inset 0 0 0 5px rgba(0, 0, 0, .14); }
.hf-check input:focus-visible + .hf-swatch { outline: 2px solid var(--hf-accent); outline-offset: -2px; }
/* Цвет (07.10): выбирается один, выбранный виден сразу — голубая подложка строки, синее кольцо и значок-галочка на кружке */
.hf-fl--color .hf-check { padding: 4px 8px; border-radius: 12px; transition: background-color .12s ease-out; }
.hf-fl--color .hf-check:hover { background: #f4f3f0; }
.hf-fl--color .hf-check:has(input:checked) { background: #edf3f9; }
.hf-fl--color .hf-check:has(input:checked) .hf-check__t { font-weight: 700; color: var(--hf-accent); }
.hf-fl--color .hf-check:has(input:checked) .hf-check__n { color: var(--hf-accent); }
.hf-fl--color .hf-check input:checked + .hf-swatch { box-shadow: inset 0 0 0 2px var(--hf-accent), inset 0 0 0 4px #fff, inset 0 0 0 5px rgba(0, 0, 0, .12); }
.hf-swatch::after {
  content: ''; position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--hf-accent) no-repeat center / 9px 9px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 2px #fff; transform: scale(0); transition: transform .14s ease-out;
}
.hf-check input:checked + .hf-swatch::after { transform: scale(1); }
.hf-check__t { flex: 1; min-width: 0; }
.hf-check__n { font: 500 12px/1 var(--hf-font); color: var(--hf-muted); font-variant-numeric: tabular-nums; }
.hf-fv.is-zero .hf-check { opacity: .38; cursor: default; }
.hf-fmore, button.hf-fmore:hover, button.hf-fmore:focus, button.hf-fmore:active {
  margin: 4px 0 0; padding: 6px 0; border: 0; background: none; font: 600 14px/1 var(--hf-font); color: var(--hf-accent);
}
.hf-fnote { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--hf-soft); font: 500 13px/1.4 var(--hf-font); color: #5d5c57; }

/* Ползунок «от – до» */
.hf-range__inputs { display: flex; gap: 8px; }
.hf-range__field { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; height: 40px; margin: 0; padding: 0 10px; border: 1px solid #dddcd7; border-radius: 10px; background: #fff; }
.hf-range__field:focus-within { border-color: var(--hf-ink); }
.hf-range__field span { font: 500 13px/1 var(--hf-font); color: var(--hf-muted); }
.hf-range__field input {
  width: 100%; min-width: 0; height: 38px; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; outline: none;
  font: 600 14px/1 var(--hf-font); color: var(--hf-ink); font-variant-numeric: tabular-nums;
}
.hf-range__track { position: relative; height: 28px; margin: 10px 10px 0; }
.hf-range__track::before { content: ''; position: absolute; left: 0; right: 0; top: 13px; height: 3px; border-radius: 2px; background: #e6e5e1; }
.hf-range__fill { position: absolute; top: 13px; height: 3px; border-radius: 2px; background: var(--hf-ink); }
.hf-range__track input[type=range] {
  position: absolute; left: -10px; right: -10px; top: 0; width: calc(100% + 20px); height: 28px; margin: 0; padding: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none; z-index: 2;
}
.hf-range__track input[type=range]::-webkit-slider-runnable-track { height: 28px; background: none; }
.hf-range__track input[type=range]::-moz-range-track { height: 28px; background: none; }
.hf-range__track input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: #fff; border: 2px solid var(--hf-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18); pointer-events: auto; cursor: grab;
}
.hf-range__track input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--hf-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  pointer-events: auto; cursor: grab;
}
.hf-range__track input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.08); }

/* Над товарами: выбранные значения */
.hf-ftab { display: none; }
.hf-fbar__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.hf-fbar__found { margin-right: 4px; font: 600 14px/1.3 var(--hf-font); color: var(--hf-ink); }
.hf-fchip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 14px; border-radius: 17px;
  background: var(--hf-soft); color: var(--hf-ink); font: 600 13px/1 var(--hf-font); text-decoration: none; white-space: nowrap;
  transition: background-color .12s ease-out;
}
.hf-fchip:hover, .hf-fchip:focus { background: #e8e7e2; color: var(--hf-ink); text-decoration: none; }
.hf-fchip .hf-i { color: var(--hf-muted); }
.hf-fbar__reset { font: 600 13px/1 var(--hf-font); color: var(--hf-accent); text-decoration: none; padding: 0 4px; }
.hf-fbar__reset:hover { color: var(--hf-accent); text-decoration: underline; }

/* Строка заголовка: H1 слева, справа — «68 товаров» и сортировка (кнопка + выпадающий список), отдельной строки нет */
.hf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.hf-head > h1 { flex: 1 1 300px; min-width: 0; }
.hf-head__n { margin-left: auto; font: 500 14px/1.3 var(--hf-font); color: var(--hf-muted); white-space: nowrap; }
.hf-tools > .hf-fbar__chips { margin: 0 0 16px; }
.hf-sort { position: relative; flex: none; margin-left: auto; }
.hf-head__n + .hf-sort { margin-left: 0; }
.hf-sort .hf-i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hf-sort__btn, button.hf-sort__btn:hover, button.hf-sort__btn:focus, button.hf-sort__btn:active {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; margin: 0; padding: 0 12px 0 14px;
  border: 1px solid var(--hf-line); border-radius: 20px; background: #fff; color: var(--hf-ink); box-shadow: none;
  font: 600 14px/1 var(--hf-font); text-transform: none; letter-spacing: 0; white-space: nowrap; cursor: pointer;
  transition: border-color .12s ease-out, background-color .12s ease-out;
}
button.hf-sort__btn:hover, .hf-sort.is-open button.hf-sort__btn { border-color: #c9c8c3; background: var(--hf-soft); }
button.hf-sort__btn:focus-visible { outline: 2px solid var(--hf-accent); outline-offset: 2px; }
.hf-sort__btn > .hf-i:first-child, .hf-sort__l, .hf-sort__chev { color: var(--hf-muted); }
.hf-sort__l { font-weight: 500; margin-right: -3px; }
.hf-sort__chev { transition: transform .2s ease-out; }
.hf-sort.is-open .hf-sort__chev { transform: rotate(180deg); }
.hf-sort__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 100%; padding: 6px; border-radius: 14px; background: #fff;
  box-shadow: 0 14px 34px -10px rgba(25, 25, 22, .28), 0 0 0 1px rgba(0, 0, 0, .06);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .14s ease-out, transform .18s var(--hf-ease), visibility 0s linear .18s;
}
.hf-sort.is-open .hf-sort__menu { opacity: 1; visibility: visible; transform: none; transition: opacity .14s ease-out, transform .18s var(--hf-ease), visibility 0s; }
a.hf-sort__o, a.hf-sort__o:hover, a.hf-sort__o:focus {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 10px 10px 12px; border-radius: 9px;
  color: var(--hf-ink); font: 500 14px/1.2 var(--hf-font); text-decoration: none; white-space: nowrap;
}
a.hf-sort__o:hover, a.hf-sort__o:focus-visible { background: var(--hf-soft); }
a.hf-sort__o.active { font-weight: 700; text-decoration: none; }
a.hf-sort__o .hf-i { color: var(--hf-accent); opacity: 0; }
a.hf-sort__o.active .hf-i { opacity: 1; }

/* Разделы меньше 6 товаров на одной странице: сортировать нечего */
.hf-small #input-sort { display: none !important; }

/* Загрузка товаров */
#content.hf-loading { opacity: .5; pointer-events: none; transition: opacity .15s ease-out; }
.hf-progress { position: fixed; left: 0; top: 0; z-index: 2000; height: 2px; width: 0; background: var(--hf-accent); opacity: 0; transition: opacity .2s; }
.hf-progress.is-on { opacity: 1; animation: hf-prog 1.6s ease-out forwards; }
@keyframes hf-prog { from { width: 0; } to { width: 85%; } }

/* ---------- Компьютер: колонка слева, закреплена при прокрутке ---------- */
@media (min-width: 992px) {
  .hf-frow > .hf-fside { flex: 0 0 256px; max-width: 256px; width: 256px; }
  .hf-frow > #content { flex: 1 1 0; max-width: none; width: auto; min-width: 0; padding-left: 36px; }   /* воздух между фильтром и заголовком/товарами */
  .hf-fside .hf-fpanel { position: sticky; top: 72px; display: flex; flex-direction: column; max-height: calc(100vh - 88px); }
  .hf-fside .hf-fpanel__body { overflow-y: auto; overscroll-behavior: contain; padding-right: 16px; margin-right: -8px; scrollbar-width: thin; }
}

/* ---------- Телефон: окно на весь экран ---------- */
@media (max-width: 991.98px) {
  .hf-frow > .hf-fside { height: 0; min-height: 0; margin: 0; padding: 0; }
  .hf-frow #input-sort { display: none !important; }
  .hf-fpanel {
    position: fixed; inset: 0; z-index: 1070; display: flex; flex-direction: column; background: #fff;
    visibility: hidden; opacity: 0; transform: translateY(16px);
    transition: opacity .2s ease-out, transform .26s var(--hf-ease), visibility 0s linear .26s;
  }
  .hf-fpanel.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s ease-out, transform .26s var(--hf-ease), visibility 0s; }
  .hf-fpanel__head { flex: none; min-height: 56px; padding: env(safe-area-inset-top) 6px 0 16px; border-bottom: 1px solid var(--hf-line); }
  .hf-fpanel__title { font-size: 18px; }
  .hf-fpanel__x { display: grid; }
  .hf-fpanel__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 16px 16px; }
  .hf-fpanel__body > .hf-fg:first-child { border-top: 0; }
  .hf-fg__toggle, button.hf-fg__toggle:hover, button.hf-fg__toggle:focus, button.hf-fg__toggle:active { min-height: 56px; font-size: 16px; }
  .hf-check { min-height: 44px; font-size: 15px; }
  .hf-check__n { font-size: 13px; }
  .hf-range__field { height: 46px; }
  .hf-range__field input { font-size: 16px; }
  .hf-fpanel__foot { display: block; flex: none; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hf-line); background: #fff; }
  .hf-fpanel__apply, button.hf-fpanel__apply:hover, button.hf-fpanel__apply:focus, button.hf-fpanel__apply:active {
    width: 100%; height: 52px; border: 0; border-radius: 14px; background: var(--hf-ink); color: #fff; font: 700 16px/1 var(--hf-font);
  }
  .hf-fpanel__apply[disabled] { background: #b9b8b3; }
  .hf-fpanel__apply.is-busy { opacity: .75; }

  /* Кнопка «Фильтры» — полоска у левого края экрана, в синих цветах сайта */
  .hf-ftab, button.hf-ftab:hover, button.hf-ftab:focus, button.hf-ftab:active {
    position: fixed; left: 0; top: 45%; z-index: 1035; display: flex; flex-direction: column; align-items: center; gap: 10px;
    width: 42px; margin: 0; padding: 14px 0 16px; border: 0; border-radius: 0 16px 16px 0;
    background: linear-gradient(180deg, #4a7aa6 0%, #325678 55%, #243f5a 100%); color: #fff;
    box-shadow: 0 10px 24px -8px rgba(36, 63, 90, .6), inset -1px 0 0 rgba(255, 255, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .2);
    transform-origin: left center; -webkit-tap-highlight-color: transparent; /* высоту ставит filter.js (placeTab) */
    animation: hf-ftab-in .5s var(--hf-ease) .25s backwards;
    transition: transform .14s ease-out, opacity .2s ease-out;
  }
  button.hf-ftab:active { transform: scale(.95); }
  .hf-ftab .hf-i { flex: none; }
  .hf-ftab__t { writing-mode: vertical-rl; transform: rotate(180deg); font: 700 14px/1 var(--hf-font); letter-spacing: .03em; }
  .hf-ftab__n {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #fff; color: #243f5a;
    font: 800 12px/22px var(--hf-font); text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  }
  html.hf-fopen .hf-ftab { opacity: 0; pointer-events: none; }
  @keyframes hf-ftab-in { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: none; } }

  /* Выбранные значения — все видны, переносятся на следующие строки */
  .hf-fbar__chips, .hf-tools > .hf-fbar__chips { gap: 6px; margin: 0 0 12px; }
  .hf-head__n { display: none; }   /* на телефоне число товаров — на кнопке в окне фильтра */
  .hf-fchip { height: 32px; padding: 0 9px 0 12px; }
  /* Список страниц темы (1…9, >, >|) в строку на телефоне не помещается */
  #content .pagination { flex-wrap: wrap; row-gap: 6px; }
}
/* Сортировка в окне фильтра — только на телефоне, на компьютере — кнопкой над товарами (.hf-sort) */
@media (min-width: 992px) {
  .hf-ftab, .hf-fg--sort { display: none; }
}
.hf-check--radio .hf-check__box { border-radius: 50%; }
.hf-check--radio .hf-check__box::after {
  left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border: 0; border-radius: 50%; background: #fff; transform: scale(.4);
}
.hf-check--radio input:checked + .hf-check__box::after { transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .hf-fpanel, .hf-fg__chev, .hf-check__box, .hf-check__box::after, .hf-ftab { transition: none !important; animation: none !important; }
  .hf-progress.is-on { animation: none; width: 85%; }
}
