/* =================== hc-cat-filters.css =================== */
/* hc-cat-filters — форма фильтров на /shop. Размещается внутри
 * .hc-cat-filter-aside (desktop sticky / mobile drawer — отдельный block).
 * Только normal flow, без negative margins, без overflow-hacks.
 * Strict isolation: .hc-cat-filters / .hc-cat-filters__*. */

/* ─── root ─── */
.hc-cat-filters {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 16px;
  box-sizing: border-box;
  background: var(--hc-paper, #ffffff);
  border: 0.5px solid rgba(141, 109, 71, 0.16);
  border-radius: 14px;
}
.hc-cat-filters::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin: 0 0 12px;
  background: linear-gradient(90deg, var(--hc-gold-1, #d4b896), var(--hc-accent, #8b7355));
  border-radius: 1px;
}
.hc-cat-filters__form {
  display: grid;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* ─── head ─── */
.hc-cat-filters__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid rgba(141, 109, 71, 0.20);
}
.hc-cat-filters__head h4 {
  margin: 0;
  font-family: var(--hc-serif, "Playfair Display", Georgia, serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: var(--hc-ink, #1a1714);
}
.hc-cat-filters__close {
  display: none;
}
@media (max-width: 1024px) {
  .hc-cat-filters__close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 0.5px solid rgba(141, 109, 71, 0.22);
    border-radius: 999px;
    font-family: var(--hc-mono, "JetBrains Mono", monospace);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--hc-ink-soft);
    cursor: pointer;
  }
}

/* ─── section ─── */
.hc-cat-filters__section {
  padding: 8px 0 12px;
  border-bottom: 0.5px dashed rgba(141, 109, 71, 0.20);
}
.hc-cat-filters__section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.hc-cat-filters__section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* v8.6 — collapsible-вариант (<details>) для facet'ов с >5 значениями. */
.hc-cat-filters__section--collapsible {
  list-style: none;
}
.hc-cat-filters__section--collapsible > .hc-cat-filters__section-head {
  cursor: pointer;
  user-select: none;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.hc-cat-filters__section--collapsible > .hc-cat-filters__section-head::-webkit-details-marker {
  display: none;
}
.hc-cat-filters__section--collapsible > .hc-cat-filters__section-head::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.4px solid var(--hc-ink-mid, rgba(26, 23, 20, 0.45));
  border-bottom: 1.4px solid var(--hc-ink-mid, rgba(26, 23, 20, 0.45));
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s ease;
}
.hc-cat-filters__section--collapsible[open] > .hc-cat-filters__section-head::after {
  transform: translateY(-30%) rotate(225deg);
}
.hc-cat-filters__section-count {
  font-family: var(--hc-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 500;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.45));
  margin-left: auto;
}
.hc-cat-filters__section-head h4,
.hc-cat-filters h4 {
  margin: 0;
  font-family: var(--hc-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.55));
}
.hc-cat-filters__section-head h4::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hc-gold-1, #d4b896), var(--hc-accent, #8b7355));
  vertical-align: middle;
}

/* ─── categories stack ─── */
.hc-cat-filters__category-stack,
.hc-cat-filters__category-scroll {
  display: grid;
  gap: 2px;
  width: 100%;
  max-width: 100%;
}
.hc-cat-filters__category-scroll {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(141, 109, 71, 0.3) transparent;
}
.hc-cat-filters__cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--hc-ink-soft, rgba(26, 23, 20, 0.72));
  font-family: var(--hc-sans, "Outfit", sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: background 0.16s ease, color 0.16s ease;
}
.hc-cat-filters__cat:hover {
  background: rgba(212, 184, 150, 0.14);
  color: var(--hc-ink, #1a1714);
}
.hc-cat-filters__cat.hc-chip--active,
.hc-cat-filters__cat[aria-current="true"] {
  background: rgba(212, 184, 150, 0.22);
  color: var(--hc-ink, #1a1714);
  font-weight: 600;
}
.hc-cat-filters__cat .hc-chip__count {
  font-family: var(--hc-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 500;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.45));
}

/* ─── quick grid (В наличии / Со скидкой / Новинки / Хиты) ─── */
.hc-cat-filters__quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  width: 100%;
}

