/* Checkout (screen 7) — page-specific layout on the shared brand system.
   Mobile-first single column; two columns at >= 980px (summary first on small). */

.checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-bottom: clamp(56px, 8vw, 112px);
}

/* Compact the checkout vertically (client feedback): trim the big section/page-head
   top padding, small title (match the cart header scale), tighten the blocks so
   the summary + Place order sit above the fold. */
.page-head { padding-top: clamp(10px, 1.6vw, 16px); }
.page-head h1 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); font-weight: 500; }
.checkout-back { margin-bottom: 14px; }
.section { padding-top: clamp(10px, 1.6vw, 16px); padding-bottom: clamp(40px, 6vw, 72px); }
.co-block { margin-top: clamp(14px, 2vw, 20px); }
.co-block:first-child { margin-top: 0; }
.co-block h2 { font-size: 1.2rem; margin: 0 0 4px; }
.co-block__note { color: var(--sage); font-size: .9rem; margin: 0 0 12px; }

/* Guest-first sign-in line (Baymard: guest path most prominent; sign-in is a
   quiet link, not an interrupting block). */
.co-signin { font-size: .92rem; color: var(--ink-2); margin: 0 0 16px; }
.ulink-btn { background: none; border: 0; padding: 0 0 1px; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink); border-bottom: 1.5px solid var(--olive); }
.ulink-btn:hover { color: var(--olive); }

.field-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.req { color: var(--danger); }

.stripe-el { border: 1px dashed var(--taupe); border-radius: var(--r); background: var(--white); padding: 20px; }
.stripe-el__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stripe-el__brand { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); }

.summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(22px, 3vw, 30px); }
.summary h2 { font-size: 1.4rem; margin: 0 0 14px; }
.sum-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.sum-item__qty { color: var(--sage); font-weight: 600; font-size: .9rem; }
.sum-item__name { font-weight: 600; font-size: .95rem; }
.sum-item__mod { grid-column: 1 / -1; color: var(--sage); font-size: .84rem; margin-top: 2px; }
.sum-item__price { font-family: var(--font-display); font-style: italic; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.totals { margin-top: 18px; font-variant-numeric: tabular-nums; }
.totals__row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: .95rem; color: var(--ink-2); }
.totals__sub { color: var(--sage); font-size: .82rem; padding-left: 14px; }
.totals__grand { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.totals__grand .lbl { font-family: var(--font-display); font-size: 1.25rem; }
.totals__grand .amt { font-family: var(--font-display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }

.summary .btn--block { margin-top: 20px; }
.summary__terms { font-size: .78rem; color: var(--sage); margin: 14px 0 0; text-align: center; line-height: 1.5; }

.checkout-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: .92rem; }
.link-arrow__back svg { transform: scaleX(-1); }
.summary__pickup { font-family: var(--font-display); font-style: italic; color: var(--gold-ink); font-size: 1rem; margin: 0 0 18px; }

/* Fulfillment choice: Pickup vs Ship to me (retail shipping). */
.fulfill { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fulfill__opt {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
}
.fulfill__opt.is-on { border-color: var(--sage); box-shadow: inset 0 0 0 1px var(--sage); }
.fulfill__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.fulfill__title { font-weight: 600; font-size: 1rem; }
.fulfill__sub { color: var(--sage); font-size: .85rem; }

.ship-fields { margin-top: 16px; display: grid; gap: 16px; }
.ship-fields.is-hidden { display: none; }

@media (min-width: 620px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .fulfill { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 980px) {
  .checkout { grid-template-columns: 1.35fr .9fr; }
  .summary { position: sticky; top: 98px; }
}

/* Square Web Payments — our branded card page (/square/pay). The card fields
   themselves are Square-hosted iframes mounted into #sq-card (PCI SAQ-A). */
.sq-pay { max-width: 520px; margin: 0 auto; }
.sq-card {
  min-height: 52px;
  padding: 6px 4px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.sq-card.is-loading { opacity: .6; }
.sq-secure { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--sage); font-size: .85rem; }
.sq-pay__total { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin: 4px 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.sq-pay__total .lbl { font-family: var(--font-display); font-size: 1.25rem; }
.sq-pay__total .amt { font-family: var(--font-display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.sq-pay .btn--block { margin-top: 20px; }
.sq-pay__terms { font-size: .78rem; color: var(--sage); margin: 14px 0 0; text-align: center; line-height: 1.5; }

/* Tip block (task 550 — moved into checkout). Presets + custom; >=44px touch
   targets and >=8px gaps for the mobile pass (task 555). */
.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 4px; }
@media (min-width: 520px) { .tips { grid-template-columns: repeat(4, 1fr); } }
.tip { font-family: inherit; font-size: .9rem; font-weight: 600; min-height: 48px; padding: 8px 6px; border: 1px solid var(--taupe); border-radius: var(--r); background: var(--white); color: var(--ink-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s, color .15s; }
.tip small { display: block; font-weight: 400; font-size: .7rem; color: var(--sage); margin-top: 2px; }
.tip:hover { border-color: var(--olive); }
.tip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.tip[aria-pressed="true"] small { color: var(--onink-dim, rgba(255,255,255,.7)); }
.tip-custom { display: flex; gap: 8px; margin-top: 10px; }
.tip-custom .input { min-height: 48px; }
.tip-custom .btn { min-height: 48px; }

/* Make the tip obvious (client feedback): give the tip block a soft card so it
   stands out as the last step before placing the order. */
.co-block--tip { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 2.4vw, 22px); }
.co-block--tip h2 { display: flex; align-items: center; gap: 10px; }

/* 21+ acknowledgement (task 564) — soft card so the required alcohol check
   reads as a deliberate gate, matching the tip block. */
.co-block--age { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 2.4vw, 22px); }
.age-ack { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; line-height: 1.4; cursor: pointer; }
.age-ack input { margin-top: 3px; flex: 0 0 auto; }

/* Pay-step order summary — keep the breakdown (incl. tip) visible on the final
   step so nothing relevant is hidden (client feedback). */
.sq-summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; }
.sq-summary__h { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 12px; }
.sq-summary__line { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
.sq-summary__qty { color: var(--sage); font-weight: 600; }
.sq-summary__rows { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.sq-summary__row { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: .9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sq-summary__edit { margin: 12px 0 0; font-size: .85rem; }

/* Quick-login modal (sign in without leaving checkout). */
.auth-modal { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-modal[hidden] { display: none; }
.auth-modal__scrim { position: absolute; inset: 0; background: rgba(20,21,15,0.5); opacity: 0; transition: opacity .22s; }
.auth-modal.is-open .auth-modal__scrim { opacity: 1; }
.auth-modal__panel { position: relative; width: min(420px, 100%); background: var(--cream); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 24px 60px rgba(20,21,15,.24); padding: clamp(24px,4vw,34px); transform: translateY(12px) scale(.98); opacity: 0; transition: transform .24s, opacity .24s; }
.auth-modal.is-open .auth-modal__panel { transform: none; opacity: 1; }
.auth-modal__close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; }
.auth-modal__close:hover { background: var(--ink); color: var(--cream); }
.auth-modal__title { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 6px; }
.auth-modal__sub { color: var(--ink-2); font-size: .92rem; margin: 0 0 18px; }
.auth-modal__alt { margin: 14px 0 0; font-size: .85rem; color: var(--ink-2); text-align: center; }
@media (prefers-reduced-motion: reduce) { .auth-modal__panel, .auth-modal__scrim { transition: none; } }

/* Extra vertical compaction (client feedback): tighter fields + co-block heads. */
.checkout .field { margin-bottom: 12px; }
.checkout .co-block h2 { font-size: 1.3rem; }

/* Editable tip on the Square pay step. */
.sq-tip { margin: 12px 0 6px; }
.sq-tip__lbl { display: block; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; margin-bottom: 8px; }
.sq-tip__lbl .muted { letter-spacing: 0; text-transform: none; font-weight: 400; }
.sq-tip__opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }

/* ── Pickup timing controls ────────────────────────────────────────────────
   The same markup renders on /cart and /checkout, but these rules only lived in
   pages/cart.css and checkout loads only pages/checkout.css — so on checkout the
   buttons drew as bare inline text: "ASAPReady in ~25 min" with the label and the
   sublabel run together, which is what a flex column was supposed to prevent.
   Duplicated here rather than adding cart.css to the checkout bundle, which would
   drag in the whole cart layout for four controls. */
.when { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.when__opt { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 1px solid var(--taupe); border-radius: var(--r); background: var(--white); cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--ink-2); text-align: left; font-family: inherit; }
.when__opt small { font-weight: 400; font-size: .76rem; color: var(--sage); }
.when__opt:hover { border-color: var(--olive); }
.when__opt[aria-pressed="true"] { border-color: var(--olive); box-shadow: inset 0 0 0 1px var(--olive); color: var(--ink); }
/* One option left (ASAP suppressed outside the pickup window) should not be a
   half-width button with a gap beside it. */
.when:has(> .when__opt:only-child) { grid-template-columns: 1fr; }
/* THE PICKUP DAY ROW (2026-09-11). Horizontal scroll rather than wrap, because
   fourteen days wrapped to four rows pushes the times themselves below the fold on a
   phone, and the row is a secondary control -- the time is the decision. -webkit-
   overflow-scrolling for momentum on iOS, and a hidden scrollbar with the strip still
   keyboard-reachable because each day is a real link. */
.slot-days {
  /* min-width:0 IS THE WHOLE REASON THIS SCROLLS. A grid item's default min-width is
     `auto`, which means "at least as wide as my content" -- so fourteen nowrap chips
     did not overflow-scroll, they pushed the checkout's form COLUMN to 1232px and threw
     390px of horizontal scroll onto the whole page, shoving the order summary off the
     right edge. Measured, not guessed: docScroll 1670 against a 1280 viewport, and the
     strip reporting scrollWidth === clientWidth, which is the tell that it grew instead
     of scrolling. Capped here and on the wrapper it sits in. */
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 0 10px;
  margin: 0 0 4px;
}
.slot-days::-webkit-scrollbar { display: none; }
.slot-day {
  flex: 0 0 auto;
  font-size: .8rem;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--taupe);
  border-radius: var(--r);
  background: var(--white);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.slot-day:hover { border-color: var(--olive); }
.slot-day.is-active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
/* The lead-time sentence sits above the grid, so it is not a grid child and must not
   inherit .slots-note's `grid-column`. */
.slots-note--lead { margin: 0 0 10px; color: var(--ink-2); }

/* THE GRID ITEM IS WHAT HAD TO BE CAPPED, and it took an isolation test to find rather
   than a guess -- capping .slot-days and .co-when changed nothing, because those are all
   `display:block` and a block box has no automatic minimum size to cap.

   `.checkout` is a two-column grid and this FORM is its first item. A grid item's default
   `min-width` is `auto`, meaning "never narrower than my content", so the fourteen nowrap
   day chips inside it pushed the form's track to 1232px and put 390px of horizontal
   scroll on the whole page -- shoving the order summary off the right edge on a 1280
   viewport. Measured: 1670 with the row, 1280 with it removed, 1280 with min-width:0
   here. */
.checkout > * { min-width: 0; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { font-family: inherit; font-size: .84rem; font-weight: 600; padding: 10px 4px; border: 1px solid var(--taupe); border-radius: var(--r); background: var(--white); color: var(--ink-2); cursor: pointer; text-align: center; font-variant-numeric: tabular-nums; }
.slot:hover:not(:disabled) { border-color: var(--olive); }
.slot[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.slot:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.slot small { display: block; font-weight: 400; font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; color: var(--danger); margin-top: 2px; }
.slots-note { font-size: .82rem; color: var(--sage); margin: 12px 0 0; grid-column: 1 / -1; }

/* Delivery by Uber Direct (0220): the live fee + arrival line under the address. */
.dq { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 4px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--c-cream); transition: opacity 160ms ease; }
.dq.is-busy { opacity: .55; }
.dq__fee { font-weight: 600; color: var(--ink); }
.dq__eta { font-size: .86rem; color: var(--ink-2); }
.dq__err { flex-basis: 100%; font-size: .86rem; color: var(--c-danger); }
.dq__err[hidden] { display: none; }
