.shop-page {
  --shop-background: #050505;
  --shop-foreground: #f5f5f5;
  --shop-muted: #a2a2a2;
  background: var(--shop-background);
  color: var(--shop-foreground);
}

.shop-layout {
  position: relative;
  flex: 1 0 auto;
  width: min(calc(100% - 3rem), 92rem);
  margin: clamp(3rem, 7vh, 5rem) auto 4rem;
}

.shop-sidebar {
  position: absolute;
  top: 0;
  left: calc(50% - 29rem - 5.25rem);
  width: 4.25rem;
}

.category-nav {
  position: sticky;
  top: 2rem;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 0.1rem;
}

.category-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--shop-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  text-transform: lowercase;
  transition: color 140ms ease;
}

.category-button:hover,
.category-button[aria-pressed="true"] {
  color: var(--shop-foreground);
}

.shop-page button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

.shop-collection {
  width: min(100%, 58rem);
  min-width: 0;
  margin-inline: auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 10.5rem));
  justify-content: center;
  column-gap: clamp(0.55rem, 1.1vw, 1rem);
  row-gap: clamp(1.35rem, 2.2vw, 2rem);
}

.product-card[hidden] {
  display: none;
}

.product-card {
  min-width: 0;
}

.product-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-visual {
  aspect-ratio: 0.9;
  background: #e7e5df;
}

.product-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem;
  padding-top: 0.22rem;
}

.product-caption h2,
.product-caption span {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1.35;
  text-transform: lowercase;
}

.product-caption h2 {
  overflow: hidden;
  color: var(--shop-foreground);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-caption span {
  flex: 0 0 auto;
  color: var(--shop-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .shop-layout {
    width: min(calc(100% - 3rem), 58rem);
  }

  .shop-sidebar {
    position: static;
    width: auto;
  }

  .category-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.7rem 1.4rem;
    margin-bottom: 1.5rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(0, 10rem));
  }
}

@media (max-width: 760px) {
  .shop-layout {
    display: block;
    width: min(calc(100% - 2rem), 42rem);
    margin-top: 3rem;
  }

  .category-nav {
    margin-bottom: 1.5rem;
  }

  .shop-collection {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.65rem;
    row-gap: 1.4rem;
  }

  .product-visual {
    aspect-ratio: 0.88;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-button {
    transition-duration: 0.01ms !important;
  }
}
