/**
 * WooCommerce: the shared shop pieces in the theme style. Prices, badges, notices, the quantity
 * field, the add to cart form and the breadcrumbs. Block specific layout lives in
 * assets/css/blocks/woocommerce-*.css and only loads where that block is used.
 *
 * Loaded only with WooCommerce active. Selectors stay low, so a block setting in the editor wins.
 *
 * @package DeWittePrins\Theme
 * @since   0.1.0
 */

/* Prices: tabular figures; an old price in muted grey and struck through, the new one plain. */
:where(.price, .wc-block-components-product-price, .wc-block-formatted-money-amount) {
	font-variant-numeric: lining-nums tabular-nums;
}

:where(.price, .wc-block-components-product-price) del {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
	text-decoration-thickness: 1px;
}

:where(.price, .wc-block-components-product-price) ins {
	text-decoration: none;
}

/* Badges: a small label in the small corner, warm for a sale, soft for sold out. */
:where(.wc-block-components-product-sale-badge, .onsale) {
	display: inline-block;
	padding: 0.125rem 0.5rem;
	border: 0;
	border-radius: var(--wp--preset--border-radius--small);
	background: var(--wp--preset--color--warm);
	color: var(--wp--preset--color--warm-text);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	line-height: 1.6;
	text-transform: none;
}

:where(.wc-block-components-product-stock-indicator.wc-block-components-product-stock-indicator--out-of-stock, .stock.out-of-stock) {
	color: var(--wp--preset--color--muted);
	font-weight: 600;
}

/*
 * Notices (block and classic): the shape of the theme notices, a soft plane with a thin border
 * and a small corner. Success in the green tint, errors in the warm colour.
 */
:where(.wc-block-components-notice-banner, .woocommerce-message, .woocommerce-info, .woocommerce-error) {
	box-sizing: border-box;
	margin-block: 0 var(--wp--preset--spacing--50);
	padding: 0.875rem 1rem;
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--medium);
	background: var(--wp--preset--color--soft);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	list-style: none;
}

:where(.wc-block-components-notice-banner.is-success, .woocommerce-message) {
	border-color: var(--wp--custom--color--rim);
	background: var(--wp--preset--color--tint);
}

:where(.wc-block-components-notice-banner.is-error, .woocommerce-error) {
	border-color: color-mix(in srgb, var(--wp--preset--color--warm-text) 35%, transparent);
	background: var(--wp--preset--color--warm);
}

.wc-block-components-notice-banner.wc-block-components-notice-banner {
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--medium);
	background: var(--wp--preset--color--soft);
	color: var(--wp--preset--color--contrast);
}

.wc-block-components-notice-banner.wc-block-components-notice-banner.is-success {
	border-color: var(--wp--custom--color--rim);
	background: var(--wp--preset--color--tint);
}

.wc-block-components-notice-banner.wc-block-components-notice-banner.is-error {
	border-color: color-mix(in srgb, var(--wp--preset--color--warm-text) 35%, transparent);
	background: var(--wp--preset--color--warm);
}

/* WooCommerce focuses a new notice so screen readers read it; it is not interactive, so no ring. */
.wc-block-components-notice-banner.wc-block-components-notice-banner:focus {
	outline: none;
}

.wc-block-components-notice-banner .wc-forward.wc-forward {
	color: var(--wp--custom--color--link) !important; /* WooCommerce sets a dark grey with !important, unreadable in dark. */
	opacity: 1;
}

.wc-block-components-notice-banner > svg {
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent);
	fill: var(--wp--custom--color--on-accent);
}

.wc-block-components-notice-banner.is-error > svg {
	background-color: var(--wp--preset--color--warm-text);
}

:where(.wc-block-components-notice-banner, .woocommerce-message, .woocommerce-info) a {
	color: var(--wp--custom--color--link);
	font-weight: 600;
}

