/* The checkout. */
.checkout__title { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 1.6rem; }

.checkout-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 4vw, 3rem); align-items: start; }

.checkout-block { border: 0; margin: 0 0 2rem; padding: 0; min-width: 0; }

/* The checkout's fields wear the contact form's look (contact_form.css) — the same fields a visitor already knows. */
.checkout-block label:not(.choice) { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: .4rem; }

.checkout-block input:not([type='radio']),
.checkout-block textarea {
  width: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-small);
  background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: .97rem; margin-bottom: .35rem;
}

.checkout-block input:not([type='radio']):focus,
.checkout-block textarea:focus { outline: none; border-color: var(--mark, var(--primary)); box-shadow: 0 0 0 1px var(--mark, var(--primary)); }

.checkout-block [aria-invalid='true'] { border-color: var(--danger) !important; }

.checkout-block textarea { resize: vertical; min-height: 5.5rem; }

.checkout-block legend { display: flex; align-items: baseline; gap: .6rem; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--ink); margin-bottom: 1rem; padding: 0; }

.checkout-step { font-size: .95rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.checkout-hint { margin: -.2rem 0 .6rem; font-size: .85rem; color: var(--muted); }

.form-one > div { width: 100%; }

.checkout-block .field-error { color: var(--danger); font-weight: 500; font-size: .8rem; }

.choice.is-static { cursor: default; }

.checkout-address { margin-top: .8rem; }

.checkout-summary { position: sticky; top: calc(var(--header-sticky-h, 0px) + 1.5rem); display: grid; gap: 0; padding: 1.4rem; }

.checkout-summary__toggle { display: none; }

.checkout-summary__body { display: grid; gap: 1rem; }

.checkout-summary__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

.checkout-summary__head h2 { font-size: 1.2rem; margin: 0; }

.checkout-summary__head a { color: var(--mark, var(--primary)); font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }

/* The gift card: its code beside «Apply», or the card applied with «Remove». */
.checkout-gift { display: grid; gap: .4rem; min-width: 0; padding-top: 1rem; border-top: 1px solid var(--line); }

.checkout-gift__label { font-size: .85rem; font-weight: 600; color: var(--ink); }

.checkout-gift__row { display: flex; gap: .5rem; min-width: 0; }

.checkout-gift__row .btn { flex: none; padding-inline: 1.1rem; }

/* width 0 and grow: a field's own width (its 20 characters) would push the card wider than the column. */
.checkout-gift__row input {
  flex: 1 1 0; width: 0; min-width: 0; padding: .7rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-small);
  background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: .95rem; letter-spacing: .04em; text-transform: uppercase;
}

.checkout-gift__row input::placeholder { text-transform: none; letter-spacing: 0; }

.checkout-gift__row input:focus { outline: none; border-color: var(--mark, var(--primary)); box-shadow: 0 0 0 1px var(--mark, var(--primary)); }

.checkout-gift__applied { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font-size: .95rem; }

.checkout-gift__applied strong { letter-spacing: .04em; }

.checkout-gift__remove { background: none; border: 0; padding: 0; color: var(--mark, var(--primary)); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.checkout-gift .field-error { color: var(--danger); font-weight: 500; font-size: .8rem; }

.checkout-gift .checkout-hint { margin: 0; }

.checkout-sums__gift dd { color: var(--success); }

.checkout-finish { display: grid; gap: .5rem; }

.checkout-finish--phone { display: none; }

.checkout-submit { width: 100%; text-align: center; }

.checkout-submit:disabled { opacity: .7; cursor: progress; }

.checkout-after-pay { margin: 0; text-align: center; }

@media (max-width: 900px) {
  .checkout-summary { position: static; order: -1; padding: 0; }
}

/* checkout — the page's own styles, on this page only. */

@media (max-width: 900px) {
  .checkout-summary__toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
    padding: 1rem 1.2rem; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer;
  }
  .checkout-summary__toggle > span { display: inline-flex; align-items: baseline; gap: .4rem; text-align: left; }
  .checkout-summary__toggle > strong { margin-left: auto; }
  .checkout-summary__toggle::after { content: '⌄'; color: var(--muted); }
  .checkout-summary__toggle[aria-expanded='true']::after { content: '⌃'; }
  .checkout-summary__body { padding: 0 1.2rem 1.2rem; }
  .checkout-finish--wide { display: none; }
  .checkout-finish--phone { display: grid; gap: .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
}

.auth-form .btn { width: 100%; }

@media (max-width: 900px) {
  .profile-card__foot .btn { padding: .45rem .9rem; }
}

@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
}

/* ---------- What is ordered (_products.twig, the order's page too): photo | name and «2 × 349 ₴» | the
   line's total ---------- */
.order-products { list-style: none; margin: 0; padding: 0; }
.order-product { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; grid-template-areas: "photo main total"; column-gap: .9rem; row-gap: .55rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.order-product:last-child { border-bottom: 0; }
.order-product__photo { grid-area: photo; width: 3rem; height: 3rem; object-fit: cover; border-radius: var(--radius-small); background: var(--hover-wash); display: block; }
.order-product__photo--contain { object-fit: contain; background: var(--plate, #fff); padding: .25rem; }
.order-product__photo--none { display: grid; place-items: center; color: var(--muted); }
.order-product__photo--none svg { width: 45%; height: 45%; }
.order-product__main { grid-area: main; display: grid; gap: .2rem; min-width: 0; }
.order-product__name { color: var(--ink); font-weight: 600; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; }
.order-product__price { font-size: .85rem; color: var(--muted); }
.order-product__total { grid-area: total; font-family: var(--font-display); font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .95rem; }

/* ---------- Nothing to order ---------- */
.checkout-empty { display: grid; justify-items: center; gap: .5rem; padding: 2.5rem 1.4rem; text-align: center; }
.checkout-empty__mark { color: var(--muted); opacity: .6; }
.checkout-empty__mark svg { width: 3.2rem; height: 3.2rem; display: block; }
.checkout-empty__title { margin: .3rem 0 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.checkout-empty__text { margin: 0 0 .8rem; color: var(--muted); font-size: .92rem; }

/* The post's sums under its choice: free reads as the state colour, a sum short of the minimum as a warning, and a way
   the order cannot take yet is not to be picked. */
.choice__terms.is-free { color: var(--success); }
.choice__terms.is-short { color: var(--warning); }
.choice:has(input:disabled) { cursor: default; opacity: .65; }
