.shop-page {
  padding-bottom: clamp(3rem, 6vw, 5rem);
  max-width: 100%;
  overflow-x: clip;
}

.shop-hero {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 1.25rem;
}

.shop-count {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  max-width: 100%;
}

.shop-sort {
  margin-left: auto;
  max-width: 100%;
}

.shop-sort select,
.shop-filters select,
.filter-price input {
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-line-strong);
  background: var(--color-off-white);
  max-width: 100%;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 1.5rem;
  margin-bottom: 1.25rem;
  max-width: 100%;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 17.5rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  max-width: 100%;
}

.shop-filters {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  display: grid;
  gap: 1.35rem;
  padding: 1.25rem;
  background: var(--color-cream);
  border: 1px solid var(--color-line);
  width: 100%;
  max-width: 17.5rem;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.filter-sheet__head,
.filter-sheet__backdrop,
.filter-sheet__close,
.filter-sheet__actions {
  display: none;
}

.filter-group h2,
.filter-group h3 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brown);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: 100%;
}

.filter-chip {
  min-height: 2.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--color-line-strong);
  background: var(--color-off-white);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  max-width: 100%;
}

.filter-chip.is-active {
  background: var(--color-brown);
  border-color: var(--color-brown);
  color: var(--color-cream);
}

.filter-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 100%;
}

.filter-swatch {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(28, 24, 20, 0.15);
  flex: 0 0 auto;
}

.filter-swatch.is-active {
  border-color: var(--color-brown);
}

.filter-price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  max-width: 100%;
}

.shop-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  max-width: 100%;
}

.shop-empty,
.wishlist-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--color-muted);
}

.wishlist-empty {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
}

@media (min-width: 901px) {
  .shop-filter-open,
  [data-filter-open] {
    display: none;
  }

  .filter-sheet {
    display: contents;
  }
}

@media (max-width: 1100px) {
  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    display: block;
  }

  .filter-sheet.is-open {
    pointer-events: auto;
  }

  .filter-sheet__backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(28, 24, 20, 0.35);
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
  }

  .filter-sheet.is-open .filter-sheet__backdrop {
    opacity: 1;
  }

  .shop-filters {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: min(92vh, 44rem);
    overflow: auto;
    transform: translateY(104%);
    transition: transform var(--duration-slow) var(--ease);
    border: none;
    border-radius: 1rem 1rem 0 0;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .filter-sheet.is-open .shop-filters {
    transform: none;
  }

  .filter-sheet__head,
  .filter-sheet__close,
  .filter-sheet__actions {
    display: flex;
  }

  .filter-sheet__head {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }

  .filter-sheet__head h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
  }

  .filter-sheet__actions {
    position: sticky;
    bottom: 0;
    gap: 0.65rem;
    flex-direction: column;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    background: linear-gradient(to top, var(--color-cream) 70%, transparent);
  }

  .filter-apply {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1600px) {
  .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
