#shop, .product-dialog, .bag-drawer {
  --product-photo-background: radial-gradient(ellipse at 50% 43%, #292929 0%, #242424 55%, #1c1c1c 100%);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: clamp(1.15rem, 2.5vw, 1.9rem);
}
.filter {
  min-height: 2.75rem;
  padding-inline: clamp(.58rem, 1.5vw, 1.05rem);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  font-size: .8125rem;
  text-transform: inherit;
  letter-spacing: .065em;
  transition: color var(--speed), background var(--speed), border-color var(--speed);
}
.filter:hover { border-color: var(--white); }
.filter[aria-pressed='true'] { background: var(--white); color: var(--black); border-color: var(--white); }

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(.68rem, 1.55vw, 1.5rem);
}
.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-radius: var(--product-radius);
  background: #0d0d0d;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 5%);
}
.product-grid[data-filtered] .product-card {
  animation: catalog-appear .32s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--product-order) * 22ms);
}
@keyframes catalog-appear {
  from { opacity: .35; transform: translateY(.35rem); }
  to { opacity: 1; transform: translateY(0); }
}
.product-stage { position: relative; }
.product-image {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.65;
  overflow: hidden;
  padding: 0;
  border-radius: var(--product-radius) var(--product-radius) 0 0;
  background: var(--product-photo-background);
}
.product-photo {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: calc(100% - 1.65rem);
  object-fit: contain;
  transform: scale(1.035);
  pointer-events: none;
  transition: opacity .35s ease;
}
.product-photo-alternate { opacity: 0; }
.product-stage[data-alternate-ready]:is([data-hover-alternate], [data-show-alternate]) .product-photo { opacity: 0; }
.product-stage[data-alternate-ready]:is([data-hover-alternate], [data-show-alternate]) .product-photo-alternate { opacity: 1; }
.product-image.glare-hover::after {
  background: linear-gradient(-45deg, transparent 9%, rgb(255 255 255 / 4%) 29%, rgb(255 255 255 / 15%) 50%, rgb(255 255 255 / 4%) 71%, transparent 91%);
}
.product-image:focus-visible { z-index: 1; outline-offset: -3px; }
.product-image-label, .product-view-toggle {
  position: absolute;
  z-index: 2;
}
.product-image-label { inset: auto .4rem .55rem auto; pointer-events: none; }
.product-view-toggle { inset: auto auto 0 .4rem; min-height: 2.75rem; padding: 0; touch-action: manipulation; }
.product-image-label, .product-view-toggle > span {
  display: block;
  padding: .3rem .45rem;
  border-radius: 4px;
  background: rgb(5 5 5 / 77%);
  color: var(--white);
  font: .6875rem/1.35 var(--mono);
  white-space: nowrap;
}
.product-view-toggle > span { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 24%); }
.product-view-toggle:hover > span { background: var(--white); color: var(--black); }
.product-info { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: clamp(.65rem, 1.2vw, 1.1rem); }
.product-meta { display: flex; justify-content: space-between; gap: .35rem; color: #b8b8b8; font-size: .75rem; letter-spacing: .07em; }
.product-line { margin-block: .42rem .85rem; }
.product-line h3 { font: 400 clamp(1.1rem, 1.88vw, 1.9rem)/1.07 var(--display); letter-spacing: .012em; }
.product-line .product-price { margin-top: .22rem; font-size: .875rem; }
.product-info .product-form, .product-info > .button { margin-top: auto; }
.product-form { display: grid; grid-template-columns: 1fr; gap: .5rem; align-items: stretch; }
.product-field { display: grid; min-width: 0; gap: .35rem; }
.product-field-label { font: .8125rem var(--mono); }
.size-select { display: grid; min-width: 0; position: relative; }
.size-select::after {
  position: absolute;
  top: 43%;
  right: .66rem;
  content: '';
  width: .38rem;
  height: .38rem;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.size-select select {
  appearance: none;
  width: 100%;
  min-height: 2.75rem;
  padding: .4rem 1.35rem .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  color: var(--white);
  background: #171717;
  font: .8125rem var(--mono);
}
.product-form .button { min-height: 2.75rem; padding: .42rem .55rem; font-size: .75rem; letter-spacing: .025em; text-align: center; }
.product-field [aria-invalid='true'], .detail-stepper [aria-invalid='true'] { border-color: var(--white); }
.catalog-empty { grid-column: 1 / -1; padding-block: 2rem; }
.bag-line img { object-fit: contain; background: var(--product-photo-background); }

.product-dialog {
  width: min(calc(100% - 1.5rem), 62rem);
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  border-radius: var(--product-radius);
  animation: enter var(--speed) ease both;
}
.product-dialog .dialog-head { position: sticky; z-index: 3; top: 0; min-height: 3.75rem; background: #0b0b0b; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(1rem, 3vw, 2.25rem); padding: clamp(.8rem, 2.2vw, 1.65rem); }
.detail-gallery, .detail-info { min-width: 0; }
.detail-image-frame {
  height: clamp(13rem, 53dvh, 32rem);
  overflow: hidden;
  background: var(--product-photo-background);
  border: 1px solid var(--line);
  border-radius: var(--product-radius);
  scrollbar-color: #777 #141414;
  scrollbar-width: thin;
}
.detail-image-canvas { width: 100%; height: 100%; }
.detail-image-canvas img { width: 100%; height: 100%; object-fit: contain; animation: product-photo-enter .3s ease both; }
@keyframes product-photo-enter {
  from { opacity: .48; }
  to { opacity: 1; }
}
.detail-image-frame.is-enlarged { overflow: auto; overscroll-behavior: contain; }
.detail-image-frame.is-enlarged .detail-image-canvas { width: 200%; height: 200%; }
.detail-image-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .15rem .12rem; }
.detail-view-name { color: #b8b8b8; }
.zoom-button { min-height: 2.75rem; padding-inline: .25rem; font: .8125rem var(--mono); text-decoration: underline; text-underline-offset: .25em; }
.detail-views { display: flex; gap: .4rem; padding: 3px; margin-inline: -3px; overflow: auto; scrollbar-width: thin; }
.detail-view {
  flex: 0 0 auto;
  width: 3.6rem;
  height: 3.6rem;
  overflow: hidden;
  padding: .14rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--product-photo-background);
}
.detail-view[aria-pressed='true'], .detail-view:hover { border-color: var(--white); }
.detail-view:focus-visible { outline-offset: 1px; }
.detail-view img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.detail-info { display: flex; flex-direction: column; justify-content: center; }
.detail-info .product-meta { max-width: 17rem; justify-content: flex-start; gap: 1rem; }
.detail-info h2 { font: 400 clamp(2.3rem, 4.8vw, 4.15rem)/.98 var(--display); margin-block: .7rem .65rem; }
.detail-info .product-price { font-size: 1.08rem; }
.detail-info .description { margin-block: 1rem 1.25rem; max-width: 37ch; }
.detail-info .detail-availability { margin-top: .7rem; }
.detail-form { grid-template-columns: minmax(0, 1fr) auto; }
.detail-form .button { grid-column: 1 / -1; margin-top: .1rem; }
.detail-stepper { display: grid; grid-template-columns: 2.75rem 2.65rem 2.75rem; min-height: 2.75rem; overflow: hidden; border-radius: var(--button-radius); border: 1px solid var(--line); background: #171717; }
.detail-stepper button, .detail-stepper input { min-width: 0; text-align: center; padding: 0; color: var(--white); background: transparent; font: .875rem var(--mono); }
.detail-stepper button:focus-visible, .detail-stepper input:focus-visible { outline-offset: -3px; }
.detail-stepper button:hover { background: #2a2a2a; }
.detail-stepper input { appearance: textfield; border: 1px solid transparent; }
.detail-stepper input::-webkit-inner-spin-button, .detail-stepper input::-webkit-outer-spin-button { appearance: none; }

@media (min-width: 22rem) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 52rem) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 77rem) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .product-info .product-form { grid-template-columns: minmax(3.65rem, .6fr) minmax(0, 1.4fr); } }
@media (max-width: 42rem) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-image-frame { height: clamp(12rem, 42dvh, 24rem); }
  .product-line .product-price { font-size: .8125rem; }
}
@media (max-width: 24rem) {
  .product-view-prefix { display: none; }
  .product-view-toggle [data-view-face] { text-transform: capitalize; }
  .detail-form { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .product-grid[data-filtered] .product-card, .detail-image-canvas img { animation: none; }
  .product-photo { transition: none; }
}
