/**
 * Cart and checkout.
 * ==========================================================================
 *
 * @package Cropped
 * @since   1.0.0
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * Cart layout
 *
 * One column, always: the bag at full width, the totals underneath it.
 *
 * This was briefly two columns, with the totals in a 23rem track beside the
 * table. It is not, because the table cannot afford the width. Squeezed into
 * the remaining ~1fr, product titles wrapped to five lines, the "Subtotal"
 * column head clipped to "Subt", and the subtotal figures fell off the end
 * behind the `.cr-table-scroll` scrollbar — the one thing on this page that
 * must never be hidden was the thing that got hidden.
 *
 * So the table keeps the whole width, and the emptiness that used to sit
 * beside the totals panel is dealt with inside the panel instead: see
 * `.cart_totals` below, which spans the full width and carries its heading in
 * the space the figures do not need.
 *
 * The wrapper stays even though it no longer divides anything: it is the one
 * element on the page that survives an update, so `shop.js` hangs the
 * `cr-cart-busy` shimmer class on it. The form and the totals are both
 * replaced wholesale when the new figures arrive.
 * -------------------------------------------------------------------------- */

.cr-cart__layout {
	display: flow-root;
}

.cr-cart__items {
	min-inline-size: 0;
}


/* --------------------------------------------------------------------------
 * Cart table
 * -------------------------------------------------------------------------- */

.cr-cart__table th.product-price,
.cr-cart__table th.product-quantity,
.cr-cart__table th.product-subtotal {
	white-space: nowrap;
}

.cr-cart-item {
	display: flex;
	gap: var( --cr-space-md );
	align-items: flex-start;
}

.cr-cart-item__media {
	flex: none;
	inline-size: 5.5rem;
}

@media ( min-width: 48rem ) {
	.cr-cart-item__media {
		inline-size: 6.5rem;
	}
}

.cr-cart-item__media img {
	inline-size: 100%;
	aspect-ratio: var( --cr-ratio-product );
	object-fit: cover;
	border-radius: var( --cr-radius-sm );
	background-color: var( --cr-surface-sunken );
}

.cr-cart-item__title {
	margin: 0;
	font-size: var( --cr-text-base );
	font-weight: var( --cr-weight-medium );
	line-height: 1.35;
}

.cr-cart-item__title a {
	color: var( --cr-text );
	text-decoration: none;
}

.cr-cart-item__title a:hover {
	color: var( --cr-text-accent );
}

/*
 * Variation data as a two-column definition list — "Size / M", "Colour /
 * Black" — rather than one comma-joined sentence.
 */
.cr-cart-item__meta {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0 var( --cr-space-xs );
	margin: var( --cr-space-2xs ) 0 0;
	font-size: var( --cr-text-xs );
	color: var( --cr-text-muted );
}

.cr-cart-item__meta dt::after {
	content: ":";
}

.cr-cart-item__meta dd {
	margin: 0;
	color: var( --cr-text-secondary );
}

.cr-cart__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: var( --cr-tap-target );
	block-size: var( --cr-tap-target );
	color: var( --cr-text-muted );
	border-radius: var( --cr-radius-sm );
	text-decoration: none;
}

.cr-cart__remove:hover {
	color: var( --cr-sale );
	background-color: var( --cr-surface-sunken );
}

.cr-cart__table td.actions {
	padding-block: var( --cr-space-lg );
}

.cr-cart__coupon {
	display: flex;
	gap: var( --cr-space-xs );
	max-inline-size: 22rem;
	margin-block-end: var( --cr-space-md );
}

.cr-cart__coupon .cr-input {
	min-inline-size: 0;
}

/*
 * A cart row is as tall as its photograph — around 172px — and everything in
 * it was top-aligned, which left the price, the stepper and the line total
 * stranded in the first 40px with a hundred pixels of nothing beneath them.
 * Centring them against the photo balances the row. The product cell keeps its
 * top alignment, because its title has to start level with the top of the
 * image it belongs to.
 *
 * `.woocommerce` leads the selector to clear `.woocommerce table.shop_table td
 * { vertical-align: top }`, which is the same weight but loaded after this
 * file.
 */