/* The "view cart" link inside a notice is a link, not a second button. */
.woocommerce-message .button.wc-forward {
	float: none;
	margin-inline-start: 0.5rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--custom--color--link);
	text-decoration: underline;
}

/* Quantity: a narrow field with the number in the middle. */
:where(.quantity) .qty {
	inline-size: 4.5rem;
	text-align: center;
}

/* Add to cart form: quantity and button on one line, choices above it as a calm list. */
:where(.wp-block-woocommerce-add-to-cart-form) form.cart:not(.variations_form),
:where(.wp-block-woocommerce-add-to-cart-form) .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: var(--wp--preset--spacing--30);
}

:where(.wp-block-woocommerce-add-to-cart-form) .quantity {
	display: flex;
}

:where(.wp-block-woocommerce-add-to-cart-form) .single_add_to_cart_button {
	flex: 1 1 12rem;
	min-block-size: 3.25rem;
}

:where(.wp-block-woocommerce-add-to-cart-form) table.variations {
	inline-size: 100%;
	margin-block-end: var(--wp--preset--spacing--40);
	border: 0;
	border-collapse: collapse;
}

:where(.wp-block-woocommerce-add-to-cart-form) table.variations :is(th, td) {
	display: block;
	padding: 0;
	border: 0;
	text-align: start;
}

:where(.wp-block-woocommerce-add-to-cart-form) table.variations th {
	padding-block-end: 0.375rem;
}

:where(.wp-block-woocommerce-add-to-cart-form) .reset_variations {
	display: inline-block;
	margin-block-start: 0.5rem;
	font-size: var(--wp--preset--font-size--small);
}

:where(.wp-block-woocommerce-add-to-cart-form) .woocommerce-variation-price {
	margin-block-end: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

/* Breadcrumbs: the same quiet line as the Yoast breadcrumbs above an article. */
.woocommerce-breadcrumb {
	margin-block-end: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

.woocommerce-breadcrumb a {
	color: inherit;
	text-decoration-color: var(--wp--custom--color--line-strong);
}

/* Sorting and result count: one quiet row. */
.wp-block-woocommerce-product-results-count {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-woocommerce-catalog-sorting select {
	inline-size: auto;
	min-block-size: 2.75rem;
	font-size: var(--wp--preset--font-size--small);
}

/*
 * Cart and checkout blocks (and the mini cart): the components WooCommerce draws itself, in the
 * same shapes as the theme fields and buttons. One solid button per step; fields 1.5px with the
 * accent focus ring; errors in the warm colour.
 */
/* Doubled classes: WooCommerce styles its form fields at (0,3,1). */
.wc-block-components-text-input.wc-block-components-text-input input:is([type="text"], [type="email"], [type="tel"], [type="number"], [type="password"], [type="url"]),
.wc-block-components-textarea.wc-block-components-textarea,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input {
	border: 1.5px solid var(--wp--custom--color--line-strong);
	border-radius: var(--wp--preset--border-radius--medium);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

.wc-block-components-text-input.wc-block-components-text-input input:focus,
.wc-block-components-textarea.wc-block-components-textarea:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px var(--wp--custom--color--ring);
	outline: 3px solid transparent; /* Shows as the focus ring in forced colours, where box-shadow is dropped. */
}

.wc-block-components-text-input label,
.wc-blocks-components-select .wc-blocks-components-select__label {
	color: var(--wp--preset--color--muted);
}

.wc-block-components-text-input.wc-block-components-text-input.has-error input,
.wc-blocks-components-select.has-error .wc-blocks-components-select__select {
	border-color: var(--wp--preset--color--warm-text);
}

.wc-block-components-validation-error,
.wc-block-components-form .wc-block-components-text-input.wc-block-components-text-input.has-error label,
.has-error .wc-blocks-components-select .wc-blocks-components-select__label.wc-blocks-components-select__label,
.wc-block-gateway-container .wc-block-gateway-input.has-error + label.wc-block-gateway-label {
	color: var(--wp--preset--color--warm-text);
}

/* Buttons: the main action solid, links stay links. */
.wc-block-components-button:not(.is-link).wp-element-button,
.wc-block-components-button:not(.is-link).contained {
	min-block-size: 3.25rem;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--preset--border-radius--medium);
	background: var(--wp--preset--color--accent);
	color: var(--wp--custom--color--on-accent);
	font-weight: 700;
}

.wc-block-components-button:not(.is-link).wp-element-button:hover,
.wc-block-components-button:not(.is-link).wp-element-button:focus-visible {
	border-color: var(--wp--custom--color--link);
	background: var(--wp--custom--color--link);
	color: var(--wp--custom--color--on-accent);
}

.wc-block-components-button.outlined {
	border: 1px solid var(--wp--custom--color--rim);
	border-radius: var(--wp--preset--border-radius--medium);
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--accent);
}

/* Checkboxes and radios in the theme colours. */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
.wc-block-components-radio-control .wc-block-components-radio-control__input {
	border: 1.5px solid var(--wp--custom--color--line-strong);
	background-color: var(--wp--preset--color--surface);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
	border-radius: var(--wp--preset--border-radius--small);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	border-color: var(--wp--preset--color--accent);
	background-color: var(--wp--preset--color--accent);
}

.wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: var(--wp--custom--color--on-accent);
}