/* ─── facet (checkbox row) ─── */
.hc-cat-filters__facet {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--hc-ink, #1a1714);
  cursor: pointer;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: background 0.16s ease;
}
.hc-cat-filters__facet:hover {
  background: rgba(212, 184, 150, 0.14);
}
.hc-cat-filters__facet-label {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.hc-cat-filters__facet--tile {
  flex-wrap: wrap;
  border: 0.5px solid rgba(141, 109, 71, 0.18);
  padding: 9px 11px;
  background: var(--hc-paper, #ffffff);
}
.hc-cat-filters__facet input[type="checkbox"],
.hc-cat-filters__facet .hc-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  background: var(--hc-paper, #ffffff);
  border: 1.4px solid rgba(141, 109, 71, 0.42);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.hc-cat-filters__facet input[type="checkbox"]:hover,
.hc-cat-filters__facet .hc-checkbox:hover {
  border-color: var(--hc-accent-dark, #5d4d3a);
}
.hc-cat-filters__facet input[type="checkbox"]:checked,
.hc-cat-filters__facet .hc-checkbox:checked {
  background: linear-gradient(135deg, var(--hc-gold-1, #d4b896), var(--hc-accent, #8b7355));
  border-color: var(--hc-accent-dark, #5d4d3a);
}
.hc-cat-filters__facet input[type="checkbox"]:checked::after,
.hc-cat-filters__facet .hc-checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--hc-paper, #ffffff);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  -webkit-mask-size: 12px 12px;
  mask-size: 12px 12px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.hc-cat-filters__facet small {
  margin-left: auto;
  font-family: var(--hc-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 500;
  color: var(--hc-ink-mid, rgba(26, 23, 20, 0.45));
  flex-shrink: 0;
}

/* ─── facet-stack (vertical list of facets для group) ─── */
.hc-cat-filters__facet-stack {
  display: grid;
  gap: 2px;
  width: 100%;
}

/* ─── price ─── */
.hc-cat-filters__price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.hc-cat-filters__price-input {
  height: 36px;
  padding: 8px 12px;
  background: var(--hc-paper, #ffffff);
  border: 0.5px solid rgba(141, 109, 71, 0.22);
  border-radius: 10px;
  font-family: var(--hc-mono, "JetBrains Mono", monospace);
  font-size: 13px;
  color: var(--hc-ink, #1a1714);
}
.hc-cat-filters__price-input:focus {
  outline: none;
  border-color: var(--hc-accent, #8b7355);
  box-shadow: 0 0 0 3px rgba(212, 184, 150, 0.20);
}

/* ─── actions (sticky bottom) ─── */
/* Repeat the apply CTA at the TOP of the filter, sticky, so long facet lists
   never force a scroll to the bottom to apply. Opaque so facets don't bleed. */
.hc-cat-filters__apply-top {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 14px;
  padding: 8px 0 12px;
  background: var(--hc-paper, #fffaf2);
  border-bottom: 0.5px solid rgba(141, 109, 71, 0.18);
}

.hc-cat-filters__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 14px 0 12px;
  /* Opaque: a transparent-top gradient let the facets above scroll through and
     read as the button "overlapping" the properties. Solid paper + soft top
     shadow makes it a clean sticky footer. */
  background: var(--hc-paper, #fffaf2);
  border-top: 0.5px solid rgba(141, 109, 71, 0.22);
  box-shadow: 0 -10px 18px -12px rgba(26, 23, 20, 0.12);
}

/* ─── applied chips strip ─── */
.hc-cat-filters__applied {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  padding: 12px;
  margin: 0 0 12px;
  background: linear-gradient(180deg, rgba(212, 184, 150, 0.14), rgba(184, 154, 111, 0.06));
  border: 0.5px solid var(--hc-gold-border, rgba(212, 184, 150, 0.42));
  border-radius: 12px;
  box-sizing: border-box;
}
.hc-cat-filters__applied-label {
  font-family: var(--hc-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hc-accent-dark, #5d4d3a);
}
.hc-cat-filters__applied-clear {
  margin-left: auto;
  background: transparent;
  border: 0;
  font-family: var(--hc-mono);
  font-size: 10px;
  color: var(--hc-accent-dark, #5d4d3a);
  cursor: pointer;
}

/* ── Applied-filters bar above results (was unstyled) ─────────────────────── */
.hc-applied-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}
.hc-applied-filters__clear {
  margin-left: 4px;
  color: var(--hc-accent-dark, #6a573f);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.hc-applied-filters__clear:hover {
  color: var(--hc-ink, #1a1714);
}
