/* Checkout (SDD-009, 08-cart-checkout «Checkout», «Статуси»): steps (cmp.checkoutSection),
   delivery and payment cards, «było → jest», the order list, status badges and timeline,
   the payment stub, the «Tylko kurier» label. Tokens only; 320–1440 px without horizontal
   scrolling; radio cards and fields are at least 44 px high. */

/* ---------- «Tylko kurier» (product, cart line, checkout) ---------- */
.np-shipping-label {
  display: inline-flex; align-items: center; align-self: flex-start; min-height: 22px; padding: 0 var(--np-space-2);
  border: var(--np-borderWidth-default) solid var(--np-color-border-strong); border-radius: var(--np-radius-sm);
  font: var(--np-type-caption); font-weight: var(--np-font-weight-semibold); color: var(--np-color-text-secondary); white-space: nowrap;
}
.np-buy-box__availability { display: flex; flex-direction: column; gap: var(--np-space-2); }

/* ---------- page ---------- */
.np-checkout-page { display: flex; flex-direction: column; gap: var(--np-space-4); padding-bottom: var(--np-space-12); }
.np-checkout {
  display: grid; gap: var(--np-space-6); align-items: start;
  grid-template-areas: "steps" "totals" "submit";
}
.np-checkout__steps { grid-area: steps; display: flex; flex-direction: column; gap: var(--np-space-4); min-width: 0; }
.np-checkout__totals { grid-area: totals; min-width: 0; }
.np-checkout__submit { grid-area: submit; display: flex; flex-direction: column; gap: var(--np-space-3); min-width: 0; }
@media (min-width: 1024px) {
  .np-checkout {
    grid-template-columns: minmax(0, 1fr) 360px; column-gap: var(--np-space-8);
    grid-template-areas: "steps totals" "submit totals";
  }
  .np-checkout__totals { position: sticky; top: calc(var(--np-size-header-desktop) + var(--np-space-4)); }
}

/* ---------- cmp.checkoutSection ---------- */
.np-checkout-section {
  display: flex; flex-direction: column; gap: var(--np-space-4); padding: var(--np-space-5);
  border: var(--np-borderWidth-default) solid var(--np-color-border-default); border-radius: var(--np-radius-md);
  background: var(--np-color-bg-page);
}
.np-checkout-section[data-state="locked"] { background: var(--np-color-bg-subtle); color: var(--np-color-text-muted); }
.np-checkout-section[data-error] { border-color: var(--np-color-border-danger); }
.np-checkout-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--np-space-3); }
.np-checkout-section__title { display: flex; align-items: center; gap: var(--np-space-3); font: var(--np-type-h3); }
.np-checkout-section__title:focus { outline: none; }
.np-checkout-section__number {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: var(--np-radius-full); background: var(--np-color-bg-inverse); color: var(--np-color-text-inverse);
  font: var(--np-type-bodySm); font-weight: var(--np-font-weight-bold);
}
.np-checkout-section[data-state="locked"] .np-checkout-section__number { background: var(--np-color-border-strong); }
.np-checkout-section__change { display: inline-flex; align-items: center; min-height: var(--np-size-control-lg); }
.np-checkout-section__summary { font: var(--np-type-bodySm); color: var(--np-color-text-secondary); overflow-wrap: anywhere; }
.np-checkout-section__body { display: flex; flex-direction: column; gap: var(--np-space-4); }
.np-checkout-section__next { display: flex; }

.np-checkout__fields { max-width: 560px; }
.np-checkout__row { display: grid; gap: var(--np-space-4); }
@media (min-width: 480px) { .np-checkout__row { grid-template-columns: 140px minmax(0, 1fr); } }
.np-checkout__group { display: flex; flex-direction: column; gap: var(--np-space-3); }
.np-checkout__group-title { font-weight: var(--np-font-weight-semibold); }
/* The groups are asked only for one method / with an invoice: «(opcjonalnie)» would mislead. */
.np-checkout__group .np-label__optional { display: none; }
.np-checkout__recalculate { display: flex; }