@media ( min-width: 48rem ) {
	.woocommerce .cr-cart__table td.product-price,
	.woocommerce .cr-cart__table td.product-quantity,
	.woocommerce .cr-cart__table td.product-subtotal,
	.woocommerce .cr-cart__table td.product-remove {
		vertical-align: middle;
	}
}

/* --------------------------------------------------------------------------
 * Cart table, stacked below 48rem
 *
 * Each row becomes a card and each cell shows its `data-title` as a visible
 * label. This does discard the table semantics at this width — see the note in
 * `woocommerce/cart/cart.php` for why that trade is the better one here.
 *
 * Every `td` rule below leads with `.woocommerce`. That is not decoration: the
 * plain form, `.cr-cart__table td`, is the same weight as WooCommerce's own
 * `.woocommerce table.shop_table td`, which is loaded after this file and
 * therefore wins every tie. Without the prefix the padding and borders here
 * were silently discarded — the remove control ended up sitting on top of the
 * second line of the product title on a phone, because the 44px of clearance
 * `td.product-name` asks for was never applied.
 * -------------------------------------------------------------------------- */

@media ( max-width: 47.99rem ) {
	.cr-cart__table thead {
		/* Not `display: none`: the column headers are still the accessible
		   names for the cells above 48rem, and hiding them visually keeps them
		   available to anyone whose browser ignores the reflow. */
		position: absolute;
		inline-size: 1px;
		block-size: 1px;
		overflow: hidden;
		clip-path: inset( 50% );
	}

	.cr-cart__table,
	.cr-cart__table tbody,
	.cr-cart__table tr,
	.woocommerce .cr-cart__table td {
		display: block;
		inline-size: 100%;
	}

	.cr-cart__table tr.cart_item {
		position: relative;
		padding-block: var( --cr-space-md );
		border-block-end: 1px solid var( --cr-border );
	}

	.woocommerce .cr-cart__table td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var( --cr-space-md );
		padding: var( --cr-space-2xs ) 0;
		border: 0;
	}

	.woocommerce .cr-cart__table td::before {
		content: attr( data-title );
		font-size: var( --cr-text-xs );
		letter-spacing: var( --cr-tracking-wide );
		text-transform: uppercase;
		color: var( --cr-text-muted );
	}

	/* The product cell is the row's heading; it gets no label of its own. */
	.woocommerce .cr-cart__table td.product-name {
		display: block;
		padding-inline-end: var( --cr-tap-target );
	}

	.woocommerce .cr-cart__table td.product-name::before {
		display: none;
	}

	/* The remove control sits in the row's top corner rather than on its own line. */
	.woocommerce .cr-cart__table td.product-remove {
		position: absolute;
		inset-block-start: var( --cr-space-md );
		inset-inline-end: 0;
		inline-size: auto;
		padding: 0;
	}

	.woocommerce .cr-cart__table td.actions {
		display: block;
	}

	.cr-cart__coupon {
		max-inline-size: none;
	}
}

/* --------------------------------------------------------------------------
 * Updating state
 *
 * Every figure that is about to change — each line subtotal, and every row of
 * the totals panel — is replaced by a spinner while the new numbers are being
 * fetched.
 *
 * The spinner is laid over the figure rather than put beside it: the number
 * keeps its place in the layout and only loses its colour, so the element
 * still measures exactly as wide as the price it stands for and nothing on the
 * page moves when the real figure lands. A spinner given a box of its own
 * would push the row twice per update, once on the way in and once on the way
 * out.
 *
 * The unit price is deliberately left alone. It does not change when the
 * quantity does, and spinning it would suggest otherwise.
 *
 * The class goes on `.cr-cart__layout`, which survives the swap; the form and
 * the totals inside it are both replaced wholesale when the response arrives.
 * -------------------------------------------------------------------------- */