.wc-block-components-radio-control .wc-block-components-radio-control__input:checked {
	border-color: var(--wp--preset--color--accent);
}

.wc-block-components-radio-control .wc-block-components-radio-control__input:checked::before {
	background: var(--wp--preset--color--accent);
}

/* Choices of payment and delivery: calm boxes with the theme corner. */
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option {
	border-radius: var(--wp--preset--border-radius--medium);
}

.wc-block-components-radio-control--highlight-checked::after,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option--checked-option-highlighted {
	border-radius: var(--wp--preset--border-radius--medium);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--accent);
}

/* Quantity, product names and the remove link in the cart. */
.wc-block-components-quantity-selector {
	border-radius: var(--wp--preset--border-radius--medium);
}

.wc-block-components-quantity-selector::after {
	border-color: var(--wp--custom--color--line-strong);
	border-radius: var(--wp--preset--border-radius--medium);
}

.wc-block-components-product-name {
	color: var(--wp--custom--color--heading);
	font-weight: 600;
	text-decoration: none;
}

.wc-block-cart-item__remove-link {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

/* Lines between totals and rows: the theme hairline. */
.wc-block-components-totals-wrapper,
.wc-block-cart-items,
.wc-block-cart-items__row,
.wc-block-components-order-summary-item,
.wc-block-components-panel {
	border-color: var(--wp--custom--color--line);
}

.wc-block-components-totals-item__label,
.wc-block-components-product-metadata {
	color: var(--wp--preset--color--muted);
}

.wc-block-components-totals-footer-item {
	font-size: var(--wp--preset--font-size--large);
}

/* Checkout steps: the heading of each step as a quiet h2. */
.wc-block-components-checkout-step__title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

.wc-block-components-checkout-step__description {
	color: var(--wp--preset--color--muted);
}

/* Cart and checkout pages: the page title as the start of the flow, the summary column as a calm card. */
.shop-flow .shop-flow__title {
	margin-block-end: var(--wp--preset--spacing--50);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 300;
	color: var(--wp--custom--color--heading);
}

/* Summary column: a card in the surface colour, like the buy box on a product page. */
.wc-block-cart .wc-block-cart__sidebar,
.wc-block-checkout .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	box-sizing: border-box;
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--large);
	background: var(--wp--preset--color--surface);
}

.wc-block-cart .wc-block-cart__sidebar {
	padding: var(--wp--preset--spacing--40);
}

.wc-block-cart .wc-block-cart__sidebar > * {
	border: 0;
}

