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

.store-masthead {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: clamp(2rem, 5vh, 3.5rem) 1.25rem 0;
}

.store-brand {
  display: block;
  width: clamp(4.5rem, 7vw, 6rem);
  aspect-ratio: 1;
}

.store-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.store-masthead .eastern-time {
  margin-top: 0.85rem;
}

.cart-link {
  position: absolute;
  top: clamp(2rem, 5vh, 3.5rem);
  right: clamp(1.25rem, 4vw, 3rem);
  color: var(--shop-foreground);
  font-size: 0.72rem;
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: lowercase;
}

.cart-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.product-layout,
.cart-layout {
  flex: 1 0 auto;
  width: min(calc(100% - 3rem), 76rem);
  margin: clamp(3rem, 7vh, 5rem) auto 4rem;
}

.commerce-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--shop-muted);
  font-size: 0.72rem;
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: lowercase;
}

.commerce-back:hover {
  color: var(--shop-foreground);
}

.product-content {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(19rem, 0.85fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
}

.product-image {
  width: 100%;
  aspect-ratio: 0.9;
  background: #e7e5df;
}

.product-details {
  padding-top: clamp(0.5rem, 3vw, 2.5rem);
}

.product-category {
  margin: 0 0 0.55rem;
  color: var(--shop-muted);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.product-details h1,
.cart-layout h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-transform: lowercase;
}

.product-description {
  max-width: 27rem;
  margin: 1.15rem 0 2.25rem;
  color: #c9c9c9;
  font-size: 0.86rem;
  line-height: 1.6;
}

.size-picker {
  margin: 0 0 1.35rem;
  padding: 0;
  border: 0;
}

.size-picker legend {
  margin-bottom: 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.045em;
  text-transform: lowercase;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.size-option {
  min-width: 2.7rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #555;
  background: transparent;
  color: var(--shop-foreground);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  text-transform: lowercase;
}

.size-option:hover,
.size-option[aria-pressed="true"] {
  border-color: var(--shop-foreground);
  background: var(--shop-foreground);
  color: var(--shop-background);
}

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

.size-note,
.checkout-note,
.cart-demo-note {
  color: var(--shop-muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.size-note {
  margin: 0.7rem 0 0;
}

.primary-action {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--shop-foreground);
  background: var(--shop-foreground);
  color: var(--shop-background);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.045em;
  text-transform: lowercase;
  transition: background-color 140ms ease, color 140ms ease;
}

.primary-action:hover {
  background: transparent;
  color: var(--shop-foreground);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-action:disabled:hover {
  background: var(--shop-foreground);
  color: var(--shop-background);
}

.commerce-status {
  min-height: 1.3em;
  margin: 0.7rem 0 0;
  color: #d2d2d2;
  font-size: 0.72rem;
}

.cart-layout {
  max-width: 62rem;
}

.cart-layout h1 {
  margin-top: 0.2rem;
}

.cart-demo-note {
  margin: 0.7rem 0 2rem;
}

.cart-items {
  border-top: 1px solid #303030;
}

.cart-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid #303030;
}

.cart-product-name,
.cart-product-detail {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: lowercase;
}

.cart-product-detail {
  color: var(--shop-muted);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.quantity-button,
.remove-button {
  border: 0;
  background: none;
  color: var(--shop-foreground);
  cursor: pointer;
  font: inherit;
}

.quantity-button {
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid #555;
  font-size: 1rem;
}

.quantity-value {
  min-width: 1.2rem;
  text-align: center;
  font-size: 0.75rem;
}

.remove-button {
  color: var(--shop-muted);
  font-size: 0.68rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-transform: lowercase;
}

.cart-empty[hidden] {
  display: none;
}

.cart-empty {
  padding: 1.5rem 0;
  color: #c9c9c9;
  font-size: 0.85rem;
}

.cart-summary {
  width: min(100%, 22rem);
  margin: 2rem 0 0 auto;
}

.cart-summary > p:first-child,
.cart-summary > p:nth-child(2) {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
}

.cart-summary > p:nth-child(2) span:last-child {
  color: var(--shop-muted);
}

.cart-summary .primary-action {
  margin-top: 1.3rem;
}

.checkout-note {
  margin: 0.65rem 0 0;
  text-align: center;
}

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

  .product-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .product-image {
    aspect-ratio: 0.95;
  }

  .product-details {
    padding-top: 0;
  }

  .product-description {
    margin-bottom: 1.5rem;
  }

  .cart-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem 1rem;
  }

  .cart-product-detail {
    grid-column: 1;
  }

  .quantity-controls {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .remove-button {
    grid-column: 1;
    justify-self: start;
  }
}

@media (max-width: 430px) {
  .cart-link {
    right: 0.85rem;
    font-size: 0.65rem;
  }

  .cart-summary {
    width: 100%;
  }
}

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