.rescom-filter { position: sticky; top: 105px; color: var(--rescom-ink); }
.rescom-filter__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; }
.rescom-filter__head strong { font-size: 17px; font-weight: 600; }
.rescom-filter__head button,
.rescom-active-filters__clear { padding: 0; border: 0; background: none; color: var(--rescom-muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

.rescom-filter__search { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; padding: 11px 16px; border: 1px solid #dcd7d0; border-radius: 999px; }
.rescom-filter__search > span:first-child { position: relative; width: 13px; height: 13px; flex: none; border: 1.5px solid #9c978f; border-radius: 50%; }
.rescom-filter__search > span:first-child::after { position: absolute; right: -4px; bottom: -3px; width: 5px; height: 1px; transform: rotate(45deg); background: #9c978f; content: ""; }
.rescom-filter__search input { width: 100%; height: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; outline: 0; background: none !important; box-shadow: none !important; color: var(--rescom-ink); font-size: 13px; }

.rescom-filter__group { margin: 0; padding: 16px 0; border-top: 1px solid var(--rescom-line); }
.rescom-filter__group:last-of-type { border-bottom: 1px solid var(--rescom-line); }
.rescom-filter__group summary { display: flex; align-items: center; justify-content: space-between; list-style: none; color: var(--rescom-ink); cursor: pointer; font-size: 13.5px; font-weight: 600; }
.rescom-filter__group summary::-webkit-details-marker { display: none; }
.rescom-filter__group summary i { position: relative; display: block; width: 12px; height: 12px; }
.rescom-filter__group summary i::before,
.rescom-filter__group summary i::after { position: absolute; top: 5px; left: 1px; width: 10px; height: 1px; background: #817c74; content: ""; }
.rescom-filter__group summary i::after { transform: rotate(90deg); transition: transform .2s ease; }
.rescom-filter__group[open] summary i::after { transform: rotate(0); }
.rescom-filter__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 245px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 22px 2px 0;
  scrollbar-color: #aaa7a1 transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.rescom-filter__options::-webkit-scrollbar { width: 6px; }
.rescom-filter__options::-webkit-scrollbar-track { background: transparent; }
.rescom-filter__options::-webkit-scrollbar-thumb { border-radius: 999px; background: #aaa7a1; }
.rescom-filter__options::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.rescom-filter__option { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 9px; align-items: center; margin: 0; cursor: pointer; color: var(--rescom-text); font-size: 12.5px; line-height: 1.35; }
.rescom-filter__option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rescom-filter__check { display: grid; width: 17px; height: 17px; place-items: center; border: 1.5px solid #d4d0c9; border-radius: 5px; background: #fff; color: transparent; font-size: 10px; }
.rescom-filter__option input:checked + .rescom-filter__check { border-color: var(--rescom-ink); background: var(--rescom-ink); color: #fff; }
.rescom-filter__option input:focus-visible + .rescom-filter__check,
.rescom-filter__option input:focus-visible + .rescom-filter__color { outline: 2px solid var(--rescom-green); outline-offset: 3px; }
.rescom-filter__option small { color: #aaa59d; font-size: 11px; }
.rescom-filter__hint { margin: 10px 0 0; color: var(--rescom-warm); font-size: 10.5px; line-height: 1.45; }
.rescom-filter__apply { width: 100%; min-height: 46px; margin-top: 20px; border: 0; border-radius: 999px; background: var(--rescom-ink); color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }

.rescom-filter__options--colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; max-height: none; overflow: visible; padding: 14px 6px 8px; scrollbar-gutter: auto; }
.rescom-filter__options--colors .rescom-filter__option { grid-template-columns: 27px minmax(0, 1fr) auto; gap: 6px; font-size: 11.5px !important; line-height: 1.25; }
.rescom-filter__options--colors .rescom-filter__label { overflow: hidden; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.rescom-filter__options--colors .rescom-filter__option small { font-size: 10px; }
.rescom-filter__color { display: block; width: 21px; height: 21px; border: 2px solid #fff; border-radius: 50%; outline: 1px solid #d5d1ca; background: var(--rescom-swatch); }
.rescom-filter__option input:checked + .rescom-filter__color { outline: 2px solid var(--rescom-ink); outline-offset: 2px; }

.rescom-active-filters { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 18px 0 0; }
.rescom-active-filters > button:not(.rescom-active-filters__clear) { display: inline-flex; gap: 8px; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid #dcd7d0; border-radius: 999px; background: #fff; color: var(--rescom-text); cursor: pointer; font-size: 11px; }
.rescom-active-filters > button span { color: #8f8a82; font-size: 16px; line-height: 1; }
.rescom-active-filters__clear { margin-left: 5px; }

.rescom-filter-sheet { position: fixed; inset: 0; z-index: 99999; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .22s ease, visibility .22s ease; }
.rescom-filter-sheet.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.rescom-filter-sheet__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(17, 17, 16, .48); }
.rescom-filter-sheet__panel { position: absolute; right: 0; bottom: 0; left: 0; max-height: 88vh; overflow: auto; transform: translateY(100%); border-radius: 22px 22px 0 0; background: #fff; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.rescom-filter-sheet.is-open .rescom-filter-sheet__panel { transform: translateY(0); }
.rescom-filter-sheet__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 19px 20px; border-bottom: 1px solid var(--rescom-line); background: #fff; }
.rescom-filter-sheet__head strong { font-size: 18px; }
.rescom-filter-sheet__head button { display: grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 1px solid var(--rescom-line); border-radius: 50%; background: #fff; color: var(--rescom-ink); cursor: pointer; font-size: 22px; }
.rescom-filter-sheet .rescom-filter { position: static; padding: 22px 20px 32px; }
.rescom-filter-sheet .rescom-filter__head { display: none; }
.rescom-filter-sheet .rescom-filter__apply { position: sticky; bottom: 12px; min-height: 52px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
body.rescom-filter-open { overflow: hidden; }

@media (min-width: 880px) {
  .rescom-filter-sheet { display: none; }
}

@media (max-width: 879px) {
  .rescom-filter__options { max-height: none; padding-right: 8px; scrollbar-gutter: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .rescom-filter-sheet,
  .rescom-filter-sheet__panel,
  .rescom-filter__group summary i::after { transition: none; }
}
