:root {
  --page: #ffffff;
  --ink: #000000;
  --product-backdrop: #f6f6f6;
  --gutter: 8px;
  --home-grid-column-gap: 16px;
  --home-grid-row-gap: 32px;
  --chrome: 16px;
  --type-size: 12px;
  --line-height: normal;
  --bag-panel-width: 400px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: var(--type-size);
  font-weight: 400;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  margin: 0;
  background: var(--page);
}

a,
button {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 77px;
  padding: var(--chrome);
  background: transparent;
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.text-link,
.category-link {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
}

.text-link {
  cursor: pointer;
}

.brand-link {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 32px;
  height: 45px;
  text-decoration: none;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.brand-link img {
  display: block;
  width: 100%;
  height: 100%;
}

.bag-button {
  min-width: 39px;
  text-align: right;
}

.category-nav {
  display: none;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: var(--chrome);
}

.category-link.is-active {
  text-decoration: underline;
  text-underline-position: from-font;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--home-grid-column-gap);
  row-gap: var(--home-grid-row-gap);
  width: 100%;
  padding: 0 var(--chrome) var(--chrome);
}

.product-card {
  min-width: 0;
  overflow: hidden;
  background: transparent;
}

.product-link {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.product-link:focus-visible,
.text-link:focus-visible,
.category-link:focus-visible,
.add-to-bag-button:focus-visible,
.bag-panel button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--product-backdrop);
}

.product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: var(--gutter) 0;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}

.product-meta p {
  margin: 0;
  font-size: var(--type-size);
  line-height: var(--line-height);
}

.pdp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  width: 100%;
}

.pdp-images {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  min-width: 0;
}

.pdp-image-scroll {
  display: none;
}

.pdp-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 189 / 250;
  overflow: hidden;
  background: var(--product-backdrop);
  cursor: zoom-in;
}

.pdp-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-details {
  position: sticky;
  top: var(--chrome);
  min-width: 0;
  padding-top: var(--chrome);
}

.pdp-details-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
}

.pdp-title-price {
  order: 1;
  margin-bottom: 16px;
}

.pdp-copy {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.pdp-copy-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdp-copy-group h1,
.pdp-copy-group h2,
.pdp-copy-group p {
  margin: 0;
  font-size: var(--type-size);
  line-height: var(--line-height);
}

.pdp-copy-group h1,
.pdp-copy-group h2,
.add-to-bag-button {
  font-weight: 400;
}

.pdp-copy a {
  text-decoration: underline;
  text-underline-position: from-font;
}

.add-to-bag-button {
  order: 3;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  cursor: pointer;
}

.add-to-bag-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.add-to-bag-button.is-adding {
  opacity: 1;
}

.info-page {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 520px;
  padding: 16px;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-section h1,
.info-section h2,
.info-section p {
  margin: 0;
  font-size: var(--type-size);
  line-height: var(--line-height);
}

.info-section h1,
.info-section h2 {
  font-weight: 400;
}

.info-section a {
  text-decoration: underline;
  text-underline-position: from-font;
}

.bag-is-open {
  overflow: hidden;
}

.image-zoom-is-open {
  overflow: hidden;
}

.image-zoom {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  overflow: hidden;
  background: var(--page);
  cursor: zoom-out;
  touch-action: none;
}

.image-zoom.is-open {
  display: block;
}

.image-zoom img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  max-height: none;
  user-select: none;
  cursor: grab;
}

.image-zoom.is-dragging,
.image-zoom.is-dragging img {
  cursor: grabbing;
}

.bag-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(var(--bag-panel-width), 100vw);
  height: 100dvh;
  border-left: 1px solid var(--ink);
  background: var(--page);
  transform: translateX(100%);
  transition: transform 300ms ease;
}

.bag-panel.is-open {
  transform: translateX(0);
}

.bag-panel-header,
.bag-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--chrome);
}

.bag-panel-footer {
  flex-direction: column;
  gap: 16px;
}

.bag-subtotal {
  width: 100%;
  margin: 0;
}

.bag-panel-header h2 {
  margin: 0;
  font-size: var(--type-size);
  font-weight: 400;
  line-height: var(--line-height);
}

.bag-close,
.bag-item-remove,
.bag-checkout {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.bag-items {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 0 var(--chrome) var(--chrome);
}

.bag-empty {
  margin: 0;
}

.bag-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
}

.bag-item-image {
  display: block;
  width: 100%;
  aspect-ratio: 189 / 250;
  overflow: hidden;
  background: var(--product-backdrop);
}

.bag-item-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bag-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bag-item-details p {
  margin: 0;
}

.bag-item-title {
  font-weight: 400;
}

.bag-item-remove {
  align-self: flex-start;
  margin-top: 4px;
  text-decoration: underline;
  text-underline-position: from-font;
}

.bag-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-weight: 400;
}

.bag-checkout:disabled {
  cursor: default;
  opacity: 0.45;
}

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

  .bag-panel {
    width: 100vw;
  }

  .pdp-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
  }

  .pdp-images {
    display: flex;
    flex-direction: row;
    gap: 0;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .pdp-images::-webkit-scrollbar {
    display: none;
  }

  .pdp-image-frame {
    display: block;
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  .pdp-image-scroll {
    display: block;
    width: 100%;
    height: 4px;
    overflow: hidden;
    background: #f6f6f6;
  }

  .pdp-image-scroll[hidden] {
    display: none;
  }

  .pdp-image-scroll-thumb {
    width: 100%;
    height: 100%;
    background: var(--ink);
    transform: translateX(0);
    transform-origin: left center;
  }

  .pdp-details {
    position: static;
    width: 100%;
    margin-top: 24px;
    padding: 0 var(--chrome);
  }

  .pdp-details-inner {
    gap: 16px;
    max-width: none;
  }

  .pdp-title-price {
    margin-bottom: 0;
  }

  .pdp-copy {
    order: 3;
    gap: 16px;
    margin-bottom: 0;
  }

  .add-to-bag-button {
    order: 2;
    width: 100%;
  }
}