@keyframes cr-cart-spin {
	to {
		transform: rotate( 360deg );
	}
}

.cr-cart-busy .product-subtotal .woocommerce-Price-amount,
.cr-cart-busy .cart_totals .woocommerce-Price-amount {
	position: relative;
	/* Inline elements cannot hold an absolutely positioned child reliably. */
	display: inline-block;
	min-inline-size: 2.5rem;
	color: transparent;
	user-select: none;
}

/* The currency symbol is its own span with its own colour; it must go too. */
.cr-cart-busy .product-subtotal .woocommerce-Price-amount *,
.cr-cart-busy .cart_totals .woocommerce-Price-amount * {
	color: transparent;
}

/* `inset: 0` plus `margin: auto` centres a fixed-size box without transforms,
   so it lands in the same place whichever way the text runs. */
.cr-cart-busy .product-subtotal .woocommerce-Price-amount::after,
.cr-cart-busy .cart_totals .woocommerce-Price-amount::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	inline-size: 0.9375rem;
	block-size: 0.9375rem;
	border: 2px solid var( --cr-border );
	border-block-start-color: var( --cr-text );
	border-radius: 50%;
	animation: cr-cart-spin 600ms linear infinite;
}

/* The order total is the largest figure in the panel; its spinner matches. */
.cr-cart-busy .cart_totals .order-total .woocommerce-Price-amount::after {
	inline-size: 1.125rem;
	block-size: 1.125rem;
}

/*
 * The shipping line is prose, not a price span, so it gets dimmed a level up —
 * otherwise "Standard delivery: Rs 300" stays crisp beside a spinning total
 * and reads as though only one of the two is being recalculated.
 */
.cr-cart-busy .cart_totals .woocommerce-shipping-methods,
.cr-cart-busy .cart_totals .woocommerce-shipping-destination {
	opacity: 0.45;
	transition: opacity var( --cr-duration ) var( --cr-ease );
}

/* Steppers stay clickable while a request is in flight — `shop.js` queues the
   change rather than dropping it — but they stop looking pressable. */
.cr-cart-busy .cr-qty {
	border-color: var( --cr-border );
}

/*
 * No rotation for anyone who has asked for less motion. The figure is dimmed
 * instead, which still says "this is being recalculated" without spinning
 * anything.
 */
@media ( prefers-reduced-motion: reduce ) {
	.cr-cart-busy .product-subtotal .woocommerce-Price-amount,
	.cr-cart-busy .cart_totals .woocommerce-Price-amount {
		color: inherit;
		opacity: 0.35;
	}

	.cr-cart-busy .product-subtotal .woocommerce-Price-amount *,
	.cr-cart-busy .cart_totals .woocommerce-Price-amount * {
		color: inherit;
	}

	.cr-cart-busy .product-subtotal .woocommerce-Price-amount::after,
	.cr-cart-busy .cart_totals .woocommerce-Price-amount::after {
		display: none;
	}
}

/* --------------------------------------------------------------------------
 * Cart totals
 * -------------------------------------------------------------------------- */

/*
 * A single panel, not a two-column grid.
 *
 * This was `minmax( 0, 1fr ) minmax( 0, 22rem )` from when the cross-sell row
 * shared the space. `inc/wc-cart.php` moved cross-sells to
 * `woocommerce_after_cart`, so the first column has been permanently empty
 * since — the totals were pinned into a 352px sliver with 600px of blank page
 * beside them, and the shipping calculator inside them was unusable.
 */
.cr-cart__collaterals {
	margin-block-start: var( --cr-space-xl );
}

.cart_totals {
	padding: var( --cr-space-lg );
	background-color: var( --cr-surface );
	border: 1px solid var( --cr-border );
	border-radius: var( --cr-radius-sm );
}

