/*
 * The storefront and the cart.
 *
 * Deliberately NOT written in Phase 3, because the views it styles did not
 * exist then and CSS for a component nobody can reach is the same mistake as a
 * control that was never wired.
 *
 * Everything here uses the tokens from base.css. Two rules are load-bearing
 * rather than decorative and are commented where they sit: the product image
 * boxes reserve their space so the page does not shift on load, and the
 * gallery never renders an empty <img>.
 */

/* -- Index grid ------------------------------------------------------------ */

.product-grid {
  list-style: none;
  margin: var(--sp-7) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--sp-6);
}

/* Phones (owner, 2026-10-21): two products to a row, one column only on a
   very narrow screen. Smaller type so a name fits beside its neighbor. */
@media (max-width: 860px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4) var(--sp-3);
  }
  .product-card__name {
    font-size: var(--text-base);
    overflow-wrap: anywhere;
  }
}

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

/* Product requests, under the grid: a quiet card in the summary style. */
.shop__request {
  max-width: 44rem;
  margin: var(--sp-7) 0 0;
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-left: 4px solid var(--flame-500);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.shop__request-title {
  margin: 0 0 var(--sp-2);
  font-size: var(--text-lg);
}

.shop__request p {
  margin: 0;
  color: var(--ink-700);
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.product-card__link {
  color: inherit;
  text-decoration: none;
}

.product-card__link:hover .product-card__name {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/*
 * The card's picture box.
 *
 * A fixed aspect ratio rather than letting each photograph set its own height:
 * the intrinsic size stored on an image row may not match the photograph,
 * so a grid laid out from it would be a row of boxes
 * that are all the same wrong shape. Reserving the box also stops the page
 * jumping as photographs load in.
 */
.product-card__media {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink-100);
}

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

/* A listing with no photograph yet is a plain panel, never a broken image. */
.product-card__nophoto {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(140deg, var(--ink-100), var(--paper));
}

.product-card__name {
  margin: 0;
  font-size: var(--text-lg);
}

.product-card__price {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.product-card__custom {
  margin: var(--sp-1) 0 0;
  font-size: var(--text-sm);
  color: var(--ink-400);
}

/* -- One product ----------------------------------------------------------- */

.breadcrumb {
  font-size: var(--text-sm);
  margin-bottom: var(--sp-5);
}

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: start;
}

@media (max-width: 800px) {
  .product {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
}

.product__hero,
.product__nophoto {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ink-100);
}

.product__nophoto {
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--sp-6);
}

.product__thumbs {
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
  gap: var(--sp-3);
}

.product__thumbs img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-100);
}

/* Each small photo and the large one link to the full-size file (gallery.js). */
.product__hero-link,
.product__thumb {
  display: block;
  cursor: zoom-in;
}

.product__thumb {
  border-radius: var(--radius);
}

.product__thumb[aria-current="true"] img {
  border-color: var(--flame-500);
  box-shadow: 0 0 0 2px var(--flame-500);
}

.product__hero-link:focus-visible,
.product__thumb:focus-visible {
  outline: 3px solid var(--flame-500);
  outline-offset: 2px;
}

/*
 * A 360° spin (lib/catalog/spin.ts): the sheet is drawn `columns` frames wide
 * (600% for a ring, 2400% for an orbit) inside a one-frame window, so exactly
 * one frame shows; gallery.js translates it to show the others. The widths
 * and the orbit's starting row are SPIN_SHAPES in CSS form;
 * tests/product-spin.test.ts holds them equal.
 */
/*
 * Absolutely placed, centered square: as an in-flow box its height-driven width
 * fed back into the page grid and pushed the box past a phone's edge (found
 * 2026-10-18 at 390 px). Its parent (.spin, .product-card__media) is the box.
 */