/* ---------- cmp.deliveryOption ---------- */
.np-checkout__delivery { display: flex; flex-direction: column; gap: var(--np-space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.np-delivery-option { display: flex; flex-direction: column; }
.np-delivery-option__card, .np-payment-option {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--np-space-3);
  min-height: var(--np-size-control-lg); padding: var(--np-space-3) var(--np-space-4); cursor: pointer;
  border: var(--np-borderWidth-default) solid var(--np-color-border-strong); border-radius: var(--np-radius-md);
  background: var(--np-color-bg-page); transition: border-color var(--np-motion-hover);
}
.np-delivery-option__card:hover { border-color: var(--np-color-action-primary-bg); }
.np-delivery-option__card:has(input:checked), .np-payment-option:has(input:checked) {
  border: var(--np-borderWidth-strong) solid var(--np-color-action-primary-bg); background: var(--np-color-bg-selected);
}
.np-delivery-option__card:has(input:focus-visible), .np-payment-option:has(input:focus-visible) {
  outline: 2px solid var(--np-color-border-focus); outline-offset: 2px;
}
.np-delivery-option.is-unavailable .np-delivery-option__card { cursor: not-allowed; background: var(--np-color-bg-subtle); border-style: dashed; }
.np-delivery-option.is-unavailable :is(.np-delivery-option__name, .np-delivery-option__price) { color: var(--np-color-text-muted); }
.np-delivery-option__card input, .np-payment-option input {
  appearance: none; flex: none; display: inline-grid; place-content: center; margin: 0;
  width: var(--np-space-5); height: var(--np-space-5); border-radius: var(--np-radius-full);
  border: 1.5px solid var(--np-color-text-secondary); background: var(--np-color-bg-page); cursor: inherit;
}
.np-delivery-option__card input:checked, .np-payment-option input:checked { border: var(--np-borderWidth-strong) solid var(--np-color-action-primary-bg); }
.np-delivery-option__card input:checked::before, .np-payment-option input:checked::before {
  content: ""; width: 10px; height: 10px; border-radius: var(--np-radius-full); background: var(--np-color-action-primary-bg);
}
.np-delivery-option__card input:disabled { border-color: var(--np-color-border-default); background: var(--np-color-action-disabled-bg); }
.np-delivery-option__body, .np-payment-option__body { display: flex; flex-direction: column; gap: var(--np-space-0-5); min-width: 0; }
.np-delivery-option__name, .np-payment-option__name { font-weight: var(--np-font-weight-semibold); overflow-wrap: anywhere; }
.np-delivery-option__description, .np-payment-option__note { font: var(--np-type-bodySm); color: var(--np-color-text-secondary); }
.np-delivery-option__reason { display: inline-flex; align-items: center; gap: var(--np-space-1); font: var(--np-type-bodySm); color: var(--np-color-feedback-warning-fg); }
.np-delivery-option__reason .np-icon { flex: none; width: var(--np-size-icon-sm); height: var(--np-size-icon-sm); }
.np-delivery-option__price { font: var(--np-type-price); font-variant-numeric: tabular-nums; white-space: nowrap; }
.np-delivery-option__which { padding: var(--np-space-1) var(--np-space-4) 0; font: var(--np-type-bodySm); }
.np-delivery-option__which summary { display: inline-flex; align-items: center; min-height: var(--np-size-control-lg); cursor: pointer; color: var(--np-color-text-link); font-weight: var(--np-font-weight-semibold); }
.np-delivery-option__which ul { margin: 0 0 var(--np-space-2); padding-left: var(--np-space-5); }

/* ---------- cmp.paymentOption ---------- */
.np-payment-option__logos { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--np-space-2); }
.np-payment-option__logos img { width: auto; height: 24px; }
@media (max-width: 479.98px) {
  .np-payment-option { grid-template-columns: auto minmax(0, 1fr); }
  .np-payment-option__logos { grid-column: 2; justify-content: flex-start; }
}

/* ---------- the order list (step 4, order page) ---------- */
.np-checkout__lines-title { font: var(--np-type-h4); }
.np-checkout__lines-group { font: var(--np-type-bodySm); font-weight: var(--np-font-weight-semibold); color: var(--np-color-text-secondary); }
.np-checkout__lines { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.np-checkout-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--np-space-1) var(--np-space-3);
  padding-block: var(--np-space-3); border-bottom: var(--np-borderWidth-default) solid var(--np-color-border-default);
  font-variant-numeric: tabular-nums;
}
.np-checkout-line__name { font-weight: var(--np-font-weight-semibold); overflow-wrap: anywhere; }
.np-checkout-line__variant { font-weight: var(--np-font-weight-regular); color: var(--np-color-text-secondary); }
.np-checkout-line__calc { grid-column: 1; font: var(--np-type-bodySm); color: var(--np-color-text-secondary); }
.np-checkout-line__discount { font-weight: var(--np-font-weight-semibold); color: var(--np-color-feedback-success-fg); }
.np-checkout-line__total { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; font-weight: var(--np-font-weight-semibold); }
.np-checkout-line__label { grid-column: 1; display: flex; }

/* ---------- order summary additions ---------- */
.np-summary__delivery-name { font: var(--np-type-bodySm); }
.np-summary__free-delivery { color: var(--np-color-feedback-success-fg); font-weight: var(--np-font-weight-semibold); }
.np-summary__free { display: flex; gap: var(--np-space-2); align-items: flex-start; font: var(--np-type-bodySm); color: var(--np-color-feedback-info-fg); }
.np-summary__free .np-icon { flex: none; width: var(--np-size-icon-sm); height: var(--np-size-icon-sm); margin-top: 2px; }
.np-summary__together { font: var(--np-type-bodySm); color: var(--np-color-text-secondary); }