/*
 * The panel spans the page; the figures do not need the page.
 *
 * It used to be a 30rem card pushed to the end with `margin-inline-start:
 * auto`, which left roughly 600px of bare paper beside it on a desktop. The
 * obvious repair — letting the label/value rows stretch the full width — only
 * trades that for 700px of leader between "Subtotal" and its figure, which
 * reads like a table that failed to load.
 *
 * So the band is full width and the emptiness is given to the heading: it sits
 * in the space the figures do not want, and the panel is filled by design
 * rather than by stretching.
 */
@media ( min-width: 48rem ) {
	.cart_totals {
		display: grid;
		grid-template-columns: minmax( 0, 1fr ) minmax( 18rem, 26rem );
		column-gap: var( --cr-space-2xl );
		align-items: start;
		padding: var( --cr-space-xl );
	}

	/* Anything a plugin adds later spans the band rather than landing in a track. */
	.cart_totals > * {
		grid-column: 1 / -1;
	}

	.cart_totals > h2 {
		grid-column: 1;
		grid-row: 1;
		margin-block-end: 0;
	}

	.cart_totals > table {
		grid-column: 2;
		grid-row: 1;
	}

	.cart_totals > .wc-proceed-to-checkout {
		grid-column: 2;
		grid-row: 2;
	}
}

.cart_totals h2 {
	margin-block-end: var( --cr-space-md );
	font-size: var( --cr-text-lg );
}

.cart_totals table {
	inline-size: 100%;
	font-size: var( --cr-text-sm );
}

/*
 * The rule belongs to the row, not to each cell. As table cells the two
 * borders met and read as one line; as flex items each cell is only as wide as
 * its content, so they became two short dashes with a gap in the middle.
 */
.cart_totals tr {
	border-block-end: 1px solid var( --cr-border );
}

.cart_totals th,
.cart_totals td {
	padding-block: var( --cr-space-sm );
	text-align: start;
	vertical-align: top;
}

.cart_totals td {
	text-align: end;
	font-variant-numeric: tabular-nums;
}

/* The last row carries no rule; the border now lives on the row itself. */
.cart_totals .order-total {
	border-block-end: 0;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
	font-size: var( --cr-text-md );
	font-weight: var( --cr-weight-semibold );
}

/*
 * The shipping row stacks its label above its value, instead of sharing the
 * width with it.
 *
 * WooCommerce renders the "Change address" calculator inside this row's cell,
 * and at a label/value split that cell was 173px wide. The province `<select>`
 * inside it measured **1px** — a control that cannot be seen, let alone used.
 * Stacking gives the calculator the whole panel, and it also stops the normal
 * state ("Standard delivery: Rs 300 / Shipping to Sindh / Change address")
 * wrapping onto four short lines.
 */
/*
 * The totals are laid out as flex rows rather than as a table.
 *
 * It is a `<table>` in WooCommerce's markup and blocking individual rows does
 * not free them: a `display: block` row inside a `table-row-group` is still
 * wrapped in an anonymous cell and sized by the table's column algorithm, so
 * the shipping calculator stayed pinned to the value column's 309px inside a
 * 448px panel. Taking the whole table out of table layout is what actually
 * gives a row the choice of how to use its width.
 *
 * Ordinary rows keep label and value on one line, which is what a totals list
 * should read like; only the shipping row stacks.
 */
.cart_totals table,
.cart_totals tbody {
	display: block;
}

.cart_totals tr {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var( --cr-space-md );
}

