/* Shared category sheet. Radios keep their native selection and keyboard behavior. */
body.is-category-filter-open { overflow: hidden; }
.category-filter-sheet {
  --category-filter-max-height: min(80dvh, calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)));
  position: fixed;
  inset: 0;
  width: min(calc(100% - 24px), 460px);
  max-width: calc(100% - 24px);
  height: fit-content;
  max-height: min(80vh, calc(100vh - 24px));
  max-height: var(--category-filter-max-height);
  min-width: 0;
  min-height: 0;
  margin: auto;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #3b454d;
  border-radius: 18px;
  background: #12171b;
  color: #edf1f4;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 22px 80px #0009;
}
.category-filter-sheet:not([open]) { display: none; }
.category-filter-sheet[open] { display: flex; flex-direction: column; }
.category-filter-sheet::backdrop { background: #000a; }
.category-filter-sheet *, .category-filter-sheet *::before, .category-filter-sheet *::after { box-sizing: border-box; }
.category-filter-handle { display: none; flex: 0 0 4px; align-self: center; width: 40px; height: 4px; margin: 0 0 12px; border-radius: 3px; background: #515c65; }
.category-filter-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 16px; }
.category-filter-header h2 { min-width: 0; margin: 0; color: #f0f3f5; font-size: 22px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.category-filter-header > button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #c8d1d8; font: inherit; font-size: 30px; line-height: 1; cursor: pointer; }
.category-filter-header > button:hover { background: #222b32; color: #fff; }
.category-filter-header > button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.category-filter-form { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; margin: 0; overflow: hidden; }
.category-filter-fieldset { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; margin: 0; padding: 0; overflow: hidden; border: 0; }
.category-filter-fieldset > legend { display: block; width: 100%; margin: 0 0 10px; padding: 0; color: #b6c0c8; font-size: 14px; font-weight: 500; line-height: 1.5; }
.category-filter-options { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; max-height: calc(var(--category-filter-max-height) - 220px); padding: 3px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scroll-padding-block: 4px; scrollbar-width: thin; scrollbar-color: #566773 #12171b; }
.category-filter-option { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-width: 0; min-height: 56px; margin: 0; padding: 12px; border: 1px solid #35414a; border-radius: 11px; background: #171e24; color: #e4eaf0; cursor: pointer; }
.category-filter-name { flex: 1 1 0; min-width: 0; color: inherit; font-size: 16px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.category-filter-count { flex: 0 0 auto; padding: 2px 7px; border: 1px solid #3b4852; border-radius: 7px; background: #222d35; color: #bdc8d1; font-size: 14px; font-weight: 400; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; }
.category-filter-option > input[type="radio"] { appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: 0 0 22px; width: 22px; height: 22px; min-width: 22px; margin: 0; padding: 0; border: 1.5px solid #84929d; border-radius: 50%; background: transparent; color: #f45248; cursor: pointer; }
.category-filter-option > input[type="radio"]::before { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; transform: scale(0); }
.category-filter-option > input[type="radio"]:checked { border-color: #f4776b; }
.category-filter-option > input[type="radio"]:checked::before { transform: scale(1); }
.category-filter-option:has(input:checked) { border-color: #eb786d; background: #2b201f; color: #fff; }
.category-filter-option:has(input:checked) .category-filter-count { border-color: #80554f; background: #3a2926; color: #efc6be; }
.category-filter-option:hover { border-color: #8899a5; }
.category-filter-option:has(input:checked):hover { border-color: #ffa295; }
.category-filter-actions { position: relative; display: grid; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; margin-top: 20px; }
.category-filter-actions::before { content: ""; position: absolute; top: -10px; right: 0; left: 0; height: 1px; background: #2c3338; }
.category-filter-actions > button { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 50px; margin: 0; padding: 12px 8px; border: 1px solid #4b5963; border-radius: 10px; background: #171e24; color: #e0e7ec; font: inherit; font-size: 15px; font-weight: 650; line-height: 1.4; cursor: pointer; }
.category-filter-actions > button[type="submit"] { border-color: #ee7d72; background: #d53b33; color: #fff; }
.category-filter-actions > button[type="submit"]:hover { background: #c6322b; }
.category-filter-actions > button[type="button"]:hover:not(:disabled) { border-color: #9aabb7; background: #242e36; }
.category-filter-actions > button:disabled { cursor: default; }
.category-filter-actions > button[type="button"]:disabled { border-color: #33404a; background: #141b20; color: #8c9ba7; }
.category-filter-sheet :is(button, input):focus-visible { outline: 2px solid #ffaaa0; outline-offset: 3px; }

@media (max-width: 767px) {
  .category-filter-sheet { inset: auto 0 0; margin: 0 auto calc(12px + env(safe-area-inset-bottom, 0px)); }
  .category-filter-handle { display: block; }
}
@media (min-width: 768px) {
  .home-route .mobile-home-filter.category-filter-sheet { display: none; }
}
@media (max-height: 500px) {
  .category-filter-sheet { padding: 14px; }
  .category-filter-handle { margin-bottom: 8px; }
  .category-filter-header { margin-bottom: 10px; }
  .category-filter-fieldset > legend { margin-bottom: 8px; }
  .category-filter-options { max-height: calc(var(--category-filter-max-height) - 188px); }
  .category-filter-actions { margin-top: 14px; }
}
@media (forced-colors: active) {
  .category-filter-option > input[type="radio"] { appearance: auto; -webkit-appearance: auto; }
  .category-filter-option > input[type="radio"]::before { display: none; }
  .category-filter-option:has(input:checked) { border-color: Highlight; }
}