.spin-frame {
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.spin-frame__sheet {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* The ring: 6 columns, starting top-left (front, eye level). */
.spin-frame--ring .spin-frame__sheet,
.product-card__media .spin-frame--ring .spin-frame__sheet {
  width: 600%;
}

/* The orbit: 24 columns; it starts on row 6 of 0-12, eye level (6/13 of the sheet). */
.spin-frame--orbit .spin-frame__sheet,
.product-card__media .spin-frame--orbit .spin-frame__sheet {
  width: 2400%;
  transform: translate(0%, -46.1538%);
}

/* On the shop card the card's own img rule must not squash the sheet. */
.product-card__media .spin-frame__sheet {
  height: auto;
  object-fit: initial;
}

.product-card__media:has(.spin-frame) {
  position: relative;
  background: var(--surface);
}

/* The large spot on the product page: same box as a photo. */
.spin {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  cursor: grab;
  /* Horizontal drags turn the part; vertical ones still scroll the page. */
  touch-action: pan-y;
}

/* An orbit tilts on vertical drags too, but never traps the page: a finger
   that starts vertically scrolls it (pointercancel ends the drag). One that
   starts sideways keeps the gesture, and may then go up or down to tilt.
   A mouse or pen is unaffected and drags any way, as before. */
.spin--orbit {
  touch-action: pan-y;
}

.spin--dragging {
  cursor: grabbing;
}

.spin:focus-visible {
  outline: 3px solid var(--flame-500);
  outline-offset: 2px;
}

.spin__hint {
  position: absolute;
  left: 50%;
  bottom: var(--sp-3);
  transform: translateX(-50%);
  margin: 0;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  background: rgb(11 11 13 / 0.7);
  color: var(--paper);
  font-size: var(--text-sm);
  pointer-events: none;
  transition: opacity 0.3s;
}

/* The orbit hint says how a finger tilts it (sideways first, see above). */
.spin__hint-touch {
  display: none;
}
@media (hover: none) and (pointer: coarse) {
  .spin__hint-touch {
    display: inline;
  }
  .spin__hint-fine {
    display: none;
  }
}

/* Hidden until gallery.js wires the drag (.spin--live): with JavaScript off
   the spin cannot turn, so it must not say it can. */
.spin:not(.spin--live) .spin__hint {
  display: none;
}

.spin--used .spin__hint {
  opacity: 0;
}

/* The enlarged photo (gallery.js): fitted to the screen, never wider. */
.lightbox {
  /* base.css zeroes every margin; a modal dialog centers itself with auto. */
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--paper);
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgb(8 8 10 / 0.8);
}

.lightbox__img {
  display: block;
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
}

.lightbox__close {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgb(11 11 13 / 0.75);
  color: var(--paper);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__close:focus-visible {
  outline: 3px solid var(--flame-500);
  outline-offset: 2px;
}

.product__buy h1 {
  margin-top: 0;
}

.product__price {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0 0 var(--sp-5);
}

/*
 * The description's paragraphs.
 *
 * `.product__buy` is not inside `.prose`, so base.css's prose spacing does not
 * reach here and two paragraphs render as two adjacent lines with no gap —
 * which reads as one badly wrapped sentence.
 */
.product__buy > p {
  margin: 0 0 var(--sp-4);
}

.product__form {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
}

/* A notice above a product. */
.product__notice {
  background: var(--info-100);
  color: var(--info-600);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-4);
  font-size: var(--text-sm);
}

.product__error {
  background: var(--danger-100);
  color: var(--danger-600);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-4);
  font-size: var(--text-sm);
}

.product__variants {
  border: 0;
  padding: 0;
  margin: 0 0 var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.product__variants legend {
  padding: 0;
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  font-weight: 600;
}

.product__variant {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  cursor: pointer;
}

/*
 * The selected state is a real border change, not just the radio dot.
 *
 * `:has()` rather than a class toggled by script: these pages ship no
 * JavaScript at all, and a selection that only shows through a 13px radio
 * button is one people miss.
 */
.product__variant:has(input:checked) {
  border-color: var(--flame-700);
  box-shadow: inset 0 0 0 1px var(--flame-700);
}

.product__variant:has(input:focus-visible) {
  outline: 2px solid var(--flame-700);
  outline-offset: 2px;
}

.product__swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex: none;
}

.product__variant-price {
  font-variant-numeric: tabular-nums;
  color: var(--ink-400);
}

.product__qty {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 8rem;
  margin-bottom: var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 600;
}

.product__qty input {
  padding: var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 400;
}

/*
 * The lead time, immediately above the button.
 *
 * "When will it arrive" is the most common question a print shop gets, and
 * burying the answer in fine print is what generates the email. Do not move
 * this below the button.
 */
.product__lead {
  margin: 0 0 var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 600;
}

.product__note {
  margin: var(--sp-3) 0 0;
  font-size: var(--text-sm);
}