.cart_totals .woocommerce-shipping-totals {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.cart_totals .woocommerce-shipping-totals th,
.cart_totals .woocommerce-shipping-totals td {
	inline-size: 100%;
	text-align: start;
}

/* WooCommerce renders the chosen rate as a list; it is one line of text here. */
.cart_totals .woocommerce-shipping-methods {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cart_totals .woocommerce-shipping-totals th {
	border-block-end: 0;
	padding-block-end: 0;
}

.cart_totals .shipping-calculator-form {
	margin-block-start: var( --cr-space-sm );
}

/*
 * Every control in the calculator takes the full width. Left to itself the
 * province select shrinks to its content — and with a placeholder first option
 * of "Select an option…" that content can be nothing at all.
 */
.cart_totals .shipping-calculator-form p,
.cart_totals .shipping-calculator-form .form-row {
	inline-size: 100%;
	margin-inline: 0;
	margin-block-end: var( --cr-space-sm );
}

.cart_totals .shipping-calculator-form input,
.cart_totals .shipping-calculator-form select,
.cart_totals .shipping-calculator-form .select2-container {
	inline-size: 100%;
	max-inline-size: 100%;
	min-inline-size: 0;
}

.cart_totals .shipping-calculator-form button {
	inline-size: 100%;
}

.wc-proceed-to-checkout {
	margin-block-start: var( --cr-space-md );
}

.wc-proceed-to-checkout .checkout-button {
	inline-size: 100%;
	min-block-size: var( --cr-control-height );
	font-size: var( --cr-text-base );
}

/* --------------------------------------------------------------------------
 * Checkout layout
 *
 * On a phone the summary is rendered *first*. `order` on a grid item does that
 * without moving it in the DOM — the form is still what a keyboard reaches
 * first, which is the order it should be filled in.
 * -------------------------------------------------------------------------- */

.cr-checkout__layout {
	display: grid;
	gap: var( --cr-space-2xl );
}

/*
 * The form comes first on a phone. No `order: -1`.
 *
 * The summary used to be pulled above it, on the reasoning that a shopper
 * should see what she is buying before she types. Measured on a 390px screen
 * that put the payment methods at 830px, "Place order" at 1,360px, and the
 * first address field at 1,620px — *below the button*. The order could be
 * submitted before any delivery detail had been seen, let alone filled.
 *
 * Reading order on a narrow screen is the DOM order, and the DOM order is the
 * right one: details, then what you are paying for, then how, then the button.
 * The two-column rule below restores the side-by-side arrangement from 64rem,
 * where there is room for both and nothing is pushed anywhere.
 */

@media ( min-width: 64rem ) {
	.cr-checkout__layout {
		grid-template-columns: minmax( 0, 1.4fr ) minmax( 0, 1fr );
		gap: var( --cr-space-3xl );
		align-items: start;
	}

	.cr-checkout__summary {
		order: 0;
		position: sticky;
		top: calc( var( --cr-header-height-lg ) + var( --cr-space-lg ) );
	}
}

.cr-checkout__customer h3,
.cr-checkout .woocommerce-billing-fields h3,
.cr-checkout .woocommerce-shipping-fields h3,
.cr-checkout .woocommerce-additional-fields h3 {
	margin-block-end: var( --cr-space-md );
	font-size: var( --cr-text-xl );
}

.cr-checkout .woocommerce-shipping-fields,
.cr-checkout .woocommerce-additional-fields {
	margin-block-start: var( --cr-space-2xl );
	padding-block-start: var( --cr-space-xl );
	border-block-start: 1px solid var( --cr-border );
}

/*
 * The `.woocommerce form .form-row` rules used to live here. They are not
 * checkout-specific: WooCommerce emits the same `.form-row` markup for login,
 * registration, lost password, address editing and account details, none of
 * which load this file. The result was a my-account login form with unstyled
 * 28 px-tall browser-default inputs — measured at 206×28 against a 44 px
 * minimum. They now live in `woocommerce.css`, which every WooCommerce context
 * loads. Only genuinely checkout-only rules belong in this file.
 */

/* --------------------------------------------------------------------------
 * Order review
 * -------------------------------------------------------------------------- */

.cr-checkout__summary-title {
	margin-block-end: var( --cr-space-md );
	font-size: var( --cr-text-xl );
}

.cr-checkout__review {
	padding: var( --cr-space-lg );
	background-color: var( --cr-surface );
	border: 1px solid var( --cr-border );
	border-radius: var( --cr-radius-sm );
}

.cr-checkout__review table.shop_table {
	margin-block-end: var( --cr-space-md );
}

/*
 * Flex rows, for the same reason the cart totals use them.
 *
 * As a two-column table in a 320px summary the value cell was 135px wide, so
 * "Standard delivery: Rs 300 / Delivered within Karachi." wrapped onto four
 * lines and made the shipping row 126px tall; and the amounts sat left-aligned
 * in that cell under a right-aligned "Subtotal" header, so nothing lined up on
 * the right edge where money is read.
 *
 * Label left, amount right, on one line. The shipping row stacks instead,
 * because its value is a sentence rather than a figure.
 */
.cr-checkout__review table.shop_table,
.cr-checkout__review table.shop_table tbody,
.cr-checkout__review table.shop_table tfoot {
	display: block;
}

.cr-checkout__review table.shop_table tr {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var( --cr-space-md );
	border-block-end: 1px solid var( --cr-border );
}

.cr-checkout__review table.shop_table td,
.cr-checkout__review table.shop_table th {
	padding-block: var( --cr-space-sm );
	border-block-end: 0;
}

/* The amount, right-aligned and in lining figures so columns of it agree. */
.cr-checkout__review table.shop_table td {
	text-align: end;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/*
 * The line item is the exception: its name is long and its quantity belongs
 * under it, so it keeps the full width and wraps like prose.
 */
.cr-checkout__review .cart_item td.product-name {
	text-align: start;
	white-space: normal;
}

/*
 * The column header sits over its amounts.
 */
.cr-checkout__review table.shop_table thead th:last-child {
	text-align: end;
}

/*
 * Written with `table.shop_table` in the selector so it outranks the
 * right-aligning rule above, which carries that class too. Without it the
 * shipping sentence was pushed to the right edge under a left-aligned label.
 */
.cr-checkout__review table.shop_table .woocommerce-shipping-totals {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.cr-checkout__review table.shop_table .woocommerce-shipping-totals td {
	inline-size: 100%;
	padding-block-start: 0;
	text-align: start;
	white-space: normal;
}

.cr-checkout__review table.shop_table .woocommerce-shipping-totals th {
	padding-block-end: var( --cr-space-3xs, 0.25rem );
}

.cr-checkout__review .woocommerce-shipping-methods {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* WooCommerce's own paragraph, which arrives with a browser default margin. */
.cr-checkout__review .woocommerce-shipping-destination {
	margin: 0;
}

.cr-checkout__review .order-total {
	border-block-end: 0;
}

.cr-checkout__review .order-total th,
.cr-checkout__review .order-total td {
	font-size: var( --cr-text-md );
	font-weight: var( --cr-weight-semibold );
}

/* The account block inside the Online Transfer description. */
.cr-payment-account {
	margin: var( --cr-space-sm ) 0 0;
	padding: 0;
	list-style: none;
	font-size: var( --cr-text-sm );
}

.cr-payment-account li + li {
	margin-block-start: var( --cr-space-3xs, 0.25rem );
}

.product-quantity {
	color: var( --cr-text-muted );
}

/* --------------------------------------------------------------------------
 * Payment methods
 * -------------------------------------------------------------------------- */

.woocommerce-checkout #payment {
	background: none;
	border-radius: 0;
}

.woocommerce-checkout #payment ul.payment_methods {
	margin: 0 0 var( --cr-space-md );
	padding: 0;
	list-style: none;
	border: 0;
}

/*
 * Direct children only. Unscoped, this also struck a rule between every line
 * of the account list inside a gateway's own description, which is a list of
 * one thing and not a set of choices.
 */
.woocommerce-checkout #payment ul.payment_methods > li {
	padding: var( --cr-space-sm ) 0;
	border-block-end: 1px solid var( --cr-border );
}

.woocommerce-checkout #payment ul.payment_methods > li:last-child {
	border-block-end: 0;
}

.woocommerce-checkout #payment ul.payment_methods label {
	display: inline-flex;
	align-items: center;
	gap: var( --cr-space-xs );
	min-block-size: var( --cr-tap-target );
	font-size: var( --cr-text-sm );
	font-weight: var( --cr-weight-medium );
	cursor: pointer;
}

