.order-form {
  --order-ink: #171a17;
  --order-paper: #fff;
  --order-line: #242924;
  --order-rule: #d6dbd5;
  --order-soft: #f1f4f0;
  --order-muted: #505a50;
  --order-green: var(--primary, #18592c);
  --order-green-hover: var(--primary-hover, #124520);
  --order-gap: clamp(.75rem, 1.7vw, 1.5rem);
  --order-inset: clamp(.75rem, 1.65vw, 1.3rem);
  --order-quantity-width: 9rem;
  --order-price-width: 7.75rem;
  color: var(--order-ink);
  display: grid;
  gap: var(--order-gap);
  min-width: 0;
}

.order-form-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  min-width: 0;
  padding: 0 0 clamp(.9rem, 2vw, 1.55rem);
  border-bottom: 2px solid var(--order-line);
}

.order-form-heading h1 {
  font-size: clamp(2.55rem, 5vw, 4.15rem);
  line-height: .97;
  letter-spacing: -.072em;
}

.order-form-heading p {
    overflow-wrap: anywhere;
  margin-top: .65rem;
  color: var(--order-muted);
  line-height: 1.35;
}

.order-form-heading-tools, .order-form-preview-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  min-width: 0;
}

.order-form-preview-bar {
  justify-content: space-between;
  padding: .55rem var(--order-inset);
  border: 1px solid var(--order-line);
  background: var(--order-soft);
}

.order-intro {
  display: flex;
  align-items: center;
  gap: var(--order-inset);
  padding: var(--order-inset);
  border: 1px solid var(--order-line);
  background: var(--order-paper);
}
.order-intro img {
  width: clamp(68px, 13vw, 116px);
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--order-rule);
}
.order-intro > div { min-width: 0; }
.order-intro h1 { font-size: clamp(1.2rem, 2.3vw, 1.7rem); line-height: 1.12; overflow-wrap: anywhere; }
.order-intro p { max-width: 68ch; color: var(--order-muted); white-space: pre-line; overflow-wrap: anywhere; }
.order-intro h1 + p { margin-top: .4rem; }
.order-promotion {
  padding: .75rem var(--order-inset);
  border-bottom: 1px solid var(--order-rule);
  color: var(--order-green);
  font-size: .9rem;
}
.order-form-cart-jump { display: none; }

.order-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17.5rem, .48fr);
  align-items: start;
  gap: var(--order-gap);
  min-width: 0;
}

.order-form-stack {
  display: grid;
  gap: var(--order-gap);
  min-width: 0;
}