/* ---------- consents and the button ---------- */
.np-checkout__terms .np-check { align-items: center; }
.np-checkout__obligation { text-align: center; }
.np-checkout .np-btn[aria-busy="true"] { cursor: progress; opacity: .8; }

/* ---------- cmp.changeConfirm ---------- */
.np-change-confirm { display: flex; flex-direction: column; gap: var(--np-space-3); }
.np-change-confirm--banner {
  padding: var(--np-space-4) var(--np-space-5); border-radius: var(--np-radius-md);
  background: var(--np-color-feedback-warning-bg); border: var(--np-borderWidth-default) solid var(--np-color-feedback-warning-fg);
}
.np-change-confirm__title { display: flex; align-items: center; gap: var(--np-space-2); font-weight: var(--np-font-weight-bold); color: var(--np-color-feedback-warning-fg); }
.np-change-confirm__title .np-icon { flex: none; width: var(--np-size-icon-md); height: var(--np-size-icon-md); }
.np-change-confirm__lead { font: var(--np-type-bodySm); }
.np-change-confirm__list { display: flex; flex-direction: column; gap: var(--np-space-2); margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.np-change-confirm__item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--np-space-1) var(--np-space-3); }
.np-change-confirm__item--total { padding-top: var(--np-space-2); border-top: var(--np-borderWidth-default) solid var(--np-color-border-strong); font-weight: var(--np-font-weight-bold); }
.np-change-confirm__label { overflow-wrap: anywhere; }
.np-change-confirm__values { white-space: nowrap; }
.np-change-confirm__values s { color: var(--np-color-text-secondary); }
.np-change-confirm__actions { display: flex; flex-wrap: wrap; gap: var(--np-space-3); }

/* ---------- cmp.orderStatus ---------- */
.np-order-status { display: flex; flex-direction: column; gap: var(--np-space-4); }
.np-order-status__badges { display: flex; flex-wrap: wrap; gap: var(--np-space-4); margin: 0; }
.np-order-status__badges div { display: flex; flex-direction: column; gap: var(--np-space-1); }
.np-order-status__badges dt { font: var(--np-type-caption); color: var(--np-color-text-secondary); }
.np-order-status__badges dd { margin: 0; }
.np-status-badge {
  display: inline-flex; align-items: center; gap: var(--np-space-2); min-height: 28px; padding: 0 var(--np-space-3);
  border-radius: var(--np-radius-full); font: var(--np-type-bodySm); font-weight: var(--np-font-weight-semibold);
  background: var(--np-color-bg-subtle); color: var(--np-color-text-primary);
}
.np-status-badge i { flex: none; width: 9px; height: 9px; border-radius: var(--np-radius-full); border: 2px solid currentColor; }
/* Shape + text, never colour alone: waiting — hollow circle, done — filled, problem — square. */
.np-status-badge--pending, .np-status-badge--awaiting_confirmation, .np-status-badge--new, .np-status-badge--awaiting_supplier {
  background: var(--np-color-feedback-warning-bg); color: var(--np-color-feedback-warning-fg);
}
.np-status-badge--paid, .np-status-badge--delivered, .np-status-badge--shipped, .np-status-badge--processing, .np-status-badge--ready_for_pickup, .np-status-badge--partially_shipped {
  background: var(--np-color-feedback-success-bg); color: var(--np-color-feedback-success-fg);
}
:is(.np-status-badge--paid, .np-status-badge--delivered, .np-status-badge--shipped, .np-status-badge--processing, .np-status-badge--ready_for_pickup, .np-status-badge--partially_shipped) i { background: currentColor; }
.np-status-badge--failed, .np-status-badge--cancelled, .np-status-badge--refunded, .np-status-badge--partially_refunded {
  background: var(--np-color-feedback-error-bg); color: var(--np-color-feedback-error-fg);
}
:is(.np-status-badge--failed, .np-status-badge--cancelled, .np-status-badge--refunded, .np-status-badge--partially_refunded) i { border-radius: 0; background: currentColor; }
.np-order-status__events { display: flex; flex-direction: column; gap: var(--np-space-2); margin: 0; padding-left: var(--np-space-5); font: var(--np-type-bodySm); }
.np-order-status__events time { color: var(--np-color-text-secondary); font-variant-numeric: tabular-nums; }

/* ---------- order page, payment stub ---------- */
.np-order-page, .np-payment-page { display: flex; flex-direction: column; gap: var(--np-space-4); padding-bottom: var(--np-space-12); }
.np-order-page__section { display: flex; flex-direction: column; gap: var(--np-space-3); max-width: 720px; }
.np-order-page__totals { padding-top: var(--np-space-3); }
.np-payment-stub { display: flex; flex-direction: column; gap: var(--np-space-4); max-width: 640px; }
.np-payment-stub__title:focus { outline: none; }
.np-payment-stub__facts { max-width: 400px; }
.np-payment-stub__logos { display: flex; gap: var(--np-space-3); }
.np-payment-stub__logos img { width: auto; height: 24px; }