.woocommerce-checkout #payment ul.payment_methods input[type="radio"] {
	inline-size: 1.15rem;
	block-size: 1.15rem;
	accent-color: var( --cr-stone-900 );
}

.woocommerce-checkout #payment div.payment_box {
	margin: var( --cr-space-xs ) 0 0;
	padding: var( --cr-space-sm ) var( --cr-space-md );
	background-color: var( --cr-surface-sunken );
	border-radius: var( --cr-radius-sm );
	font-size: var( --cr-text-sm );
	color: var( --cr-text-secondary );
}

.woocommerce-checkout #payment div.payment_box p:last-child {
	margin-block-end: 0;
}

/*
 * The shop is launching with Cash on Delivery only, so the radio list can hold
 * a single item. A radio group of one is a control with no choice in it — hide
 * the input, keep the label as a heading, and the box below still explains what
 * will happen. The input stays in the DOM and stays checked, so the form posts
 * exactly as WooCommerce expects.
 */
.woocommerce-checkout #payment ul.payment_methods li:only-child input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.woocommerce-checkout #payment .form-row.place-order {
	margin: var( --cr-space-lg ) 0 0;
	padding: 0;
}

.woocommerce-checkout #payment #place_order {
	inline-size: 100%;
	min-block-size: var( --cr-control-height );
	font-size: var( --cr-text-base );
}

