/* ---- checkout: the step on the left, the order on the right ---- */
/* the title, the step and the order as grid areas: side by side on a wide screen; title, order, step on a phone */
.checkout-page { padding-top: calc(var(--header-h) + clamp(12px, 1vw, 14px)); }
.co { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 450px); grid-template-areas: "main aside"; justify-content: center; column-gap: clamp(32px, 4vw, 56px); align-items: start; padding-bottom: clamp(56px, 6vw, 88px); }
.co__main { grid-area: main; }
.co__aside { grid-area: aside; }
.co__main { max-width: 520px; }
.co.is-flow { grid-template-columns: minmax(0, 640px) minmax(0, 450px); }
.co.is-flow .co__main { max-width: none; }
.co__head .display { font-size: clamp(34px, 3.4vw, 48px); line-height: 1.08; letter-spacing: -.03em; }
.co__block { margin-top: 20px; }
.co__block + .co__or { margin-top: 20px; }
.co__or + .co__block { margin-top: 16px; }
.co__title { font-size: 18.5px; font-weight: 500; line-height: 1.25; }
/* sign in or sign up, as one card: the "What you can count on" box, its corner cut the same way */
.co__card { margin-top: 0; padding: clamp(18px, 2vw, 22px) clamp(22px, 2.6vw, 30px) clamp(22px, 2.6vw, 30px); background: var(--obsidian-2); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 25px), calc(100% - 34px) 100%, 0 100%); }
.co__card-title { font-size: 23px; font-weight: 400; line-height: 1.2; letter-spacing: -.01em; }
.co__card .co__google { margin-top: 18px; }
/* Continue with Apple, in Apple's style for dark backgrounds: a white button, black mark and label */
.co__card .co__apple { margin-top: 10px; }
.co__card .co__form { margin-top: 0; }
.co__card + .co__or { margin-top: 22px; }
.co__result:not(:empty) { margin-top: 20px; }
.co__aside { position: sticky; top: calc(var(--header-h) + 14px); }
/* the page colour with a hairline: the vial photographs are made on the page colour */
.co__sum { padding: 22px 24px; box-shadow: inset 0 0 0 1px var(--line-2); }
.co__sum-toggle { display: flex; align-items: center; justify-content: space-between; list-style: none; font-size: 19px; font-weight: 500; pointer-events: none; }
.co__sum-toggle::-webkit-details-marker { display: none; }
.co__sum-toggle b { display: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.co__sum-body { margin-top: 14px; }
.co__rows { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.co__rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; font-size: 14.5px; color: var(--bone-2); }
.co__rows dd { text-align: right; font-variant-numeric: tabular-nums; }
.co__rows .co__total { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 500; color: var(--bone); }
.co__note { margin-top: 4px; font-size: 13px; color: var(--bone-3); }
.co__empty { grid-column: 1 / -1; display: grid; justify-items: start; gap: 16px; }
.co__empty .display { font-size: clamp(34px, 3.4vw, 48px); }
.co__empty p { color: var(--bone-2); }
/* ---- the checkout itself (js/checkout.js): express checkout, then three steps, each its own panel ----
   Every panel is the sign-in card's sheet with its corner cut at the bottom right; one step is open,
   the ones before it fold to a recap, the ones after it wait with their titles dimmed. */
.co-express, .co-step { background: var(--obsidian-2); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 30px) 100%, 0 100%); }
.co-express { padding: 20px clamp(20px, 2.4vw, 26px) 22px; text-align: center; }
.co-express__title { font-size: 15px; font-weight: 500; color: var(--bone-2); }
.co-express__wallets { display: grid; margin-top: 14px; }
.co-express__wallets > * { grid-area: 1 / 1; }
/* Apple Pay's progress takes the button's own cell, so the block keeps its height */
.co-express__processing { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; font-size: 14px; color: var(--bone-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.co-express__processing[hidden] { display: none; }
.co-express[data-processing] .co-wallet { visibility: hidden; }
.co-express__processing span { display: grid; }
.co-express__note { margin-top: 10px; font-size: 13.5px; color: var(--bone); }
.co-express__note:empty { display: none; }
.co-express .co-fine { margin-top: 12px; }
.co-flow > .co__or { margin: 18px 0; }
.co-step + .co-step { margin-top: 10px; }
.co-step__head { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 14px clamp(20px, 2.4vw, 26px); }
.co-step.is-open .co-step__head { border-bottom: 1px solid var(--line); }
.co-step__head h2 { font-size: 19px; font-weight: 400; letter-spacing: -.01em; }
.co-step.is-waiting .co-step__head h2 { color: var(--bone-3); }
.co-step__n { position: relative; display: grid; place-items: center; flex: none; width: 24px; height: 24px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--bone); }
.co-step__n svg { display: none; width: 12px; height: 12px; }
.co-step.is-done .co-step__n span { display: none; }
.co-step.is-done .co-step__n svg { display: block; }
.co-step.is-waiting .co-step__n { color: var(--bone-3); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.co-step__edit { margin-left: auto; min-height: 44px; font-size: 14px; color: var(--bone-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--bone-3); transition: color .25s; }
.co-step__edit:hover { color: var(--bone); }
.co-step__secure { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--bone-3); }
.co-step__secure svg { width: 12px; height: 12px; }
.co-step__body { padding: 20px clamp(20px, 2.4vw, 26px) 28px; }
.co-step__recap { overflow-wrap: anywhere; padding: 0 clamp(20px, 2.4vw, 26px) 22px 62px; font-size: 14.5px; line-height: 1.6; color: var(--bone-2); }
.co-step__recap b { display: block; font-weight: 500; color: var(--bone); }
.co-contact { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; color: var(--bone-3); }
.co-contact b { font-weight: 500; color: var(--bone); overflow-wrap: anywhere; }
.co-contact__change { margin-left: auto; font-size: 13.5px; color: var(--bone-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--bone-3); }
.co-contact__change:hover { color: var(--bone); }
/* the form grid: ZIP, city and state share a row; everything else spans it */
.co-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, .9fr); gap: 10px; }
.co-grid > .field--wide, .co-grid > .co-grid { grid-column: 1 / -1; }
.co-grid > .contact-form__err { margin: 0; }
.co-grid > .contact-form__err:empty { display: none; }
.co-grid > .btn { --h: 46px; margin-top: 4px; }
/* a fixed +1 before a US phone number: the label sits raised so the two never overlap */
.field--prefix .field__input { padding-left: 42px; }
.field--prefix .field__prefix { position: absolute; left: 15px; bottom: 7px; font-size: 15px; line-height: 1.4; color: var(--bone-2); pointer-events: none; }
.field--prefix .field__label { top: 15px; font-size: 11.5px; color: var(--bone-2); }
/* delivery methods: one hairline row each, the chosen one in full ink */
.co-rates { display: grid; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.co-rate + .co-rate { margin-top: -1px; }
.co-rate { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .25s, background-color .25s; }
.co-rate:hover { z-index: 1; box-shadow: inset 0 0 0 1px var(--bone-3); }
.co-rate.is-on { z-index: 2; background: var(--obsidian-3); box-shadow: inset 0 0 0 1px var(--bone); }
.co-rate input { position: absolute; opacity: 0; pointer-events: none; }
.co-rate:has(input:focus-visible) { outline: 2px solid var(--bone); outline-offset: 3px; }
.co-rate__dot { width: 16px; height: 16px; box-shadow: inset 0 0 0 1.5px var(--bone-3); }
.co-rate.is-on .co-rate__dot { box-shadow: inset 0 0 0 1.5px var(--bone), inset 0 0 0 4.5px var(--obsidian-3); background: var(--bone); }
.co-rate__text { min-width: 0; overflow-wrap: anywhere; display: grid; gap: 1px; font-size: 13.5px; line-height: 1.5; color: var(--bone-3); }
.co-rate__text b { font-size: 15.5px; font-weight: 500; color: var(--bone); }
.co-rate__price { display: grid; justify-items: end; font-size: 15.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.co-rate__price s { font-size: 12.5px; font-weight: 400; color: var(--bone-3); }

/* everything but the pressed control is held where it is: dimmed and out of reach */
#co-pay.is-paying > :not(.co__submit):not(.co-pay__note):not(.co-fine):not(.co-legal),
.co-flow.is-held .co-express, .co-flow.is-held > .co__or, .co-flow.is-held .co-step:not(.is-open),
.co-flow.is-held-express > .co__or, .co-flow.is-held-express .co-step { opacity: .5; pointer-events: none; transition: opacity .25s var(--ease); }
.co-pay__note { font-size: 14px; color: var(--bone); text-align: center; }
.co-pay__note:empty { display: none; }
.co-fine { font-size: 12.5px; line-height: 1.55; color: var(--bone-3); text-align: center; }
.co-legal { display: flex; justify-content: center; gap: 10px; font-size: 12.5px; color: var(--bone-3); }
.co-legal a { position: relative; color: var(--bone-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bone-3); }
.co-legal a:hover { color: var(--bone); }
/* points in the checkout summary: what this order earns, and the points to spend */
.co-points { margin-top: 14px; border-top: 1px solid var(--line); }
.co-points__earn { display: flex; gap: 12px; padding: 14px 0; font-size: 13px; color: var(--bone-3); }
.co-points__earn span:last-child { display: grid; gap: 2px; }
.co-points__earn b { font-size: 14.5px; font-weight: 500; color: var(--bone); }
.co-points__mark { flex: none; width: 12px; height: 5px; margin-top: 7px; background: var(--bone); clip-path: polygon(5.5px 0, 100% 0, calc(100% - 5.5px) 100%, 0 100%); }
.co-points__use { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.co-points__use > span { display: grid; gap: 2px; font-size: 13px; color: var(--bone-3); }
.co-points__use b { font-size: 14.5px; font-weight: 500; color: var(--bone); }
.co-points__btn { flex: none; min-height: 44px; padding: 0 18px; font-size: 14px; font-weight: 500; color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .25s, box-shadow .25s; }
.co-points__btn:hover { background: var(--obsidian-3); box-shadow: inset 0 0 0 1px var(--bone-3); }
.co-points__btn[aria-pressed="true"] { color: var(--ink); background: var(--bone); box-shadow: none; }
/* the book of addresses and the saved cards use the delivery list's rows */
.co-book { margin-bottom: 4px; }
.co-book .co-rates { margin-bottom: 12px; }
.co-book .co__submit { --h: 46px; }
.co-cards .co-rates { margin-bottom: 0; }
.co-tag { margin-left: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--bone-3); }
.co-rate:has(input[value="new"]) { padding-top: 13px; padding-bottom: 13px; }
/* the summary's shipping line names the method and says when it is free */
.co__rows dt small { margin-left: 4px; font-size: 12.5px; color: var(--bone-3); }
.co__unlocked { margin-top: -2px; font-size: 12.5px; color: var(--bone-2); }
@media (forced-colors: active) {
  .co-rate { outline: 1px solid CanvasText; outline-offset: -1px; }
  .co-rate.is-on { outline: 2px solid Highlight; outline-offset: -2px; }
  .co-rate__dot { border: 1px solid CanvasText; }
  .co-rate.is-on .co-rate__dot { forced-color-adjust: none; background: Highlight; border: 3px solid Canvas; outline: 1px solid Highlight; }
}
@media (max-width: 899px) {
  .co, .co.is-flow { grid-template-columns: minmax(0, 1fr); grid-template-areas: "aside" "main"; row-gap: 16px; }
  .co__aside { position: static; }
  .co__main { max-width: none; }
  /* folded by default on a phone: the toggle shows the total and opens the lines */
  .co__sum { padding: 14px 16px; }
  .co__sum-toggle { font-size: 17px; }
  .co__sum-toggle { pointer-events: auto; cursor: pointer; }
  .co__sum-toggle span { display: inline-flex; align-items: center; gap: 8px; }
  .co__sum-toggle span::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .3s var(--ease); }
  .co__sum[open] .co__sum-toggle span::after { transform: translateY(1px) rotate(-135deg); }
  .co__sum-toggle b { display: block; }
  .co-step__recap { padding-left: clamp(20px, 2.4vw, 26px); }
  .co-step__secure { letter-spacing: .1em; }
}