.wc-block-cart .wc-block-cart__submit-container {
	padding-block-start: var(--wp--preset--spacing--30);
}

.wc-block-cart .wc-block-cart__submit-button {
	inline-size: 100%;
}

/*
 * The button that stays at the bottom of a phone screen: WooCommerce gives it a wide grey halo that
 * covers a band of the cart above it and turns into a black haze in dark. A thin line and a short
 * soft shadow (none in dark, where black looks foreign) set it apart without hiding the text.
 */
.wc-block-cart .wc-block-cart__submit-container--sticky {
	background-color: var(--wp--preset--color--base);
}

.wc-block-cart .wc-block-cart__submit-container--sticky::before {
	border-block-start: 1px solid var(--wp--custom--color--line);
	box-shadow: 0 -0.25rem 0.5rem -0.25rem light-dark(rgba(0, 0, 0, 0.12), transparent);
	color: inherit;
	pointer-events: none;
}

/* Empty cart: the heading Woo puts there in the theme heading style. */
.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 360;
}

.wc-block-components-sale-badge {
	border: 0;
	border-radius: var(--wp--preset--border-radius--small);
	background: var(--wp--preset--color--warm);
	color: var(--wp--preset--color--warm-text);
	font-weight: 700;
}

/* The container around a WooCommerce select draws its own light edge; the select carries the border. */
.wc-blocks-components-select .wc-blocks-components-select__container {
	border: 0;
	border-radius: var(--wp--preset--border-radius--medium);
	background: transparent;
	box-shadow: none;
}

.wc-blocks-components-select .wc-blocks-components-select__expand {
	fill: var(--wp--preset--color--muted);
}

/*
 * My account (classic WooCommerce markup in the page content): the menu as a calm list on the left
 * from 60rem, as a wrapping row of quiet buttons on a phone; the page gets the wide size.
 */
.entry-content > .woocommerce:has(> .woocommerce-MyAccount-navigation) {
	display: grid;
	gap: var(--wp--preset--spacing--50);
	max-inline-size: var(--wp--style--global--wide-size);
}

@media (min-width: 60rem) {
	.entry-content > .woocommerce:has(> .woocommerce-MyAccount-navigation) {
		grid-template-columns: 14rem minmax(0, 1fr);
		gap: var(--wp--preset--spacing--60);
		align-items: start;
	}
}

/* WooCommerce's clearfix pseudo-elements would become grid items and push the menu aside. */
.entry-content > .woocommerce:has(> .woocommerce-MyAccount-navigation)::before,
.entry-content > .woocommerce:has(> .woocommerce-MyAccount-navigation)::after {
	display: none;
}

.entry-content > .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-notices-wrapper {
	grid-column: 1 / -1;
}

.entry-content > .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-notices-wrapper:empty {
	display: none;
}

.woocommerce-MyAccount-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-MyAccount-navigation li {
	margin: 0;
}

.woocommerce-MyAccount-navigation a {
	display: flex;
	align-items: center;
	min-block-size: 2.5rem;
	padding-inline: 0.875rem;
	border: 1px solid var(--wp--custom--color--rim);
	border-radius: var(--wp--preset--border-radius--medium);
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
}

.woocommerce-MyAccount-navigation .is-active a {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--custom--color--on-accent);
}

@media (min-width: 60rem) {
	.woocommerce-MyAccount-navigation ul {
		flex-direction: column;
		gap: 0;
		border-block-start: 1px solid var(--wp--custom--color--line);
	}

	.woocommerce-MyAccount-navigation a {
		min-block-size: 2.75rem;
		padding-inline: 0.75rem;
		border: 0;
		border-block-end: 1px solid var(--wp--custom--color--line);
		border-radius: 0;
		background: none;
		font-size: var(--wp--preset--font-size--medium);
	}

	.woocommerce-MyAccount-navigation a:hover,
	.woocommerce-MyAccount-navigation a:focus-visible {
		background: var(--wp--preset--color--soft);
	}

	.woocommerce-MyAccount-navigation .is-active a {
		border-color: var(--wp--custom--color--line);
		background: var(--wp--preset--color--tint);
		color: var(--wp--preset--color--accent);
		box-shadow: inset 3px 0 0 var(--wp--preset--color--accent);
	}
}

