/* Gateway checkout (/gateway/checkout). Mobile first: one column with the
   total and the confirm button pinned to the bottom; from 900 px the summary
   moves to a sticky right column. Tokens come from main.css. */
.co { padding-bottom: 120px; }
.co__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: var(--space-md) 0 var(--space-lg); }
.co__grid { display: flex; flex-direction: column; gap: var(--space-lg); }
.co-steps { display: flex; flex-direction: column; gap: var(--space-md); }
.co-step, .co-summary { background: var(--color-white); border: 1px solid var(--color-gray-200); border-radius: var(--radius-xl); padding: var(--space-lg); }
.co-step__h { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 700; margin: 0 0 var(--space-md); }
.co-step__n { width: 26px; height: 26px; border-radius: 50%; background: var(--color-gray-900); color: var(--color-white); display: inline-flex; align-items: center; justify-content: center; font-size: 0.8125rem; flex-shrink: 0; }
.co-choices { display: grid; gap: 8px; margin-bottom: var(--space-md); }
.co-choice { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 12px; border: 1px solid var(--color-gray-300); border-radius: var(--radius-lg); cursor: pointer; }
.co-choice:has(input:checked) { border: 2px solid var(--color-primary); background: #fffbeb; padding: 11px; }
.co-choice input { margin-top: 3px; accent-color: var(--color-primary-dark); }
.co-choice__text { display: flex; flex-direction: column; gap: 2px; }
.co-choice__title { font-weight: 600; font-size: 0.875rem; }
.co-choice__sub { font-size: 0.75rem; color: var(--color-gray-600); line-height: 1.45; }
.co-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-md); }
.co-field__label { font-size: 0.8125rem; font-weight: 600; color: var(--color-gray-700); }
.co-field input, .co-field textarea { font: inherit; font-size: 1rem; padding: 12px; border: 1px solid var(--color-gray-300); border-radius: var(--radius-md); background: var(--color-white); color: var(--color-gray-900); width: 100%; box-sizing: border-box; min-width: 0; }
.co-field input:focus, .co-field textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.co-field input[aria-invalid="true"] { border-color: #b91c1c; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12); }
.co-field input:disabled { background: var(--color-gray-50); color: var(--color-gray-500); }
.co-list { list-style: none; margin: -8px 0 var(--space-md); padding: 0; border: 1px solid var(--color-gray-200); border-radius: var(--radius-md); background: var(--color-white); max-height: 280px; overflow-y: auto; box-shadow: var(--shadow-md); }
.co-list li { padding: 12px; min-height: 44px; box-sizing: border-box; cursor: pointer; font-size: 0.875rem; border-bottom: 1px solid var(--color-gray-100); }
.co-list li.is-active, .co-list li:hover { background: #fffbeb; }
.co-hint { font-size: 0.75rem; color: var(--color-gray-600); margin: -8px 0 var(--space-md); }
.co-note { font-size: 0.8125rem; color: var(--color-gray-800); background: var(--color-gray-100); border-radius: var(--radius-md); padding: 10px 12px; }
.co-row2, .co-row3 { display: grid; gap: 0 12px; }
.co-summary__h { font-size: 1rem; font-weight: 700; margin: 0 0 var(--space-md); }
.co-summary__item { display: flex; gap: 12px; align-items: center; }
.co-summary__img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--color-gray-200); }
.co-summary__name { font-weight: 700; font-size: 0.875rem; line-height: 1.35; margin: 0 0 4px; }
.co-summary__dispatch, .co-summary__unit { font-size: 0.75rem; color: var(--color-gray-600); margin: 0; }
.co-qty { display: flex; justify-content: space-between; align-items: center; margin: var(--space-md) 0; font-size: 0.8125rem; color: var(--color-gray-700); }
.co-qty__ctl { display: flex; align-items: center; border: 1px solid var(--color-gray-300); border-radius: var(--radius-md); }
.co-qty__ctl button { width: 44px; height: 44px; border: 0; background: transparent; font: inherit; font-size: 1.125rem; cursor: pointer; }
.co-qty__ctl span { min-width: 28px; text-align: center; font-weight: 700; }
.co-summary__rows { margin: 0; font-size: 0.875rem; }
.co-summary__rows div { display: flex; justify-content: space-between; }
.co-summary__rows dt { color: var(--color-gray-600); }
.co-summary__rows dd { margin: 0; }
.co-summary__total { display: none; }
/* Phone: the CTA is a bar pinned to the bottom of the screen. */
.co-summary__cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: 12px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--color-white); border-top: 1px solid var(--color-gray-200); box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.06); }
.co-summary__cta-total { display: flex; flex-direction: column; font-size: 0.75rem; color: var(--color-gray-600); }
.co-summary__cta-total strong { font-size: 1.25rem; color: var(--color-gray-900); }
.co-submit { flex-grow: 1; min-height: 52px; }
.co-status { font-size: 0.875rem; margin: var(--space-sm) 0 0; min-height: 1.4em; }
.co-status[data-state="error"] { color: #b91c1c; }
.co-status[data-state="sending"] { color: var(--color-gray-600); }
.co-terms { font-size: 0.75rem; color: var(--color-gray-600); line-height: 1.5; margin: var(--space-sm) 0 0; }
@media (min-width: 520px) { .co-row2 { grid-template-columns: 1fr 1fr; } .co-row3 { grid-template-columns: 2fr 1fr 1fr; } .co-choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .co { padding-bottom: var(--space-3xl); }
  .co__title { font-size: 2rem; }
  .co__grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-xl); align-items: start; }
  .co-summary { grid-column: 2; grid-row: 1; position: sticky; top: 90px; }
  .co-steps { grid-column: 1; grid-row: 1; }
  .co-summary__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--color-gray-200); padding-top: var(--space-md); margin-top: var(--space-md); }
  .co-summary__total strong { font-size: 1.625rem; }
  .co-summary__cta { position: static; padding: 0; margin-top: var(--space-md); border: 0; box-shadow: none; }
  .co-summary__cta-total { display: none; }
}
/* `display: grid` on .co-row3 and friends would otherwise beat the hidden
   attribute, showing the courier fields beside a branch delivery. */
.co [hidden] { display: none !important; }
.co-terms a { color: var(--color-primary-text); }
/* The status sits in the confirm bar, so on a phone an error after tapping
   Confirm is on screen, not in the summary at the top of the page. */
.co-summary__cta { flex-wrap: wrap; }
.co-summary__cta .co-status { flex-basis: 100%; margin: 0; }
.co-summary__cta .co-status[data-state="idle"] { display: none; }
