.catalog-toolbar {
  --pill: #f5f5f7;
  gap: 15px;
  align-items: center;
  padding: 60px 0 30px;
  min-height: auto;
}
.catalog-hero { aspect-ratio: 1200/450; }
.catalog-toolbar catalog-filter {
  position: relative;
  z-index: 3;
  flex: 0 1 215px;
  min-width: 0;
  font: 16px/1.25 var(--mono);
}
.catalog-utility {
  flex: 0 0 45px;
  height: 45px;
  display: grid;
  place-items: center;
  background: var(--pill);
  border-radius: 50%;
}
.catalog-utility svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linejoin: round; }
.catalog-utility[aria-current] svg { fill: currentColor; }
.cf-toggle {
  display: flex;
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 45px;
  padding: 0 15px;
  border: 0;
  border-radius: 23px;
  color: #000;
  background: var(--pill);
  font: inherit;
  cursor: pointer;
}
.cf-toggle span {
  width: 8px;
  height: 8px;
  margin: -4px 3px 0 0;
  border-right: 1.25px solid;
  border-bottom: 1.25px solid;
  transform: rotate(45deg);
  transition: transform .28s ease;
}
catalog-filter[open] .cf-toggle span { transform: translateY(4px) rotate(225deg); }
catalog-filter [data-filter-panel] {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  box-sizing: border-box;
  width: min(520px, calc(100vw - 2 * var(--gutter, 20px)));
  max-height: calc(100dvh - 120px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  color: #000;
  background: #fff;
  transform-origin: top left;
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .36s cubic-bezier(.22,.74,.16,1), visibility 0s linear .36s;
}
catalog-filter[open] [data-filter-panel] {
  visibility: visible;
  clip-path: inset(0 0 0 0 round 0);
  transition-delay: 0s;
}
.cf-inside { padding: 16px 20px 20px; }
.cf-list { display: grid; }
.cf-list a {
  display: flex;
  align-items: center;
  min-height: 32px;
  text-transform: uppercase;
  text-underline-offset: 3px;
  letter-spacing: 0;
}
.cf-list a:hover, .cf-list a[aria-current] { text-decoration: underline; }
.cf-secondary::before {
  content: '';
  display: block;
  width: 50px;
  margin: 8px 0 11px;
  border-top: 1px solid;
}
catalog-options { display: block; min-width: 0; }
.cf-form { display: grid; gap: 20px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid #ddd; }
.cf-search input { width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid #aaa; border-radius: 0; background: #fff; color: #000; font: 16px/1.2 var(--mono); }
.cf-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.cf-group legend { margin-bottom: 4px; font: 12px/1.4 var(--mono); color: #555; }
.cf-choices { display: flex; flex-wrap: wrap; gap: 1px 10px; }
.cf-option { position: relative; cursor: pointer; }
.cf-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cf-option span, .cf-stock { display: inline-flex; align-items: center; min-height: 44px; font: 13px/1.4 var(--mono); }
.cf-option input:checked + span { text-decoration: underline; text-underline-offset: 3px; }
.cf-option input:focus-visible + span, catalog-filter :is(a,button,summary,input):focus-visible { outline: 2px solid #222; outline-offset: 2px; }
.cf-stock { gap: 8px; cursor: pointer; }
.cf-stock input { accent-color: #000; }
.cf-find { justify-self: start; padding: 6px 14px; border: 1px solid #777; border-radius: 16px; background: #fff; color: #000; font: 13px/1.2 var(--mono); }

@media (max-width: 700px) {
  .catalog-hero { aspect-ratio: 320/250; }
  .catalog-toolbar { gap: 8px; padding: 28px 0 22px; }
  .catalog-toolbar catalog-filter { font-size: 14px; }
  .catalog-utility { flex-basis: 38px; height: 38px; }
  .catalog-utility svg { width: 18px; height: 18px; }
  catalog-filter [data-filter-panel] { width: min(520px, calc(100vw - 2 * var(--gutter, 10px))); }
  .cf-inside { padding-left: 20px; }
  .cf-toggle { padding-left: 20px; }
  catalog-filter[open] .cf-toggle { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  catalog-filter [data-filter-panel], .cf-toggle span { transition: none; }
}

/* Keep intrinsic input/fieldset widths inside the panel at narrow viewports and zoom. */
.catalog-toolbar { flex-wrap: wrap; min-width: 0; }
catalog-filter [data-filter-panel] { max-width: calc(100vw - 2 * var(--gutter, 10px)); }
.cf-inside, .cf-form, .cf-search, .cf-group { min-width: 0; max-width: 100%; }
.cf-list a, .cf-option span { overflow-wrap: anywhere; }
.cf-search input { box-sizing: border-box; min-width: 0; max-width: 100%; box-shadow: none; }
.cf-option input { min-height: 0; padding: 0; margin: 0; }
.cf-stock input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; padding: 0; }
.cf-find { min-height: 44px; padding: 10px 20px; border-radius: 0; background: #111; color: #fff; border: 0; }
catalog-filter :is(a, button, input):focus:not(:focus-visible) { outline: none; }
catalog-filter :is(a, button, input):focus-visible { outline: 2px solid #222; outline-offset: 2px; }
@media (max-width: 360px) { .cf-inside { padding: 16px 12px; } }
