/* Checkout page. */
.co-secure { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.co-back { display: inline-block; margin-top: 8px; color: var(--muted); text-decoration: none; font-size: 15px; }
.co-title { margin: 12px 0 10px; font-size: clamp(40px, 5vw, 72px); font-weight: 760; line-height: .96; letter-spacing: -.045em; }
.co-sub { margin: 0 0 32px; max-width: 56ch; color: var(--muted); font-size: 17px; line-height: 1.55; }
.co-loading { color: var(--muted); }
.co-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 28px; align-items: start; }
.co-layout[hidden], #checkoutHead[hidden] { display: none; }
#checkoutForm { display: grid; gap: 18px; }
#checkoutForm[hidden] { display: none; }
.co-block { padding: 28px; border-radius: 28px; background: var(--panel); border: 1.5px solid var(--line); }
.co-block h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.co-block h2 i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--text); color: var(--bg); font-style: normal; font-size: 14px; }
.co-block > p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.co-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.co-full { grid-column: 1 / -1; }
.co-f { display: grid; gap: 8px; align-content: start; }
.co-f label, .co-label { font-size: 14px; font-weight: 650; }
.co-f label small { color: var(--muted); font-weight: 500; }
.co-f input::placeholder, .co-f textarea::placeholder { color: #a39f93; font-weight: 400; opacity: 1; }
.co-f input, .co-f textarea { width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text); font: 500 16px 'Onest', 'Manrope', sans-serif; transition: border-color .2s, box-shadow .2s; }
.co-f textarea { min-height: 96px; padding: 14px 16px; resize: vertical; }
.co-f input:focus, .co-f textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(41, 49, 45, .08); }
.co-err { display: none; color: #a8432f; font-size: 13px; font-weight: 600; }
.co-f.is-bad input, .co-f.is-bad textarea { border-color: #a8432f; background: #fdf3f0; }
/* The message fades in under its field. It used to shake sideways, and a paused animation left it 4 px off the label. */
.co-f.is-bad .co-err, .co-consent.is-bad + .co-err { display: block; animation: co-err-in .25s; }
@keyframes co-err-in { from { opacity: 0; } }
/* Consent: the reason is written out, not shown by colour alone. Aligned with the text next to the checkbox. */
.co-consent-err { margin: -4px 0 0 34px; }
/* Radio chips: contact method and payment. */
.co-choice { min-width: 0; margin: 0; padding: 0; border: 0; }
.co-choice legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 650; }
.co-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.co-chip { position: relative; flex: 1 1 0; min-width: 0; cursor: pointer; }
.co-f .co-chip input, .co-chip input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.co-chip span { display: grid; place-items: center; min-height: 48px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 15px; font-weight: 600; text-align: center; transition: border-color .2s, background .2s, color .2s; }
.co-chip input:checked + span { border-color: var(--text); background: var(--text); color: var(--bg); }
.co-chip input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.co-hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
/* Optional address and date, collapsed by default. */
.co-more { border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); }
.co-more summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; font-size: 15px; font-weight: 650; cursor: pointer; list-style: none; }
.co-more summary::-webkit-details-marker { display: none; }
.co-more summary small { margin-right: auto; color: var(--muted); font-weight: 500; }
.co-more summary::after { content: '+'; flex: none; font-size: 20px; font-weight: 500; line-height: 1; transition: transform .25s; }
.co-more[open] summary::after { transform: rotate(45deg); }
.co-more > .co-fields { padding: 4px 16px 16px; }
.co-more .co-f input { background: var(--panel); }
.co-consent { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; cursor: pointer; }
.co-consent input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent-2); flex: none; }
.co-consent.is-bad span { color: #a8432f; }
.co-submit { display: grid; gap: 12px; }
.co-submit .sf-btn { width: 100%; min-height: 56px; }
.co-submit > p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }
.co-alert { margin: 0; padding: 14px 16px; border-radius: 14px; background: #fdf3f0; border: 1.5px solid #f0cbb9; color: #a8432f; line-height: 1.5; }
.co-alert[hidden] { display: none; }
.co-alert p { margin: 0 0 6px; }
.co-link-btn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: 600 15px 'Onest', 'Manrope', sans-serif; text-decoration: underline; cursor: pointer; }
.co-sum { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; padding: 26px; border-radius: 28px; background: var(--panel); border: 1.5px solid var(--line); }
.co-sum[hidden] { display: none; }
.co-sum h2 { margin: 0; font-size: 20px; }
.co-sum-toggle { display: none; }
.co-sum-body { display: grid; gap: 16px; }
#checkoutItems { display: grid; gap: 12px; }
.co-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; }
.co-line .t { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px 14px 4px 4px; overflow: clip; background: #f1e7db; color: var(--accent-2); }
.co-line img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.co-line b { display: block; font-size: 15px; }
.co-line small { color: var(--muted); font-size: 13px; }
.co-sum dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 0; padding-top: 16px; border-top: 1.5px solid var(--line); }
.co-sum dt { color: var(--muted); }
.co-sum dd { margin: 0; font-weight: 600; text-align: right; }
.co-sum .co-total { padding-top: 12px; border-top: 1.5px dashed var(--line); font-size: 22px; font-weight: 700; color: var(--text); }
.co-sum dt.co-total.is-prelim { font-size: 16px; line-height: 1.35; }
.co-prelim { margin: -4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.co-prelim[hidden] { display: none; }
.co-lead-note { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.co-lead-note[hidden] { display: none; }
.co-note { margin: 0; padding: 14px 16px; border-radius: 16px; background: #dde4d7; font-size: 14px; line-height: 1.5; }
.co-empty { display: grid; justify-items: start; gap: 12px; padding: 28px; border-radius: 28px; border: 1.5px dashed var(--line); }
.co-empty[hidden] { display: none; }
.co-empty h2, .co-empty p { margin: 0; }
.co-done { display: grid; justify-items: center; gap: 18px; max-width: 760px; margin: 24px auto 0; padding: 48px clamp(20px, 4vw, 56px); border-radius: 36px; background: var(--panel); border: 1.5px solid var(--line); text-align: center; animation: co-rise .6s var(--ease); }
.co-done[hidden] { display: none; }
@keyframes co-rise { from { opacity: 0; transform: translateY(20px); } }
.co-big { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: #5d7a58; color: var(--bg); font-size: 36px; animation: co-pop .6s var(--spring); }
@keyframes co-pop { from { transform: scale(.2); } }
.co-done-title { margin: 0; font-weight: 760; line-height: 1; font-size: clamp(40px, 5vw, 64px); letter-spacing: -.04em; }
.co-num { padding: 10px 16px; border-radius: 999px; background: var(--bg); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.co-done > p { margin: 0; max-width: 48ch; color: var(--muted); font-size: 17px; line-height: 1.55; }
.co-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; margin: 12px 0 0; padding: 0; list-style: none; text-align: left; }
.co-timeline li { padding: 16px; border-radius: 18px; background: var(--bg); animation: co-rise .5s var(--ease) backwards; }
.co-timeline li:first-child { background: #eef3ea; }
.co-timeline b { display: block; margin-bottom: 4px; }
.co-timeline span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.co-done-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.sf .co-btn-outline { background: none; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.sf .co-btn-outline:hover { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.sf-footer:has(.sf-footer-bottom:only-child) { margin-top: 80px; padding-top: 0; }

@media (max-width: 900px) {
  .co-layout { grid-template-columns: 1fr; }
  .co-sum { position: relative; top: auto; order: -1; }
  .co-fields { grid-template-columns: 1fr; }
  .co-title { margin: 8px 0 8px; font-size: 36px; }
  .co-sub { margin-bottom: 20px; font-size: 16px; }
  #checkoutForm { gap: 12px; }
  .co-block { padding: 20px 18px; border-radius: 22px; }
  .co-block > p { margin-bottom: 14px; font-size: 14px; line-height: 1.45; }
  .co-fields { gap: 14px; }
  .co-f textarea { min-height: 72px; }
  .co-layout { gap: 12px; }
  /* Phones: the summary is one row «Ваш заказ · 2 фигурки · от 360 BYN»; a tap opens the list. The form starts on the first screen. */
  .co-sum { gap: 0; padding: 0; border-radius: 18px; overflow: clip; }
  .co-sum h2 { display: none; }
  .co-sum-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 16px; border: 0; background: none; color: var(--text); font: 650 16px/1.3 'Onest', 'Manrope', sans-serif; text-align: left; cursor: pointer; }
  .co-sum-brief { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 15px; text-align: right; }
  .co-sum-toggle::after { content: ''; flex: none; width: 9px; height: 9px; margin: -4px 2px 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
  .co-sum.is-open .co-sum-toggle::after { margin-top: 4px; transform: rotate(-135deg); }
  .co-sum-body { display: none; gap: 12px; padding: 4px 16px 16px; }
  .co-sum.is-open .co-sum-body { display: grid; }
  .co-sum dl { gap: 6px 16px; padding-top: 12px; font-size: 15px; }
  .co-sum .co-total { padding-top: 10px; font-size: 20px; }
  .co-line { grid-template-columns: 52px 1fr auto; gap: 12px; }
  .co-line .t { width: 52px; height: 52px; }
  .co-note { display: none; }
  .co-timeline { grid-template-columns: 1fr 1fr; }
}
/* Checkout has no section links in the header, so the phone header stays one row high. */
@media (max-width: 900px) { .sf { --header-h: 64px; } }