.buyer-order-history:has(.pickup-access) { grid-template-areas: "orders access"; }
.buyer-order-history:not(:has(.pickup-access)) { grid-template: "orders" auto / minmax(0, 1fr); }
.buyer-order-history .buyer-order-list { grid-area: orders; }
.buyer-order-history .pickup-access { grid-area: access; }
.buyer-qr-jump.button { display: none; }
.buyer-history-heading, .buyer-history-row { padding: .75rem var(--order-inset); }
.buyer-history-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1.25rem; flex-wrap: wrap; background: var(--order-soft); border-bottom: 1px solid var(--order-line); }
.buyer-history-heading h2 { font-size: 1.1rem; }
.buyer-history-heading p { font-size: .85rem; }
.buyer-history-heading strong { margin-inline-start: .35em; white-space: nowrap; }
.buyer-history-row { display: grid; grid-template-columns: minmax(7.8rem,.52fr) minmax(0,1fr) auto; align-items: start; gap: .35rem .9rem; }
.buyer-history-row + .buyer-history-row { border-top: 1px solid var(--order-rule); }
.buyer-history-row { position: relative; }
.buyer-order-ref::after { content: ""; position: absolute; inset: 0; }
.buyer-history-row:hover, .buyer-history-row:focus-within { background: #f7f9f5; }
.buyer-history-meta, .buyer-history-state { display: grid; gap: .25rem; }
.buyer-history-meta { justify-items: start; }
.buyer-history-meta > span, .buyer-items small { color: var(--order-muted); font-size: .78rem; }
.buyer-order-ref { display: inline-block; font-family: ui-monospace, monospace; color: var(--order-green); font-weight: 750; text-underline-offset: .2em; }
.buyer-history-state { justify-items: end; max-width: 16rem; }
.buyer-amounts { display: grid; gap: .25rem; margin: 0; font-variant-numeric: tabular-nums; }
.buyer-amounts div { display: flex; gap: .5rem; justify-content: space-between; align-items: baseline; }
.buyer-amounts dt { color: var(--order-muted); font-size: .8rem; }
.buyer-amounts dd { font-weight: 750; margin: 0; white-space: nowrap; }
.buyer-history-state .buyer-amounts div { justify-content: flex-end; flex-wrap: wrap; gap: .1rem .4rem; }
.buyer-items { display: grid; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.buyer-items li { display: flex; gap: .5rem; justify-content: space-between; line-height: 1.4; overflow-wrap: anywhere; }
.buyer-items small { display: block; }
.buyer-qty { color: var(--order-muted); font-variant-numeric: tabular-nums; }
.buyer-line-amount { white-space: nowrap; }
.order-form-detail .buyer-amounts { padding-top: .5rem; border-top: 1px solid var(--order-rule); }
.buyer-receipt > summary { cursor: pointer; }
.buyer-receipt > summary h3 { display: inline; font-size: 1rem; }
.buyer-receipt > summary span { display: block; padding-top: .3rem; font-size: .85rem; color: var(--order-muted); }
.buyer-receipt[open] .receipt { margin-top: .75rem; }
.pickup-access { scroll-margin-top: 5rem; }
.pickup-access .pickup-pass { border: 0; }
.pickup-poster .qr { display: block; width: min(100%, 14rem) !important; height: auto !important; aspect-ratio: 1; background: #fff; }
.pickup-qr-help { padding: .65rem .75rem; background: var(--soft); border-inline-start: 4px solid var(--ink); line-height: 1.35; }
.pickup-pass { min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--ink); background: #fff; text-align: center; }
.pickup-pass .pickup-pass-heading { margin: 0; padding: .65rem .85rem; border-bottom: 1px solid var(--ink); background: #edf3e9; color: #234d30; font-size: 1rem; font-weight: 750; line-height: 1.25; letter-spacing: -.015em; }
.pickup-pass-code { display: grid; justify-items: center; gap: .6rem; padding: 1rem .75rem; }
.pickup-pass-code .qr { display: block; width: min(100%, 11rem) !important; height: auto !important; aspect-ratio: 1; background: #fff; border: 1px solid var(--rule); }
.pickup-pass-code .code { padding: .24em .55em; border: 1px solid #9cb29e; background: #edf3e9; color: #234d30; font: 750 1.12rem/1.35 var(--mono); letter-spacing: .055em; }
.pickup-pass-footer { display: grid; justify-items: center; gap: .7rem; padding: .8rem 1rem; border-top: 1px dashed #b2bcb0; }
.pickup-pass .pickup-qr-help { max-width: 38ch; margin: 0; padding: 0; border: 0; background: transparent; color: #3d493f; font-size: .86rem; line-height: 1.45; text-align: center; }
.pickup-detail { display: grid; align-content: start; gap: .85rem; }
.pickup-detail header { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .3rem .75rem; border-bottom: 2px solid #262b26; padding-bottom: .65rem; }
.pickup-detail header p { color: #445144; }
.pickup-details-body { display: grid; gap: .4rem; }
.pickup-details-body:empty { display: none; }
.pickup-details-body .line-list { margin: 0; }
.pickup-details-body .line-list li { line-height: 1.45; }
@media print { .pickup-pass { break-inside: avoid; } }
.pickup-poster { max-width: 38rem; margin: 1.5rem auto; justify-items: center; text-align: center; }
.pickup-poster .qr { width: min(100%, 16rem) !important; }

@media (max-width: 900px) {
  .buyer-order-history:has(.pickup-access) { grid-template-areas: "orders" "access"; }
  .buyer-qr-jump.button { display: inline-flex; }
}
@media (max-width: 620px) {
  .buyer-history-row { grid-template-columns: minmax(0,1fr) auto; }
  .buyer-history-meta { grid-column: 1/-1; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
  .buyer-history-state .buyer-amounts div { display: grid; justify-items: end; }
  .buyer-history-state .buyer-amounts dt { font-size: .72rem; }
  .buyer-history-state { max-width: 8.6rem; }
  .buyer-history-row .tag { font-size: .72rem; text-wrap: balance; }
  .buyer-history-row .buyer-items { font-size: .92rem; }
}

@media print {
  .buyer-order-history:has(.pickup-access) { grid-template: "access" auto "orders" auto / minmax(0, 1fr); }
  .buyer-order-history .pickup-access, .buyer-order-list article { break-inside: avoid; }
  .buyer-order-list .order-form-panel-heading a { display: none; }
  .pickup-poster { max-width: none; min-height: 17cm; align-content: center; margin: 0; padding: 1.3cm; }
  .pickup-poster h1 { font-size: 32pt; }
  .pickup-poster p { max-width: 14cm; font-size: 17pt; }
  .pickup-poster .qr { width: 10cm !important; }
}

.order-form-panel, .order-form .panel {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--order-line);
  border-radius: 0;
  background: var(--order-paper);
  box-shadow: none;
}

.order-form-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
  min-height: 3rem;
  padding: .65rem var(--order-inset);
  border-bottom: 1px solid var(--order-line);
}

.order-form .order-form-panel-heading h2 {
  font-size: 1.2rem;
  font-weight: 740;
  letter-spacing: -.028em;
  line-height: 1.15;
}

.order-form .order-form-panel-heading .order-title h2 { font-size: 1.05rem; }
.order-form-label {
  color: var(--order-muted);
  text-transform: uppercase;
  letter-spacing: .075em;
  font-size: .76rem;
  font-weight: 750;
}

.order-form-column-labels, .order-form .order-form-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--order-price-width) var(--order-quantity-width);
  align-items: center;
  gap: clamp(.55rem, 1.2vw, 1.2rem);
  padding-inline: var(--order-inset);
}

.order-form-column-labels {
  padding-block: .52rem;
  border-bottom: 1px solid var(--order-rule);
  background: var(--order-soft);
  color: var(--order-muted);
  text-transform: uppercase;
  letter-spacing: .075em;
  font-size: .72rem;
  font-weight: 750;
}

.order-form-column-labels > :last-child { text-align: right; }
.order-form-product-list, .order-form-summary-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-form .order-form-product {
  padding-block: clamp(.76rem, 1.35vw, 1.15rem);
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--order-paper);
  box-shadow: none;
  overflow: visible;
}

.order-form-product + .order-form-product { border-top: 1px solid var(--order-rule); }

.order-form-product-identity {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
  min-width: 0;
}

.order-form-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--order-rule);
  background: var(--order-soft);
}

.order-form-thumbnail .media,
.order-form-thumbnail .media :is(img, video),
.order-form-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.order-form-placeholder {
  background: linear-gradient(to bottom right, transparent 49%, #d8dfd6 49.5%, #d8dfd6 50.5%, transparent 51%);
}

.order-form-product-copy {
  display: grid;
  gap: .3rem;
  min-width: 0;
}

.order-form .product-title {
  color: var(--order-ink);
  font-size: clamp(1rem, 2vw, 1.22rem);
  letter-spacing: -.03em;
  line-height: 1.16;
  text-wrap: initial;
}

.order-form .product-desc {
  color: var(--order-muted);
  font-size: .84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.order-form-price { display: grid; gap: .28rem; min-width: 0; }
.order-form-price .price { white-space: normal; font-size: .95rem; }
.order-form-unit { white-space: nowrap; font-size: .76rem; color: var(--order-muted); font-weight: 500; }
.order-form-stock { font-size: .79rem; font-weight: 620; color: #755226; overflow-wrap: anywhere; }
.order-form-stock[data-available="true"] { color: var(--order-green); }
.order-form-quantity { display: flex; justify-content: end; min-width: 0; }

.order-form .stepper {
  width: min(100%, var(--order-quantity-width));
  grid-template-columns: 44px minmax(40px, 1fr) 44px;
  border: 1px solid var(--order-line);
}

.order-form .stepper > :is(button, input) {
  height: 44px;
  border: 0;
  border-radius: 0;
  background: var(--order-paper);
  color: var(--order-ink);
}

.order-form .stepper > input { border-inline: 1px solid var(--order-line); font-weight: 680; }
.order-form .stepper > button { background: var(--order-soft); }
.order-form .stepper > button:last-child:not(:disabled) { color: #fff; background: var(--order-green); }
.order-form .stepper > button:last-child:hover:not(:disabled) { background: var(--order-green-hover); }
.order-form .stepper > button:first-child:hover:not(:disabled) { background: #e1e8de; }
.order-form .stepper > :disabled { color: #626a62; background: #f1f2f0; }

.order-form .button, .order-form .text-button {
  border-radius: 0;
  box-shadow: none;
}

.order-form .button { border-color: var(--order-line); background: var(--order-paper); color: var(--order-ink); }
.order-form .button:hover:not(:disabled) { background: var(--order-soft); }
.order-form .button.primary { border-color: var(--order-green); background: var(--order-green); color: #fff; }
.order-form .button.primary:hover:not(:disabled) { background: var(--order-green-hover); }
.order-form .button.accent { border-color: var(--order-green); background: #edf4eb; color: var(--order-green); }
.order-form .button.danger { color: #9b2d20; border-color: #9b2d20; }
.order-form .button.order-form-quiet { padding-inline: 0; border-color: transparent; justify-content: start; color: var(--order-muted); text-decoration: underline; }
.order-form .button.order-form-quiet:hover:not(:disabled) { background: transparent; color: var(--order-ink); }
.order-form .tag, .order-form .banner { border-radius: 0; }

.order-form-count, .order-form-hold {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--order-muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.order-form-summary-sticky { position: sticky; top: var(--order-sticky-top, 4.5rem); }
.order-form:has(.order-form-preview-bar) { --order-sticky-top: 7.35rem; }
.order-form-summary-body {
  display: grid;
  gap: .8rem;
  padding: var(--order-inset);
  min-width: 0;
}

.order-form-summary-body > .order-form-quiet { justify-self: start; }
.order-form-summary-body > .order-form-empty { padding: 0; }
.order-form-hold { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .45rem; }
.order-form-hold strong { color: var(--order-ink); }

.order-form-empty {
  padding: var(--order-inset);
  color: var(--order-muted);
  font-size: .92rem;
}

.order-form-summary-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .5rem;
  align-items: start;
  padding-block: .6rem;
  border-block-start: 1px solid var(--order-rule);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
}

.order-form-summary-lines li strong { white-space: nowrap; text-align: right; }
.order-form-summary-lines li .qty { color: var(--order-muted); font-size: .8rem; }
.order-form-totals { margin: 0; border-block-start: 2px solid var(--order-line); }
.order-form-totals > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .22rem .8rem;
  padding-top: .54rem;
  font-size: .83rem;
  font-variant-numeric: tabular-nums;
}

.order-form-totals dd { margin: 0; text-align: right; white-space: nowrap; }
.order-form-totals .order-form-total { font-weight: 740; font-size: .92rem; }
.order-form-total dd { font-size: 1.26rem; letter-spacing: -.025em; }
.order-form-preview-options { border-block: 1px solid var(--order-rule); }

.order-form-field-section { padding: var(--order-inset); }
.order-form-field-section + .order-form-field-section { border-top: 1px solid var(--order-rule); }
.order-form-submit > .button { justify-self: start; }
.order-form :is(.field > input, .field > textarea, .field > select, fieldset) {
  border: 1px solid #656e64;
  border-radius: 0;
  color: var(--order-ink);
}

.order-form :is(.field > input, .field > textarea, .field > select) { background-color: var(--order-paper); }
.order-form .field > input:read-only { background-color: var(--order-soft); }
.order-form .choice input { accent-color: var(--order-green); }
.order-form [data-form="access-code"] { width: 100%; max-width: none; }
.order-form-detail .panel > :is(h2, .row-between):first-child { padding-bottom: .6rem; border-bottom: 1px solid var(--order-line); }

.order-form .receipt, .order-form-receipt .receipt {
  background: #fff;
  color: #161a17;
  border: 1px solid #242924;
  border-radius: 0;
  box-shadow: none;
}

.order-form .receipt .receipt-total, .order-form-receipt .receipt .receipt-total { border-top: 2px solid #242924; padding-top: .62rem; }

@media (max-width: 900px) {
  .order-form-layout { grid-template-columns: minmax(0, 1fr); }
  .order-form .order-form-cart-jump { display: inline-flex; justify-self: start; }
  .order-form-summary-sticky { position: static; }
}

@media (max-width: 560px) {
  .order-form { --order-quantity-width: 8.55rem; }
  .order-form-column-labels { display: none; }
  .order-form .order-form-product {
    grid-template-columns: minmax(0, 1fr) var(--order-quantity-width);
    gap: .65rem .5rem;
  }
  .order-form-product-identity { grid-column: 1 / -1; grid-template-columns: 3.75rem minmax(0, 1fr); gap: .62rem; }
  .order-form-submit > .button { justify-self: stretch; }
}