.woocommerce-privacy-policy-text {
	margin-block-start: var( --cr-space-md );
	font-size: var( --cr-text-xs );
	color: var( --cr-text-muted );
}

/* --------------------------------------------------------------------------
 * Coupon form
 *
 * Sits above the checkout, beside the "Returning customer?" notice, and stays
 * collapsed until the shopper asks for it. These rules previously assumed it
 * was inside the order summary and gave both fields `inline-size: 100%`; see
 * the note in `inc/wc-cart.php` for why it is no longer there.
 * -------------------------------------------------------------------------- */

.checkout_coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var( --cr-space-md );
	padding: var( --cr-space-md );
	margin-block-end: var( --cr-space-md );
	border: 1px solid var( --cr-border );
	border-inline-start-width: 3px;
	border-inline-start-color: var( --cr-info );
	border-radius: var( --cr-radius-sm );
	background-color: var( --cr-surface );
}

.checkout_coupon > p {
	margin: 0;
}

/*
 * The intro paragraph takes the row to itself; the field and button then sit
 * together on the next line.
 */
.checkout_coupon > p:not( .form-row ) {
	flex: 1 0 100%;
	font-size: var( --cr-text-sm );
	color: var( --cr-text-muted );
}

/*
 * Overrides the 50/50 pair `.form-row-first` / `.form-row-last` would
 * otherwise give. A coupon code is a dozen characters; half of a 950px
 * checkout is an input you could write a paragraph in.
 */
.checkout_coupon .form-row-first,
.checkout_coupon .form-row-last {
	display: flex;
	inline-size: auto;
	margin-inline-end: 0;
}

.checkout_coupon .form-row-first {
	flex: 1 1 14rem;
	max-inline-size: 22rem;
}