.woocommerce-MyAccount-content > :first-child {
	margin-block-start: 0;
}

/* Tables: orders, downloads, subscriptions and order details as calm rows between hairlines. */
:where(.woocommerce) table.shop_table {
	inline-size: 100%;
	border: 0;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}

:where(.woocommerce) table.shop_table :is(th, td) {
	padding: 0.75rem 0.5rem;
	border: 0;
	border-block-end: 1px solid var(--wp--custom--color--line);
	text-align: start;
	vertical-align: middle;
}

:where(.woocommerce) table.shop_table thead th {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

:where(.woocommerce) table.shop_table .woocommerce-button,
:where(.woocommerce) .woocommerce-Address .edit {
	display: inline-flex;
	align-items: center;
	min-block-size: 2.25rem;
	margin: 0.125rem 0.25rem 0.125rem 0;
	padding: 0 0.75rem;
	border: 1px solid var(--wp--custom--color--rim);
	border-radius: var(--wp--preset--border-radius--small);
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	text-decoration: none;
}

/* Remove cross in the classic cart: larger than the WooCommerce default (1.5em), so it is easy to see and hit. */
.woocommerce table.shop_table a.remove {
	font-size: 2.5em;
}

/*
 * Variation choice on a product: WooCommerce draws its own black arrow, which disappears in dark.
 * Back to the browser's own select, like every other select on the site; its arrow follows the colour scheme.
 */
.woocommerce div.product form.cart .variations.variations select {
	padding-inline-end: 0.875rem;
	background-image: none;
	appearance: auto;
}

/* Phone: each table row becomes a small block with the column name before the value. */
@media (max-width: 47.99rem) {
	:where(.woocommerce) table.shop_table_responsive thead {
		display: none;
	}

	:where(.woocommerce) table.shop_table_responsive :is(tbody, tr, td) {
		display: block;
	}

	:where(.woocommerce) table.shop_table_responsive tr {
		padding-block: 0.5rem;
		border-block-end: 1px solid var(--wp--custom--color--line);
	}

	:where(.woocommerce) table.shop_table_responsive td {
		display: flex;
		justify-content: space-between;
		gap: var(--wp--preset--spacing--30);
		padding: 0.25rem 0;
		border: 0;
		text-align: end;
	}

	:where(.woocommerce) table.shop_table_responsive td::before {
		color: var(--wp--preset--color--muted);
		font-weight: 600;
		text-align: start;
		content: attr(data-title);
	}
}

/* Addresses: two cards side by side when there is room. */
:where(.woocommerce) .woocommerce-Addresses {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: var(--wp--preset--spacing--40);
}

:where(.woocommerce) .woocommerce-Address {
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--large);
	background: var(--wp--preset--color--surface);
}

:where(.woocommerce) .woocommerce-Address-title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20);
}

:where(.woocommerce) .woocommerce-Address-title h2 {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

/* Login and register: one or two calm cards, never full width on a wide screen. */
:where(.woocommerce) :is(.woocommerce-form-login, .woocommerce-form-register, .woocommerce-ResetPassword) {
	max-inline-size: 28rem;
	padding: var(--wp--preset--spacing--50);
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--large);
	background: var(--wp--preset--color--surface);
}

:where(.woocommerce) .form-row {
	margin-block: 0 var(--wp--preset--spacing--40);
}

:where(.woocommerce) .form-row label {
	display: block;
	margin-block-end: 0.375rem;
}

:where(.woocommerce) .form-row .required {
	color: var(--wp--preset--color--warm-text);
	text-decoration: none;
}