.product__sold-out {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
}

.product__specs {
  margin: var(--sp-6) 0 0;
  font-size: var(--text-sm);
}

.product__specs dt {
  font-weight: 600;
}

.product__specs dd {
  margin: 0 0 var(--sp-2);
}

/* -- Cart ------------------------------------------------------------------ */

.cart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: var(--sp-7);
  align-items: start;
  margin-top: var(--sp-6);
}

@media (max-width: 800px) {
  .cart {
    grid-template-columns: 1fr;
  }
}

.cart__flash {
  background: #e8f6ec;
  color: #1c5c31;
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-5);
  font-size: var(--text-sm);
}

.cart__lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "body qty price"
    "body remove remove";
  gap: var(--sp-2) var(--sp-5);
  align-items: center;
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 560px) {
  .cart__line {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "body body"
      "qty price"
      "remove remove";
  }
}

.cart__line-body {
  grid-area: body;
}

.cart__line-title {
  margin: 0;
  font-size: var(--text-lg);
}

.cart__line-detail {
  margin: var(--sp-1) 0 0;
  font-size: var(--text-sm);
}

/*
 * A line that can no longer be bought is shown, dimmed, with a reason.
 *
 * Not removed: a subtotal that changes on its own between two screens with no
 * explanation is how a customer stops trusting a checkout.
 */
.cart__line--unavailable .cart__line-title,
.cart__line--unavailable .cart__line-price {
  opacity: 0.55;
}

.cart__line-problem {
  margin: var(--sp-2) 0 0;
  font-size: var(--text-sm);
  color: var(--danger-600);
}

/* A requested color (ADR-0012): information, not a warning — the order is
   fine, it is simply reviewed before the card is charged. */
.cart__line-notice,
.checkout__line-notice {
  display: block;
  margin: var(--sp-2) 0 0;
  padding: var(--sp-2) var(--sp-3);
  border-left: 3px solid var(--info-600);
  border-radius: var(--radius-sm);
  background: var(--info-100);
  color: var(--ink-800);
  font-size: var(--text-sm);
}

/* The USPS address check (lib/shipping/usps-address.ts): the customer may
   still continue, so a caution, not an error. */
.checkout__address-notice {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-3);
  border-left: 3px solid var(--warn-600);
  border-radius: var(--radius-sm);
  background: var(--warn-100);
  color: var(--ink-800);
}

.checkout__address-notice p {
  margin: 0 0 var(--sp-2);
}

/* A custom line's size at checkout, mm with inches: its own line. */
.checkout__line-size {
  display: block;
  font-size: var(--text-sm);
}

.cart__qty {
  grid-area: qty;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.cart__qty input {
  width: 4.5rem;
  padding: var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
}

.cart__line-price {
  grid-area: price;
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cart__remove {
  grid-area: remove;
  text-align: right;
}

.cart__summary {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  background: var(--paper);
  position: sticky;
  top: var(--sp-5);
}

.cart__summary h2 {
  margin: 0 0 var(--sp-4);
  font-size: var(--text-lg);
}

/* A grid, not a flex row: checkout has three label/amount pairs, and a single
   row ran them together as "Subtotal$40.00Shipping$9.85…". */
.cart__summary dl {
  display: grid;
  grid-template-columns: 1fr auto;
  /* No column gap, so the rule above the total runs unbroken; dd pads instead. */
  gap: var(--sp-2) 0;
  margin: 0 0 var(--sp-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cart__summary dt,
.cart__summary dd {
  margin: 0;
}

.cart__summary dd {
  padding-left: var(--sp-4);
  text-align: right;
}

/* With more than one pair the last is the total; set it apart from the
   figures that add up to it. The cart's lone subtotal gets no rule. */
.cart__summary dl > dt:last-of-type:not(:first-of-type),
.cart__summary dl > dd:last-of-type:not(:first-of-type) {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line);
}

.checkout__lines {
  list-style: none;
  margin: 0 0 var(--sp-4);
  padding: 0 0 var(--sp-3);
  border-bottom: 1px solid var(--line);
}

.checkout__lines li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-4);
  font-variant-numeric: tabular-nums;
}

.checkout__lines li + li {
  margin-top: var(--sp-3);
}

.checkout__lines li > span:last-child {
  flex-shrink: 0;
}

.cart__added,
.cart__soon {
  font-size: var(--text-sm);
  margin: 0;
}

/* Two separate statements. Without the gap they read as one sentence. */
.cart__added + .cart__soon {
  margin-top: var(--sp-3);
}

/* The cart's shipping box: a ZIP, then the choices for it (ADR-0021). */
.cart__shipping {
  display: grid;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
}

.cart__shipping input[name="zip"] {
  max-width: 8em;
}

.cart__ship-choices {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}

.cart__ship-choice {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
}

.cart__shipping .btn {
  justify-self: start;
}

/* The free-shipping line: readable, never fine print. */
.cart__hint {
  margin: 0 0 var(--sp-3);
  font-weight: 600;
}

.cart__blocked {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--danger-600);
}

