/* Cart, checkout, order status. Variables: base.css. */
.container.narrow { max-width: 820px; }

.cart-empty { text-align: center; padding: 48px 24px; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line {
  display: grid; grid-template-columns: 64px 1fr 84px 110px 36px; gap: 14px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line-soft);
}
.cart-thumb { display: block; width: 64px; height: 48px; border-radius: var(--radius-sm); background: var(--surface-alt); overflow: hidden; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-name a { color: var(--text); font-weight: 600; }
.cart-line .qty { width: 84px; text-align: center; border-radius: var(--radius-pill); }
.cart-sum { text-align: right; font-weight: 600; }
.cart-remove {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.cart-remove:hover { background: var(--surface-alt); color: var(--danger); }
.cart-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-top: 18px; }
.cart-actions { justify-content: flex-end; margin-top: 24px; }
[data-cart-body].is-busy { opacity: .55; transition: opacity .2s var(--ease); }

.sums { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; margin: 0; min-width: 240px; }
.sums dt { margin: 0; }
.sums dd { margin: 0; text-align: right; }
.sums .sum-total { font-size: 1.2em; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line-soft); }

.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.checkout-main { display: flex; flex-direction: column; gap: 20px; }
.checkout-form fieldset.card { border: 0; margin: 0; padding: 26px 28px; }
.checkout-form legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-size: 1.2em; font-weight: 600; }
.checkout-form legend + * { clear: both; }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.country-row { display: flex; gap: 10px; align-items: center; } /* task 32: country list + "Recalculate" (no JS) */
.country-row select { flex: 1 1 auto; min-width: 0; }
.country-pick { clear: both; width: 100%; margin-bottom: 14px; }
.checkout-form.is-busy { opacity: .6; pointer-events: none; }
.field-row-bank { grid-template-columns: 1fr 1fr; } /* task 28: bank name | IBAN (≤700px: one column, below) */
.checkout-side { position: sticky; top: calc(var(--header-h) + 20px); }
.summary { padding: 26px 28px; }
.summary h2 { margin-top: 0; font-size: 1.2em; }
.summary-lines { list-style: none; margin: 0 0 14px; padding: 0; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.btn-wide { width: 100%; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s var(--ease);
}
.choice:hover { border-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.choice-title { flex: 1; }
.choice-price { color: var(--text-2); white-space: nowrap; }
.choices.has-error .choice { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }

.order-page .card { padding: 26px 28px; margin-bottom: 20px; }
.order-facts { display: grid; grid-template-columns: 160px 1fr; gap: 10px 20px; margin: 0; }
.order-facts dt { color: var(--text-2); margin: 0; }
.order-facts dd { margin: 0; }
.order-pay { margin-top: 20px; }
.badge.status-paid, .badge.status-completed { background: rgba(31, 138, 76, .12); color: var(--ok); }
.badge.status-cancelled { background: rgba(196, 48, 28, .1); color: var(--danger); }
.pstatus-paid { color: var(--ok); }
.pstatus-pending { color: var(--warn); }
.order-instructions { background: var(--surface-alt); }
.demo-pay { padding: 36px; text-align: center; }
.demo-pay .actions { justify-content: center; }

/* task 18: buyer switch, company fields, reverse-charge marks */
.buyer-switch { flex-direction: row; }
.buyer-switch .choice { flex: 1; }
.company-fields { margin-top: 18px; }
.company-fields[hidden] { display: none; }
.vat-mark { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-alt); color: var(--text-2); font-size: .85em; white-space: nowrap; }
.vat-note { margin: 12px 0 0; color: var(--text-2); font-size: .92em; }

/* task 25: Omniva parcel locker — search with suggestions (omniva.js) or a plain select without JS */
.choice:has(input:disabled) { cursor: not-allowed; opacity: .75; }
.choice:has(input:disabled):hover { border-color: var(--line); }
.choice-note { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; line-height: 1.35; }
.locker-pick { margin: 18px 0 0; }
.locker-pick[hidden] { display: none; }
.locker-pick.has-error .input { border-color: var(--danger); }
.locker-search { position: relative; }
.locker-input { scroll-margin-top: calc(var(--header-h) + 12px); }
.locker-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px 0; list-style: none;
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.locker-list[hidden], .locker-none[hidden] { display: none; }
.locker-option { display: flex; flex-direction: column; gap: 1px; padding: 9px 14px; cursor: pointer; line-height: 1.3; }
.locker-option span { color: var(--text-2); font-size: 14px; }
.locker-option:hover, .locker-option[aria-selected="true"] { background: var(--surface-alt); }
.locker-option[aria-selected="true"] { box-shadow: 3px 0 0 var(--blue) inset; }
.locker-option.is-current strong { color: var(--blue); }
.locker-none { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.locker-chosen {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 2px 0 0; padding: 10px 14px;
  border-radius: var(--radius-sm); background: var(--surface-alt);
}
.locker-chosen[hidden] { display: none; }
.locker-chosen-title { width: 100%; color: var(--text-2); font-size: 13px; }
.locker-chosen span[data-locker-address] { color: var(--text-2); }
.locker-id { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.locker-id:not(:empty)::before { content: "#"; }

@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-side { position: static; }
}
/* G20: phone ergonomics (<= 700px) — 44 px controls, radios/checkboxes 22 px, main buttons full width */
@media (max-width: 700px) {
  .cart-line { grid-template-columns: 60px minmax(0, 1fr) 44px; gap: 8px 12px; }
  .cart-line .qty, .cart-sum { grid-column: 2; }
  .cart-sum { text-align: left; }
  .cart-thumb { width: 60px; height: 45px; }
  .cart-name a { display: inline-flex; align-items: center; min-height: 44px; }
  .cart-remove { width: 44px; height: 44px; font-size: 24px; }
  .cart-line .qty { width: 96px; }
  .cart-foot { flex-direction: column; align-items: stretch; }
  .sums { width: 100%; min-width: 0; }
  .cart-actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .cart-actions .btn, .cart-foot .btn { width: 100%; }
  .checkout-form fieldset.card, .summary, .order-page .card { padding: 20px; }
  .choices { gap: 8px; }
  .choice { min-height: 56px; padding: 12px 16px; }
  .choice input { width: 22px; height: 22px; }
  .buyer-switch { flex-direction: column; }
  .company-fields .btn { width: 100%; min-height: 48px; }
  .check { min-height: 44px; align-items: center; gap: 12px; }
  .check input { margin-top: 0; }
  .order-facts { grid-template-columns: 1fr; gap: 2px; }
  .order-facts dt { font-size: 15px; margin-top: 10px; }
  .order-facts dt:first-child { margin-top: 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .country-row { flex-direction: column; align-items: stretch; }
  .country-row .btn { width: 100%; min-height: 48px; }
  .demo-pay { padding: 28px 20px; }
  .demo-pay .actions .btn, .order-pay .btn { width: 100%; }
  /* task 25: the list sits in the flow under the field (never past the screen edge), scrolls inside itself */
  .locker-list { position: static; margin-top: 6px; max-height: min(50vh, 360px); box-shadow: none; }
  .locker-option { min-height: 52px; justify-content: center; padding: 10px 16px; font-size: 16px; }
  .locker-option span { font-size: 15px; }
  .locker-none, .choice-note, .locker-chosen-title, .locker-id { font-size: 15px; }
}

/* task 33: an order under review */
.badge.status-review { background: rgba(184, 92, 0, .12); color: #9a4d00; }
