[data-shoe-collection] #collection {
  scroll-margin-top: 16px;
}

.shoe-listing-head,
.shoe-mobile-filter-buttons,
.shoe-sheet:not([open]) {
  display: none;
}

.shoe-style-tabs-wrap {
  position: relative;
  min-width: 0;
  margin-bottom: 7px;
}

.shoe-style-tabs-wrap:has(.shoe-style-tabs:empty) {
  display: none;
}

.shoe-style-tabs {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-inline-end: 18px;
  scrollbar-width: none;
}

.shoe-style-tabs::-webkit-scrollbar {
  display: none;
}

.shoe-style-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 7px 1px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.shoe-style-tab[aria-pressed="true"],
.shoe-style-tab[aria-current="page"] {
  color: var(--wine);
  box-shadow: inset 0 -2px var(--wine);
}

.shoe-style-count {
  margin-inline-start: 5px;
  font-size: 11px;
  font-weight: 400;
}

[data-shoe-collection] .collection .shoe-directory-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 400px);
  align-items: center;
  gap: 12px 22px;
  min-height: 0;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

[data-shoe-collection] .collection .shoe-directory-heading h2 {
  margin: 0;
  font-size: clamp(24px, 3.25vw, 34px);
  line-height: 1.12;
}

.shoe-directory-heading .catalog-search {
  grid-column: auto;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding-inline: 12px;
  border-radius: 7px;
}

.shoe-directory-heading .catalog-search input {
  min-height: 42px;
}

.shoe-filter-bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 7px;
}

.shoe-filter {
  position: relative;
  min-width: 0;
}

.shoe-filter-sort {
  margin-inline-start: auto;
}

.shoe-filter-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdfb;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  list-style: none;
}

.shoe-filter-trigger::-webkit-details-marker {
  display: none;
}

.shoe-filter-trigger::marker {
  content: "";
}

.shoe-filter-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin: -3px 2px 0;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}

.shoe-filter-trigger:hover,
.shoe-filter[open] .shoe-filter-trigger,
.shoe-filter-trigger:has(.shoe-filter-quantity:not([hidden])) {
  border-color: #ab8992;
  background: #f5edef;
  color: var(--wine);
}

.shoe-filter[open] .shoe-filter-trigger::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.shoe-filter-quantity:not([hidden]) {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding-inline: 3px;
  border-radius: 20px;
  background: var(--wine);
  color: #fff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.shoe-filter-menu {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-start: 0;
  width: 258px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdfb;
  box-shadow: 0 12px 24px #30202523;
  color: var(--ink);
}