:where(.woocommerce) .woocommerce-form-login__rememberme {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-block-end: var(--wp--preset--spacing--30);
	font-weight: 400;
}

:where(.woocommerce) .lost_password {
	font-size: var(--wp--preset--font-size--small);
}

:where(.woocommerce) .u-columns.col2-set {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	gap: var(--wp--preset--spacing--50);
}

/* Order confirmation: the facts as small labels, the order and addresses in calm boxes. */
.wc-block-order-confirmation-summary-list-item__key {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.wc-block-order-confirmation-totals table.wc-block-order-confirmation-totals__table,
.wc-block-order-confirmation-address-wrapper address,
.wc-block-order-confirmation-downloads table {
	border: 1px solid var(--wp--custom--color--line);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: var(--wp--preset--border-radius--large);
	background: var(--wp--preset--color--surface);
}

.wc-block-order-confirmation-totals table.wc-block-order-confirmation-totals__table :is(th, td) {
	border-color: var(--wp--custom--color--line);
}

.wc-block-order-confirmation-totals table.wc-block-order-confirmation-totals__table tr:last-child :is(th, td) {
	border-block-end: 0;
}

.wc-block-order-confirmation-totals__table a,
.woocommerce-table--order-details a {
	color: var(--wp--custom--color--heading);
	font-weight: 600;
	text-decoration: none;
}

/*
 * Mini-cart drawer: a quiet close icon, a compact quantity control, and two buttons of normal height
 * at the bottom: the cart as the open button, checkout as the one solid action.
 */
.wc-block-mini-cart__drawer .wc-block-components-button.wc-block-components-drawer__close {
	box-sizing: border-box;
	display: grid;
	place-items: center;
	min-block-size: 2.75rem;
	min-inline-size: 2.75rem;
	margin: 0;
	border: 0;
	border-radius: var(--wp--preset--border-radius--medium);
	padding: 0 !important; /* WooCommerce sets an !important padding of 1em. */
	inset-block-start: var(--wp--preset--spacing--20);
	inset-inline-end: var(--wp--preset--spacing--20);
}

.wc-block-mini-cart__drawer .wc-block-components-button.wc-block-components-drawer__close:focus-visible {
	outline: 3px solid var(--wp--custom--color--ring);
	outline-offset: 0;
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__title {
	padding-inline-end: 3.5rem;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 360;
	color: var(--wp--custom--color--heading);
}

.wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-title-items-counter-block {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--medium);
}

.wc-block-mini-cart__drawer .wc-block-cart-item__image img {
	border-radius: var(--wp--preset--border-radius--small);
}

.wc-block-mini-cart__drawer .wc-block-components-quantity-selector.wc-block-components-quantity-selector {
	min-inline-size: 7rem;
	block-size: 2.5rem;
	border: 1px solid var(--wp--custom--color--line-strong);
	border-radius: var(--wp--preset--border-radius--medium);
}

.wc-block-mini-cart__drawer .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	min-block-size: 0;
	block-size: 100%;
	padding: 0;
	font-size: var(--wp--preset--font-size--small);
}

.wc-block-mini-cart__drawer .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	min-inline-size: 2.25rem;
	font-size: 1rem;
}

