/* ============================================================
   OSJ Sharp — Checkout (WooCommerce Checkout block)
   ------------------------------------------------------------
   There is deliberately no woocommerce/checkout/form-checkout.php in
   this theme. On a block checkout that override is silently ignored,
   and BUILD-HANDOFF §1 is explicit that putting one there "will waste
   a day". The layout comes from the Checkout block's own inner blocks,
   reordered in the editor, and from this stylesheet.

   Accepted up front: block checkout will never be pixel-identical to
   the comp. Type, colour, spacing, radii and focus rings all come
   across; exact field grouping and the payment accordion's internals
   follow the block.
   ============================================================ */

.woocommerce-checkout .osj-page-title { display: none; }

.wp-block-woocommerce-checkout {
  max-width: var(--container-md);
  margin-inline: auto;
  padding-block: var(--space-6) var(--space-9);
}

/* --- Two-column shell ---------------------------------------------- */
.wc-block-checkout__main { min-width: 0; padding: 0; }
.wc-block-checkout__sidebar { min-width: 0; padding: 0; }

@media (min-width: 1001px) {
  .wc-block-checkout__form,
  .wc-block-checkout .wc-block-components-sidebar-layout {
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 56px;
  }
  .wc-block-checkout__sidebar { position: sticky; top: var(--space-6); }
}

/* --- Step headings -------------------------------------------------- */
.wc-block-components-checkout-step__title {
  font-family: var(--font-display);
  font-weight: var(--weight-ultra);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text-strong);
}
.wc-block-components-checkout-step__description {
  font-size: 13.5px;
  color: var(--text-body);
}
.wc-block-components-checkout-step__heading { margin-bottom: 18px; }
.wc-block-components-checkout-step {
  padding-bottom: var(--space-7);
  border-bottom: none;
}
/* The block draws a numbered rail down the left; the comp does not. */
.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container::before,
.wc-block-components-checkout-step__heading-content { display: none; }
.wc-block-components-checkout-step__container { padding-left: 0; }

/* --- Fields --------------------------------------------------------- */
.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-block-components-combobox-control input.components-combobox-control__input,
.wc-block-components-select__container select {
  padding: 14px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-strong);
  min-height: auto;
}
.wc-block-components-text-input input:focus,
.wc-block-components-textarea:focus,
.wc-block-components-select__container select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-glow);
}
.wc-block-components-text-input label,
.wc-block-components-select label {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-muted);
}
.wc-block-components-text-input.is-active label {
  font-size: 12px;
  color: var(--text-muted);
}
/* Postcode reads as a spec value, so it takes the mono face. */
.wc-block-components-address-form__postcode input { font-family: var(--font-mono); }

.wc-block-components-validation-error { color: var(--danger); font-size: 13px; }

/* --- Checkboxes & radios ------------------------------------------- */
.wc-block-components-checkbox__input[type="checkbox"],
.wc-block-components-radio-control__input {
  accent-color: var(--brand);
  border-color: var(--border-strong);
}
.wc-block-components-checkbox__label,
.wc-block-components-radio-control__label { font-size: 14px; color: var(--text-body); }

/* --- Delivery options ----------------------------------------------- */
.wc-block-components-radio-control__option {
  padding: 16px 18px 16px 46px;
  border: 1px solid var(--border-field);
  border-radius: 6px;
  background: var(--surface-card);
  margin-bottom: 10px;
}
.wc-block-components-radio-control__option--checked-option-highlighted,
.wc-block-components-radio-control-accordion-option--checked-option-highlighted {
  border-color: var(--ink-900);
}
.wc-block-components-radio-control__option::after { display: none; }
.wc-block-components-radio-control__option-layout { gap: 14px; }
.wc-block-components-radio-control__label { font-weight: var(--weight-semibold); font-size: 15px; color: var(--text-strong); }
.wc-block-components-radio-control__description { font-size: 13.5px; color: var(--text-body); }
.wc-block-components-radio-control__secondary-label,
.wc-block-components-radio-control__secondary-description {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
  font-size: 15px;
  color: var(--text-strong);
}

/* --- Payment -------------------------------------------------------- */
.wc-block-components-radio-control-accordion-option {
  border: 1px solid var(--border-field);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.wc-block-components-radio-control-accordion-content {
  padding: 18px;
  background: #FDFAF4;
  border-top: 1px solid var(--border-hairline);
}
.wc-block-checkout__payment-method .wc-block-components-radio-control__option { border: none; margin-bottom: 0; }

/* --- Order summary --------------------------------------------------- */
.wc-block-components-sidebar .wc-block-components-panel,
.wp-block-woocommerce-checkout-order-summary-block {
  padding: 26px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.wc-block-components-order-summary__button-text,
.wp-block-woocommerce-checkout-order-summary-block > .wc-block-components-title {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-strong);
}
.wc-block-components-order-summary-item__image img {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-sunken);
}
.wc-block-components-order-summary-item__quantity {
  background: var(--ink-900);
  color: var(--sand-50);
  border-color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 11px;
}
.wc-block-components-order-summary-item__description .wc-block-components-product-name {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: 14px;
  line-height: 1.35;
}
.wc-block-components-order-summary-item__total-price {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.wc-block-components-totals-item__label { color: var(--text-body); font-size: 14.5px; }
.wc-block-components-totals-item__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value { font-size: 1.6rem; font-weight: var(--weight-semibold); }

/*
 * The made-to-order lead-time note under the total, and the re-cut promise.
 * BUILD-HANDOFF §1 prefers a static block placed inside the Checkout block in
 * the editor for copy like this — do that, and these rules will style it.
 * Add a paragraph with the class osj-checkout-note (Advanced -> Additional CSS
 * class) inside the Order Summary block.
 */
.osj-checkout-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-body);
}
.osj-checkout-note--lead {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-link);
}

/* --- Place order ----------------------------------------------------- */
.wc-block-components-checkout-place-order-button {
  min-height: 56px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--text-on-brand);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background var(--dur-base) var(--ease-out);
}
.wc-block-components-checkout-place-order-button:hover {
  background: var(--brand-hover);
  color: var(--text-on-brand);
}

.wc-block-checkout__actions .wc-block-components-checkout-return-to-cart-button {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-link);
}

/*
 * The order summary repeats each product's short description — five lines per
 * line item, and this catalogue now has a real lede on 82 products, so a
 * five-item order buries the totals under a wall of marketing copy. Checkout is
 * where someone confirms a decision they already made; the description is the
 * one thing there they do not need.
 *
 * Only the description. Variation data lives in
 * .wc-block-components-product-details and must survive — on a divider set,
 * "Option 21 – Gambit, Storm, Wolverine" IS the product identity.
 */
.wc-block-components-order-summary-item .wc-block-components-product-metadata__description {
  display: none;
}

/* --- Mobile ---------------------------------------------------------
 *
 * Measured at 390px against the real block output rather than guessed at.
 * Text inputs already come through at 16px, so iOS does not zoom on focus,
 * and Place order is a 53px target — both fine as they stand.
 *
 * The checkbox rows are not. "Use same address for billing" and "Add a note
 * to your order" render as 20px-tall labels, which is half a usable touch
 * target, and both are decisions a customer makes with a thumb.
 */
@media (max-width: 760px) {
  .wc-block-components-checkbox label {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  /* The control keeps its own size; only the hit area grows. */
  .wc-block-components-checkbox__input { flex: 0 0 auto; }
}
