/*
 * Checkout layout — client feedback 2026-09-30 (WooCommerce 11.0.1 Blocks checkout).
 *
 * 1. ORDER SUMMARY FIRST, ON EVERY WIDTH. The checkout is one centred column with the
 *    summary (items + totals) above contact, pickup, the benefits panel and payment.
 *    Stock WooCommerce puts it in a right-hand sidebar on desktop and folds it into a
 *    collapsed "Order summary $X" bar on narrow screens.
 *
 * 2. ONE SUMMARY ON MOBILE. Below a 700px container WooCommerce renders the summary
 *    TWICE: the collapsible bar at the top (the sidebar, re-ordered first) AND a full copy
 *    injected through a slot above "Place order" (`.checkout-order-summary-block-fill-wrapper`).
 *    We keep the top one, force it open, and drop the copy.
 *
 * 3. COLLECT-ONLY DETAILS. ZiiCloud for WooCommerce's stores module (ZIIC_Collect_Only_Checkout,
 *    setting stores_collect_only; mrdad-stores' MDS_Checkout_Fields until unify) hides the street
 *    lines, city and company through WooCommerce's own locale config. Country, state and postcode are
 *    made optional there but deliberately kept in the form (Blocks blanks hidden values,
 *    and shipping-zone matching reads them), so they are hidden here, visually only.
 *
 * Pure CSS on WooCommerce's own classes: no DOM moves, nothing to redo after React
 * re-renders. Selectors carry `body` + three classes to outrank WooCommerce's rules
 * (up to 0,3,0 via :has()) whatever order the stylesheets print in — the checkout block's
 * CSS is enqueued during the block render and can print after ours.
 */

/* ---- 1. one column, summary first ---------------------------------------------------- */

body .wp-block-woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout {
	flex-direction: column;
	flex-wrap: nowrap;
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

body .wp-block-woocommerce-checkout .wc-block-components-sidebar-layout .wc-block-checkout__sidebar {
	order: 0;
	width: 100%;
	padding: 0;
	margin: 0 0 32px;
	align-self: stretch;
	/* A sticky summary on top of a single column would ride over the form as it scrolls. */
	position: static;
	top: auto;
}

body .wp-block-woocommerce-checkout .wc-block-components-sidebar-layout .wc-block-checkout__main {
	order: 1;
	width: 100%;
	padding: 0;
}

/* ---- 2. the summary is open, and there is only one ----------------------------------- */

body .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__content {
	display: block;
}

/* The collapsed bar's toggle chevron and repeated total mean nothing once it is open. */
body .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title-icon,
body .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title-price {
	display: none;
}

body .wp-block-woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title {
	cursor: default;
	pointer-events: none;
}

/* The second copy WooCommerce slots in above "Place order" on narrow screens. */
body .wp-block-woocommerce-checkout .wc-block-checkout .checkout-order-summary-block-fill-wrapper {
	display: none;
}

/* ---- 3. collect-only: no location fields on screen ----------------------------------- */

body .wp-block-woocommerce-checkout .wc-block-components-address-form .wc-block-components-address-form__country,
body .wp-block-woocommerce-checkout .wc-block-components-address-form .wc-block-components-country-input,
body .wp-block-woocommerce-checkout .wc-block-components-address-form .wc-block-components-address-form__state,
body .wp-block-woocommerce-checkout .wc-block-components-address-form .wc-block-components-state-input,
body .wp-block-woocommerce-checkout .wc-block-components-address-form .wc-block-components-address-form__postcode {
	display: none;
}