/*
 * A button that reads as a link.
 *
 * Colored for a light page — this one sits on the cart, which is white.
 */
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--danger-600);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Checkout form: three cards (address, payment, agreement) in the same
   white-card style as the order summary beside them. */
.checkout__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.checkout__card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
  margin: 0;
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

/* A legend sits ON a fieldset's border by default. Floated full width, it
   sits inside the card like the summary's "Your order" heading. */
.checkout__card > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink-900);
}

/* State and ZIP share a row; stacked on a phone. */
.checkout__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-4);
}

@media (max-width: 520px) {
  .checkout__row {
    grid-template-columns: 1fr;
  }
}

.checkout__form input[type="radio"],
.checkout__form input[type="checkbox"] {
  accent-color: var(--flame-500);
}

/* Checkout consent boxes: a full-size tick target, wrapping text beside it. */
.checkout__check {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  font-weight: normal;
}

.checkout__check input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
}

/* Payment choices: a bordered tile each, the radio beside a name and a short
   line; the chosen tile takes the flame border. */
.checkout__provider {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.checkout__provider:hover {
  border-color: var(--flame-400);
}

.checkout__provider:has(input:checked) {
  border-color: var(--flame-500);
  background: var(--flame-100);
}

.checkout__provider:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

.checkout__provider input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
}

.checkout__provider-hint {
  display: block;
  font-size: var(--text-sm);
  font-weight: normal;
  color: var(--ink-400);
}

.checkout__provider--off {
  opacity: 0.6;
  cursor: default;
}

.checkout__provider--off:hover {
  border-color: var(--line-strong);
}

/* The button keeps its natural width rather than stretching in the column. */
.checkout__form > .btn {
  align-self: flex-start;
}

.checkout__form > .field__hint {
  margin: 0;
}

/* The statement line belongs to the button below it. */
.checkout__form > .field__hint + .btn {
  margin-top: calc(-1 * var(--sp-3));
}

/* Order page thank-you: the summary card's style, with a flame edge. */
.order-thanks {
  margin: 0 0 var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-left: 4px solid var(--flame-500);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.order-thanks p {
  margin: 0;
}

.order-thanks p + p {
  margin-top: var(--sp-2);
}

.order-thanks__number {
  font-weight: 700;
  color: var(--ink-900);
}

/* Several files, one line each (owner, 2026-10-23): the way back to /print
   sits right under the lines it adds to. */
.cart__main {
  min-width: 0;
}

.cart__another {
  margin: var(--sp-5) 0 0;
}

@media (max-width: 800px) {
  .cart__another .btn {
    width: 100%;
  }
}

/* -- Personalization (ADR-0025): the customizer on a product page ---------- */

.product__custom-from {
  margin: calc(-1 * var(--sp-3)) 0 var(--sp-4);
  font-size: var(--text-sm);
}

.pz {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
}

.pz h2 {
  margin: 0 0 var(--sp-3);
}

.pz__intro,
.pz__from {
  margin: 0 0 var(--sp-3);
}

.pz__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.pz__tab {
  font: inherit;
  padding: var(--sp-2) var(--sp-4);
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--paper);
  color: inherit;
  cursor: pointer;
}

.pz__tab.is-on {
  border-color: var(--flame-500);
  background: var(--flame-100);
  font-weight: 600;
}

.pz__stage {
  display: grid;
  gap: var(--sp-4);
}

.pz__canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.pz__controls {
  display: grid;
  gap: var(--sp-4);
  align-content: start;
}

.pz__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.pz__views {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
}

.pz__pics {
  display: grid;
  gap: var(--sp-3);
}

