.commerce-page,
.commerce-drawer {
  --commerce-paper: #f6f4ed;
  --commerce-ink: #161814;
  --commerce-lime: #d8ff3f;
  --commerce-rule: #cfcfc3;
  color: var(--commerce-ink);
}

.commerce-page {
  width: min(1160px, 100% - 3rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 4.75rem) clamp(3.25rem, 8vw, 6.75rem);
}

.commerce-page h1,
.commerce-page h2,
.commerce-page h3,
.commerce-page h4,
.commerce-drawer h2,
.commerce-drawer h3,
.commerce-panel legend {
  font-family: "Space Grotesk", Arial, sans-serif;
  line-height: 1.04;
  letter-spacing: -.045em;
}

.commerce-page h1 {
  max-width: 19ch;
  margin: .3rem 0 1.5rem;
  font-size: clamp(2.9rem, 7.25vw, 6rem);
}

.commerce-page h2,
.commerce-page h3,
.commerce-drawer h3 {
  margin: .25em 0 .55em;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.commerce-kicker {
  margin: 0;
  font-size: .67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.commerce-intro {
  max-width: 55ch;
  margin: 0 0 2rem;
  color: #4e5044;
}

.commerce-back {
  display: inline-block;
  margin-bottom: 1.4rem;
  font-size: .88rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.commerce-drawer {
  width: min(31rem, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  inset: 0 0 0 auto;
  margin: 0;
  padding: 0;
  border: none;
  border-inline-start: 1px solid var(--commerce-ink);
  background: var(--commerce-paper);
  overflow: hidden;
}

.commerce-drawer::backdrop {
  background: rgb(22 24 20 / .58);
}

html:has(.commerce-drawer[open]) {
  overflow: hidden;
}

.commerce-drawer-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.commerce-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border-block-end: 1px solid var(--commerce-ink);
}

.commerce-drawer-header h2 {
  margin: .25rem 0 0;
  font-size: clamp(2.3rem, 8vw, 3rem);
}

.commerce-close {
  appearance: none;
  flex: 0 0 auto;
  display: grid;
  align-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0 0 .13em;
  border: 1px solid var(--commerce-ink);
  border-radius: 50%;
  background: transparent;
  color: var(--commerce-ink);
  font: 350 1.9rem/1 Arial, sans-serif;
  text-align: center;
  cursor: pointer;
}

.commerce-close:hover,
.commerce-quantity button:hover:not(:disabled) {
  background: var(--commerce-lime);
}

[data-commerce-drawer-body] {
  flex: 1;
  height: 100%;
  padding: 0 1.5rem 1.5rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.commerce-empty {
  margin-top: 1.25rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--commerce-rule);
  background: #eeece3;
}

.commerce-empty > p:not(.commerce-kicker) {
  margin: 0 0 1.15rem;
}

.commerce-button {
  appearance: none;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 3.15rem;
  padding: .75rem 1.1rem;
  border: 1px solid var(--commerce-ink);
  border-radius: 0;
  background: var(--commerce-lime);
  color: var(--commerce-ink);
  font: 800 .91rem/1.15 "Space Grotesk", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.commerce-button:hover:not(:disabled) {
  background: var(--commerce-ink);
  color: var(--commerce-lime);
}

.commerce-button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.commerce-full {
  width: 100%;
}

.commerce-cart-layout,
.commerce-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.75rem, 4vw, 4rem);
}

.commerce-drawer .commerce-cart-layout {
  display: block;
}

.commerce-lines,
.commerce-order-lines {
  padding: 0;
  margin: 0;
  list-style: none;
}

.commerce-line {
  display: grid;
  grid-template-columns: minmax(3.5rem, 16%) minmax(0, 1fr) auto;
  gap: 1rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--commerce-rule);
}

.commerce-line:first-child {
  border-top: 1px solid var(--commerce-rule);
}

.commerce-drawer .commerce-line:first-child {
  border-top: 0;
}

.commerce-line-picture {
  display: block;
  align-self: start;
  aspect-ratio: 1;
  background: #e7e5d9;
  overflow: hidden;
}

.commerce-line-picture .commerce-picture,
.commerce-line-picture img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  object-fit: cover;
}