.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link {
	color: var(--wp--preset--color--muted);
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__footer {
	border-block-start: 1px solid var(--wp--custom--color--line);
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions {
	gap: var(--wp--preset--spacing--20);
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions .wc-block-components-button.wp-element-button {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-block-size: 3rem;
	padding: 0.625rem 1rem;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.2;
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions .wc-block-components-button.wp-element-button.is-style-outline {
	border-color: var(--wp--custom--color--rim);
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--accent);
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions .wc-block-components-button.wp-element-button.is-style-outline:hover,
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions .wc-block-components-button.wp-element-button.is-style-outline:focus-visible {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--custom--color--on-accent);
}

@media (prefers-reduced-motion: no-preference) {

	.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions .wc-block-components-button.wp-element-button {
		transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	}
}

/*
 * Order summary at checkout on a phone: one card that folds open, without WooCommerce's extra lines
 * above and below the title, the title off the card edge, and a short line under it that says what
 * a tap does (the words come translated from the theme, see Assets::add_shop_labels()).
 */
@container (max-width: 919px) {

	.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title {
		flex-wrap: wrap;
		row-gap: 0.125rem;
		border: 0;
		border-radius: var(--wp--preset--border-radius--large);
		padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	}

	.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title .wc-block-components-checkout-order-summary__title-text {
		margin: 0;
		font-size: var(--wp--preset--font-size--large);
		font-weight: 600;
	}

	.wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title-icon {
		margin-inline-start: 0.25rem;
	}

	.wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title::after {
		content: var(--de-witte-prins--summary-show) / "";
		flex-basis: 100%;
		color: var(--wp--preset--color--accent);
		font-size: var(--wp--preset--font-size--small);
		text-decoration: underline;
		text-decoration-thickness: 1px;
		text-underline-offset: 3px;
	}

	.wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title[aria-expanded="true"]::after {
		content: var(--de-witte-prins--summary-hide) / "";
	}

	.wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title:focus-visible {
		outline: 3px solid var(--wp--custom--color--ring);
		outline-offset: 2px;
	}

	.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__content.is-open {
		border-block: 1px solid var(--wp--custom--color--line);
		border-block-end: 0;
		padding-inline: var(--wp--preset--spacing--40);
	}
}

/*
 * Quantity field of the classic cart and product form: room for the number next to the spin buttons,
 * and lining figures, because the old-style "1" of Raleway is as small as a lowercase letter.
 */
.quantity input.qty.qty.qty { /* WooCommerce sizes it down with a strong selector of its own. */
	min-inline-size: 4.5rem;
	padding-inline: 0.5rem 0.25rem;
	font-size: 1rem;
	font-variant-numeric: lining-nums tabular-nums;
}

/*
 * Classic cart and checkout: the [woocommerce_cart] and [woocommerce_checkout] shortcodes, still in use
 * where plugins add checkout fields that the checkout block does not show (tinekevanurk.nl: VAT number,
 * location and the newsletter box). The same look as the blocks: theme boxes, theme colours, and the
 * order button as the one solid action.
 */

/* WooCommerce sets checkboxes in a form row inline, which drops the size of the box the theme draws. */
.woocommerce form .form-row :is(input[type="checkbox"], input[type="radio"]) {
	display: inline-grid;
}

.woocommerce-checkout #payment.woocommerce-checkout-payment {
	border: 1px solid var(--wp--custom--color--line);
	border-radius: var(--wp--preset--border-radius--large);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

.woocommerce-checkout #payment ul.payment_methods.payment_methods {
	border-block-end-color: var(--wp--custom--color--line);
}

.woocommerce-checkout #payment div.payment_box.payment_box {
	border-radius: var(--wp--preset--border-radius--medium);
	background-color: var(--wp--preset--color--soft);
	color: var(--wp--preset--color--contrast);
}

.woocommerce-checkout #payment div.payment_box.payment_box::before {
	border-block-end-color: var(--wp--preset--color--soft);
}

.woocommerce :is(#place_order, .wc-proceed-to-checkout .checkout-button).wp-element-button,
.woocommerce :is(#place_order, .wc-proceed-to-checkout .checkout-button).button {
	border: 1px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent);
	color: var(--wp--custom--color--on-accent);
}

.woocommerce :is(#place_order, .wc-proceed-to-checkout .checkout-button).button:is(:hover, :focus-visible) {
	border-color: var(--wp--custom--color--link);
	background: var(--wp--custom--color--link);
	color: var(--wp--custom--color--on-accent);
}