.checkout_coupon .form-row-last {
	flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
 * Reassurance list
 * -------------------------------------------------------------------------- */

.cr-checkout-trust {
	margin: var( --cr-space-lg ) 0 0;
	padding: 0;
	list-style: none;
	font-size: var( --cr-text-xs );
	color: var( --cr-text-muted );
}

.cr-checkout-trust li {
	display: flex;
	align-items: flex-start;
	gap: var( --cr-space-xs );
}

.cr-checkout-trust li + li {
	margin-block-start: var( --cr-space-xs );
}

/* --------------------------------------------------------------------------
 * Order received
 * -------------------------------------------------------------------------- */

.cr-thankyou__head {
	text-align: center;
	margin-block-end: var( --cr-space-2xl );
}

.cr-thankyou__icon {
	inline-size: 2.5rem;
	block-size: 2.5rem;
	color: var( --cr-success );
}

.cr-thankyou__title {
	margin: var( --cr-space-sm ) 0;
}

.cr-thankyou__head .cr-lead {
	margin-inline: auto;
}

.cr-order-overview {
	display: grid;
	gap: var( --cr-space-md );
	grid-template-columns: repeat( auto-fit, minmax( min( 10rem, 100% ), 1fr ) );
	margin: 0 0 var( --cr-space-xl );
	padding: var( --cr-space-lg );
	list-style: none;
	background-color: var( --cr-surface );
	border: 1px solid var( --cr-border );
	border-radius: var( --cr-radius-sm );
}

.cr-order-overview li {
	display: flex;
	flex-direction: column;
	gap: var( --cr-space-3xs );
}

.cr-order-overview strong {
	font-size: var( --cr-text-md );
	font-weight: var( --cr-weight-medium );
}

.cr-thankyou__cod {
	margin-block-end: var( --cr-space-xl );
}

.cr-thankyou__whatsapp {
	margin-block-end: var( --cr-space-xl );
}

.cr-thankyou__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var( --cr-space-sm );
	margin-block-start: var( --cr-space-2xl );
}

/*
 * The button inside the WhatsApp notice sits close to the sentence explaining
 * it, rather than taking the large gap the standalone action row uses.
 */
.cr-thankyou__whatsapp .cr-thankyou__actions {
	margin-block-start: var( --cr-space-md );
}

.cr-thankyou__whatsapp p {
	margin-block: 0;
}

.woocommerce-order-details,
.woocommerce-customer-details {
	margin-block-start: var( --cr-space-2xl );
}

.woocommerce-order-details h2,
.woocommerce-customer-details h2 {
	margin-block-end: var( --cr-space-md );
	font-size: var( --cr-text-xl );
}

.woocommerce-customer-details address {
	padding: var( --cr-space-md );
	border: 1px solid var( --cr-border );
	border-radius: var( --cr-radius-sm );
	font-style: normal;
	font-size: var( --cr-text-sm );
	line-height: var( --cr-leading-relaxed );
}

/* --------------------------------------------------------------------------
 * "Have a code?" and the terms line
 *
 * Both replace things WooCommerce puts at the top of the checkout: the coupon
 * banner and the consent checkbox. See `cropped-core/includes/checkout-form.php`
 * for why they moved rather than simply going away.
 * -------------------------------------------------------------------------- */

.cr-checkout__coupon {
	padding-block: var( --cr-space-sm );
}

.cr-checkout__coupon-toggle {
	padding: 0;
	font-size: var( --cr-text-sm );
	color: var( --cr-text-muted );
	text-decoration: underline;
	text-underline-offset: 0.2em;
	background: none;
	border: 0;
	cursor: pointer;
	/* A 44px target without a 44px box: the link sits in a row of its own. */
	min-block-size: var( --cr-tap-target );
}

.cr-checkout__coupon-toggle:hover {
	color: var( --cr-text );
}

.cr-checkout__coupon-panel {
	margin-block-start: var( --cr-space-xs );
}

.cr-checkout__coupon-panel .form-row {
	display: flex;
	gap: var( --cr-space-xs );
	margin: 0;
}

.cr-checkout__coupon-panel .input-text {
	min-inline-size: 0;
	flex: 1;
}

/*
 * One line of terms under the order button, in place of two required tick
 * boxes. Small, but never grey-on-grey: it is the only statement of what
 * pressing the button commits to.
 */
.cr-checkout__terms {
	margin-block-start: var( --cr-space-sm );
	font-size: var( --cr-text-xs );
	line-height: 1.5;
	color: var( --cr-text-secondary );
	text-align: center;
}

.cr-checkout__terms a {
	color: inherit;
	text-underline-offset: 0.2em;
}