.commerce-line-name {
  display: inline-block;
  font-weight: 800;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.commerce-line-name:hover {
  text-decoration: underline;
  text-underline-offset: .13em;
}

.commerce-line-main p {
  margin: .25rem 0;
  color: #4e5044;
  font-size: .82rem;
}

.commerce-line-end {
  display: grid;
  align-content: space-between;
  justify-items: end;
  text-align: right;
  gap: .3rem;
}

.commerce-line-end strong {
  font-size: .9rem;
  white-space: nowrap;
}

.commerce-quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--commerce-rule);
  margin-top: .4rem;
  min-width: 6rem;
}

.commerce-quantity button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--commerce-ink);
  font: 700 1rem/1 Arial, sans-serif;
  cursor: pointer;
}

.commerce-quantity button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.commerce-quantity span {
  flex: 1;
  text-align: center;
  font-size: .83rem;
}

.commerce-text-button {
  appearance: none;
  display: inline-block;
  min-height: 2rem;
  margin: .13rem 0;
  border: 0;
  border-radius: 0;
  padding: .23rem 0;
  background: transparent;
  color: var(--commerce-ink);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: .14em;
  cursor: pointer;
}

.commerce-cart-summary {
  border: 1px solid var(--commerce-rule);
  padding: 1.25rem;
}

.commerce-drawer .commerce-cart-summary {
  padding: 1rem 0 0;
  border: 0;
}

.commerce-shipping-callout {
  margin: 0;
  padding: .75rem;
  background: #e7efc9;
  font-size: .82rem;
  font-weight: 700;
}

.commerce-totals {
  display: grid;
  gap: .65rem;
  margin: 1rem 0;
  font-size: .9rem;
}

.commerce-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.commerce-totals dt,
.commerce-totals dd {
  margin: 0;
}

.commerce-totals dd {
  text-align: right;
}

.commerce-grand-total {
  padding-top: .85rem;
  border-top: 1px solid var(--commerce-ink);
  font-size: 1.05rem;
  font-weight: 850;
}

.commerce-small {
  margin: .7rem 0 0;
  color: #4e5044;
  font-size: .79rem;
  line-height: 1.4;
}

.commerce-checkout-main {
  display: grid;
  gap: 1rem;
}

.commerce-panel {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--commerce-rule);
  padding: clamp(1rem, 3vw, 1.6rem);
}

.commerce-panel legend {
  padding: 0 .5rem;
  font-size: 1.4rem;
  font-weight: 800;
}

.commerce-checkout-summary {
  background: #eeece3;
}

.commerce-option {
  display: flex;
  align-items: center;
  min-height: 2.65rem;
  gap: .6rem;
  width: fit-content;
  cursor: pointer;
}

.commerce-option input {
  margin: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--commerce-ink);
}

.commerce-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .5rem;
}

.commerce-selects[hidden] {
  display: none;
}

.commerce-selects label {
  display: grid;
  gap: .25rem;
  font-weight: 700;
  font-size: .81rem;
}

.commerce-selects select {
  appearance: auto;
  min-height: 2.75rem;
  width: 100%;
  margin: 0;
  border: 1px solid var(--commerce-rule);
  border-radius: 0;
  padding: .55rem;
  background: var(--commerce-paper);
  color: var(--commerce-ink);
  font: inherit;
}

.commerce-order-lines li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: .6rem;
  border-bottom: 1px solid var(--commerce-rule);
  font-size: .89rem;
}

.commerce-order-lines strong {
  white-space: nowrap;
}

.commerce-order-lines small {
  display: block;
  margin-top: .2rem;
  color: #4e5044;
  font-size: .78rem;
}

.commerce-timeline {
  display: grid;
  gap: .2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.commerce-timeline li {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding-block: .4rem;
}

.commerce-timeline li::before {
  content: "";
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: var(--commerce-rule);
}

.commerce-timeline li[aria-current] {
  font-weight: 850;
}

.commerce-timeline li[aria-current]::before {
  background: var(--commerce-lime);
  box-shadow: 0 0 0 1px var(--commerce-ink);
}

.commerce-orders {
  margin-top: 1.5rem;
}

.commerce-orders summary {
  width: fit-content;
  font-weight: 700;
  cursor: pointer;
}

.commerce-orders a {
  text-decoration: underline;
  text-underline-offset: .14em;
}

.commerce-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .commerce-page {
    width: calc(100% - 2rem);
  }

  .commerce-cart-layout,
  .commerce-checkout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 400px) {
  .commerce-drawer-header {
    padding-inline: 1rem;
  }

  [data-commerce-drawer-body] {
    padding-inline: 1rem;
  }

  .commerce-line {
    gap: .5rem;
  }

  .commerce-selects {
    grid-template-columns: minmax(0, 1fr);
  }
}