.shoe-filter-sort .shoe-filter-menu {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.shoe-filter-choices {
  max-height: min(300px, 42vh);
  max-height: min(300px, 42dvh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.shoe-filter-brand-search {
  display: block;
  width: calc(100% - 12px);
  min-height: 42px;
  margin: 4px 6px 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.shoe-filter-choice {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.shoe-filter-choice:hover,
.shoe-filter-choice:has(input:checked) {
  background: #f5edef;
  color: var(--wine);
}

.shoe-filter-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--wine);
}

.shoe-filter-choice:has(input:disabled) {
  color: var(--muted);
  cursor: default;
}

.shoe-filter-choice[hidden] {
  display: none;
}

.shoe-filter-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.shoe-filter-label > span {
  min-width: 0;
}

.shoe-color-swatch {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 1px solid #30202529;
  border-radius: 50%;
}

.shoe-filter-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shoe-filter-actions {
  display: flex;
  justify-content: flex-end;
  padding: 7px 5px 4px;
  border-top: 1px solid var(--line);
}

.shoe-filter-done {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--wine);
  border-radius: 5px;
  background: var(--wine);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.shoe-filter-chips:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin: 10px 0 0;
}

.shoe-filter-chips .filter-chip {
  gap: 7px;
  max-width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid #dac9cb;
  border-radius: 6px;
  background: #f5edef;
  color: var(--wine);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.shoe-filter-chips :is(.shoe-filter-clear,.filter-clear-all,.clear-filters) {
  min-height: 34px;
  margin: 0;
  padding: 5px 4px;
  border: 0;
  background: transparent;
  color: var(--wine);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shoe-catalog-total {
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.shoe-style-tab:focus-visible,
.shoe-filter-trigger:focus-visible,
.shoe-filter-brand-search:focus-visible,
.shoe-catalog-breadcrumb button:focus-visible,
.shoe-sheet button:focus-visible,
.shoe-filter-choice input:focus-visible,
.shoe-filter-done:focus-visible,
.shoe-filter-chips button:focus-visible {
  outline: 2px solid #a87534;
  outline-offset: 2px;
}

@media (max-width: 1023px) {
  [data-shoe-collection] #product-grid {
    scroll-margin-top: 106px;
  }

  .shoe-sticky-tools {
    position: sticky;
    z-index: 10;
    top: 0;
    margin-inline: -4px;
    padding: 0 4px 6px;
    background: #faf8f4;
  }

  .shoe-style-tabs-wrap {
    margin: 0 0 3px;
  }

  .shoe-style-tabs-wrap::after {
    content: "";
    position: absolute;
    inset-block: 0 2px;
    inset-inline-end: 0;
    width: 18px;
    background: linear-gradient(to right, #faf8f400, #faf8f4);
    pointer-events: none;
  }

  .shoe-style-tab {
    min-height: 44px;
    font-size: 13px;
  }

  .shoe-style-tab:disabled {
    opacity: .55;
    cursor: default;
  }

  .shoe-filter-toolbar #shoe-filter-bar {
    display: none;
  }

  .shoe-mobile-filter-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .shoe-mobile-filter-buttons .shoe-filter-trigger {
    justify-content: center;
    min-height: 44px;
  }

  .shoe-mobile-filter-buttons .shoe-filter-trigger::after {
    display: none;
  }

  .shoe-mobile-filter-buttons svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.5px;
  }

  body:has(.shoe-sheet[open]) {
    overflow: hidden;
  }

  .shoe-sheet[open] {
    position: fixed;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    width: min(100%, 630px);
    max-width: 100%;
    max-height: min(660px, 86vh);
    max-height: min(660px, calc(94dvh - env(safe-area-inset-top, 0px)));
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 16px 16px 0 0;
    background: #fffdfb;
    color: var(--ink);
  }

  .shoe-sheet::backdrop {
    background: #30202570;
  }

  .shoe-sheet-heading,
  .shoe-sheet-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
  }

  .shoe-sheet-heading {
    border-bottom: 1px solid var(--line);
  }

  .shoe-sheet-heading h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
  }

  .shoe-sheet-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--wine);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
  }

  .shoe-sheet-body {
    min-height: 0;
    padding: 4px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .shoe-sheet .shoe-filter {
    position: static;
    border-bottom: 1px solid var(--line);
  }

  .shoe-sheet .shoe-filter:last-child {
    border-bottom: 0;
  }

  .shoe-sheet .shoe-filter-trigger {
    min-height: 48px;
    padding: 6px 2px;
    border: 0;
    background: transparent;
  }

  .shoe-sheet .shoe-filter-trigger::after {
    margin-inline-start: auto;
  }

  .shoe-sheet .shoe-filter-menu {
    position: static;
    width: 100%;
    padding: 0 0 6px;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .shoe-sheet .shoe-filter-choices {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .shoe-sheet .shoe-filter-choice,
  .shoe-sheet-actions button {
    min-height: 44px;
  }

  .shoe-sheet-actions {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
  }

  #mobile-filter-clear {
    padding-inline: 8px;
    border: 0;
    background: transparent;
    color: var(--wine);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  #mobile-filter-apply {
    flex: 1;
  }

  #mobile-sort-choices {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 767px) {
  [data-shoe-collection] :is(.hero,.benefit-band,.shopping-guide,.photo-search-strip,.collection-variants) {
    display: none;
  }

  [data-shoe-collection] #collection {
    padding-top: 0;
  }

  .shoe-listing-head {
    display: block;
    padding-bottom: 6px;
  }

  .shoe-catalog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
  }

  .shoe-catalog-breadcrumb button {
    min-height: 44px;
    min-width: 44px;
    margin-inline-start: -3px;
    padding-inline: 3px;
    border: 0;
    background: transparent;
    color: var(--wine);
    cursor: pointer;
    font: inherit;
    text-align: start;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .shoe-listing-head h1 {
    margin: -1px 0 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(28px, 8vw, 36px);
    font-weight: 400;
    line-height: 1.1;
  }

  [data-shoe-collection] .collection .shoe-directory-heading {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .shoe-directory-heading h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .shoe-filter-chips :is(.filter-chip,.shoe-filter-clear,.filter-clear-all,.clear-filters) {
    min-height: 44px;
  }

  .shoe-catalog-total {
    margin: 5px 0 9px;
  }
}

.shoe-style-tab,
.shoe-filter-trigger,
.shoe-filter-choice,
.shoe-filter-done,
.shoe-filter-chips button {
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 1023px) {
  #mobile-filter-sheet[open] {
    height: min(660px, 85dvh);
  }

  .shoe-sheet[open] {
    max-height: min(660px, calc(85dvh - env(safe-area-inset-top, 0px)));
  }

  @media (prefers-reduced-motion: no-preference) {
    .shoe-sheet[open] {
      animation: shoe-filter-enter 180ms ease-out both;
    }

    @keyframes shoe-filter-enter {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .shoe-mobile-drawer[open] {
    animation: shoe-drawer-enter 180ms ease-out both;
  }

  @keyframes shoe-drawer-enter {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
  }
}
