/*
  The home page's box builder, "Customize your box" (pages/home-builder.html, shareBuilder.js), on
  the oat band (site.css `.band-oat`): one step at a time, on a phone and a computer alike, "Step
  1 of 6" over it and Back and Next under it. Step 1 is the pickup card (pickupCard.css, the
  shop's picker's too); each later step is drawn in the pane, a card like it.
*/

.share [hidden] {
  display: none !important;
}

.share-fallback {
  margin-top: 28px;
}

.share-fallback .button {
  margin-top: 20px;
}

.share-builder {
  max-width: 1000px;
  scroll-margin-top: 16px;
}

.share-wizard-at {
  margin: 28px 0 0;
  font-family: var(--font-label);
  font-size: var(--size-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}

/* Step 1, the pickup card: "Step 1 of 6" over it names the step, so its own label is left out. */
.share-step,
.share-pane {
  margin-top: 12px;
}

.share-step:focus {
  outline: none;
}

.share-dropped {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}

/* Each later step, a card like the pickup's. */
.share-pane {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--rule);
  background: var(--cream);
}

.box-step-title {
  margin: 0 0 18px;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
}

.box-step-title:focus {
  outline: none;
}

/* A name is the way to its product's page: underlined only under a pointer or the keyboard. */
.box-step-title a,
.box-more-name a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 5px;
}

.box-step-title a:hover,
.box-step-title a:focus-visible,
.box-more-name a:hover,
.box-more-name a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.box-step-title a:focus-visible,
.box-more-name a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* A step of its own: the item's photo at the left, whole, in its own shape, no taller than 360
   px; the question and its answers beside it (Jeff, 2026-11-18: "the picture is cropped in a
   really weird way"). A link to the item's page, as its name is. */
.box-step {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.box-step-picture,
.box-step picture {
  display: block;
}

.box-step-picture:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.box-step-photo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 360px;
}

/* An item with no photo: its leaf on a tile, in the photo's place. */
.box-step .leaf-thumb.box-step-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.box-step-note {
  margin: 0;
  font-size: 17px;
  color: var(--text-muted);
}

/* Which one, or none: large buttons one under another, the name and price on a line, the
   detail under them; in "Anything else?", side by side as they fit. */
.box-choices {
  display: grid;
  gap: 10px;
  max-width: 460px;
}

.box-choice {
  min-height: 64px;
  padding: 10px 16px;
  border: 1px solid var(--rule-input);
  border-radius: var(--radius-button);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.box-choice.is-picked {
  border-color: var(--green);
  background: var(--green);
  color: var(--cream);
}

.box-choice:disabled {
  cursor: default;
  opacity: 0.55;
}

.box-choice-line,
.box-choice-detail {
  display: block;
}

.box-choice-price {
  font-size: 16px;
}

.box-choice-detail {
  margin-top: 2px;
  font-size: 14px;
}

.box-choice:focus-visible,
.box-count-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* How many: one control, − and + either side of the number, 44 px each, in the site's input
   border; its price each under it on a step of its own. */
.box-count {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.box-count-row {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rule-input);
  border-radius: var(--radius-button);
  background: var(--card);
}

.box-count-button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.box-count-button:hover:not(:disabled) {
  background: var(--green-tint);
}

.box-count-button:disabled {
  color: var(--rule-input);
  cursor: default;
}

.box-count-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0 10px;
  border-inline: 1px solid var(--rule-light);
  font-family: var(--font-label);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.box-count-price,
.box-more-price {
  font-size: var(--size-small);
  color: var(--text-muted);
}

/* "Anything else?": a row each, the dividers full width: the thumbnail, the same square for every
   row; the name, wrapping as one block, with its price under it; how many at the right; an item
   with options, its choices under its name. Sold out, dimmed, "Sold out" in place of its control. */
.box-more-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.box-more-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 20px;
  padding: 20px 0;
  border-top: 1px solid var(--rule-light);
}

.box-more-row:last-child {
  padding-bottom: 0;
}

.box-more-thumb {
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: var(--radius-button);
  background: var(--rule-light);
}

.box-more-thumb picture,
.box-more-photo {
  display: block;
  width: 100%;
  height: 100%;
}

.box-more-photo {
  object-fit: cover;
}

.box-more-name {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
}

.box-more-price {
  margin: 4px 0 0;
}

.box-more-control {
  justify-self: end;
}

.box-more-sold {
  margin: 4px 0 0;
  font-size: var(--size-small);
  color: var(--text-faint);
}

.box-more-row.is-sold-out
  :is(.box-more-thumb, .box-more-name, .box-more-price) {
  opacity: 0.55;
}

.box-more-choices {
  grid-column: 2 / -1;
}

/* Its choices one under another, as on steps 2 to 4, smaller. */
.box-more .box-choices {
  gap: 8px;
}

.box-more .box-choice {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 16px;
}

.box-more .box-choice-price {
  font-size: 15px;
}

.box-more .box-choice-detail {
  font-size: 13px;
}

/* The box: the pickup, how often and the first pickup; what is in it; the total; the checkout. */
.box-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px 24px;
  margin: 0 0 20px;
}

.box-facts dt {
  font-family: var(--font-label);
  font-size: var(--size-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.box-facts dd {
  margin: 2px 0 0;
  font-size: 17px;
}

.box-lines {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule-light);
}

.box-lines li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-light);
  font-size: 18px;
}

.box-line-price {
  white-space: nowrap;
}

/* Under the lines, as the cart lists them (`boxSums`): Subtotal and Tax, then Total, larger;
   Total alone where there is no tax. */
.box-sums {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  margin: 14px 0 20px;
  font-size: 17px;
}

.box-sums dt,
.box-sums dd {
  margin: 0;
}

.box-sums dd {
  text-align: right;
  white-space: nowrap;
}

.box-sums .box-sums-total {
  font-size: 22px;
}

.box-empty {
  margin: 0 0 16px;
  font-size: 18px;
}

.share-go-cart {
  min-height: 52px;
  padding: 0 26px;
}

/* Back at the left and Next at the right under the step, on one line; Next plainly off until
   the step is answered, with no words (Jeff, 2026-11-18). */
.share-wizard-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.share-wizard-nav .button {
  min-height: 48px;
  padding: 0 20px;
}

.share-wizard-next {
  margin-left: auto;
}

.share-wizard-next:disabled {
  border-color: var(--rule);
  background: var(--rule);
  color: var(--text-faint);
  cursor: not-allowed;
}

/* On a phone, a step's photo is a band over its question. */
@media (max-width: 639px) {
  .share-wizard-at {
    margin-top: 20px;
  }

  .box-step {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* A phone's step, photo, question, answers, Back and Next, fits its screen. */
  .box-step-photo {
    max-height: 200px;
  }

  .box-step-title {
    margin-bottom: 14px;
    font-size: 25px;
  }

  .box-choice {
    min-height: 58px;
  }

  /* A row: the thumbnail beside the name and price, the control under them, the choices the
     row's width. */
  .box-more-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px 14px;
    padding: 16px 0;
  }

  .box-more-thumb {
    width: 72px;
    height: 72px;
  }

  .box-more-name {
    font-size: 19px;
  }

  .box-more-control {
    grid-column: 2;
    justify-self: start;
  }

  .box-more-choices {
    grid-column: 1 / -1;
  }

  .box-lines li {
    font-size: 17px;
  }
}

/* A member's line to their own box, in the builder's place. */
.share-member {
  margin: 28px 0 0;
  font-size: 19px;
}

.share-member a {
  color: var(--green);
  text-underline-offset: 4px;
}