.pz__areas {
  display: grid;
  gap: var(--sp-4);
  align-content: start;
}

.pz__area {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.pz__more-designs {
  display: grid;
  gap: var(--sp-2);
  justify-items: start;
}

.pz__remove {
  justify-self: start;
}

.pz__area input[type="text"],
.pz__area input[type="file"],
.pz__area select {
  width: 100%;
  min-height: 44px;
  max-width: 100%;
}

.pz__area-title {
  margin: 0;
  font-size: var(--text-lg);
}

.pz__more summary::after {
  content: "+";
  margin-left: var(--sp-2);
  font-weight: 700;
}

.pz__more[open] > summary::after {
  content: "\2212";
}

.pz__more summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.pz__more {
  display: grid;
  gap: var(--sp-3);
}

.pz__field {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
}

.pz__field input[type="text"],
.pz__field input[type="file"],
.pz__field select {
  width: 100%;
  min-height: 44px;
  max-width: 100%;
}

.pz__sizeline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.pz__sizeline input[type="range"] {
  flex: 1;
  min-width: 0;
}

.pz__label {
  font-weight: 600;
  font-size: var(--text-sm);
}

.pz__hint {
  margin: 0;
  font-size: var(--text-sm);
}

.pz__slider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.pz__slider input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
}

.pz__field input[type="range"] {
  width: 100%;
  min-height: 44px;
}

.pz__out {
  min-width: 4.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pz__check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
}

.pz__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.pz__swatch {
  font: inherit;
  display: grid;
  justify-items: center;
  gap: var(--sp-1);
  width: 5.25rem;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-1);
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.pz__dot {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--line-strong);
}

.pz__sname {
  font-size: var(--text-sm);
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.pz__swatch.is-on {
  border-color: var(--flame-500);
  background: var(--flame-100);
}

.pz__swatch.is-on .pz__dot {
  border-color: var(--ink-900);
}

.pz__msg {
  margin: 0;
  min-height: 1.4em;
  font-size: var(--text-sm);
}

.pz__msg--bad {
  background: var(--danger-100);
  color: var(--danger-600);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
}

.pz__summary {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pz__price {
  margin: 0 0 var(--sp-2);
  font-weight: 700;
  font-size: var(--text-lg);
}

.pz__total {
  margin: 0 0 var(--sp-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pz__add {
  margin-top: var(--sp-3);
}

@media (min-width: 861px) {
  .pz__stage {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: start;
  }

  .pz__views {
    position: sticky;
    /* Below the sticky site header (69px), or its top edge hides under it. */
    top: calc(69px + var(--sp-4));
  }
}

.pz__cname {
  margin: var(--sp-1) 0 0;
  font-size: var(--text-sm);
  color: var(--ink-500);
}

/* Body and mark colors (ADR-0025 amendment, piece B1) */
.pz__colors {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.pz__colors-title {
  margin: 0;
  font-size: 1rem;
}

.pz__colorrow {
  display: grid;
  gap: var(--sp-2);
}

.pz__colorname {
  font-weight: 600;
}

.pz__colorpick {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.pz__dot {
  inline-size: 28px;
  block-size: 28px;
  flex: none;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.pz__colorselect {
  flex: 1;
  min-inline-size: 0;
  max-inline-size: 22rem;
}

.pz__colors .pz__msg:empty {
  display: none;
}

/* Moving a design (piece B2): the arrow buttons next to the picture's drag, for a finger or a keyboard. */
.pz__move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.pz__nudge {
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  cursor: pointer;
}

.pz__nudge:hover {
  border-color: var(--flame-500);
}

.pz__canvas[tabindex] {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.pz__canvas[tabindex]:active {
  cursor: grabbing;
}

/* The size scale's percent box (piece C1): narrow, so the slider keeps the room. */
.pz__field .pz__pct {
  flex: none;
  width: 5rem;
  max-width: 5rem;
  min-height: 44px;
  font: inherit;
  text-align: right;
}

.pz__sizeline {
  flex-wrap: wrap;
}

.pz__sizeline input[type="range"] {
  min-width: 8rem;
}

/* Drag hint under the product picture, and the Fine adjust row's label. */
.pz__field.pz__move {
  margin-top: var(--sp-2);
}

.pz__draghint {
  margin: 0;
  text-align: center;
}
