.fdm-commerce {
	--wp--style--global--wide-size: 1250px;
	--fdm-commerce-text: var(--wp--preset--color--text);
	--fdm-commerce-brand: var(--wp--preset--color--brand);
	--fdm-commerce-border: var(--wp--preset--color--border);
	--fdm-commerce-surface: var(--wp--preset--color--surface);
	--fdm-summary-inset: var(--wp--preset--spacing--large, 24px);
	--fdm-summary-group-gap: 22px;
	--fdm-summary-row-gap: var(--wp--preset--spacing--small, 8px);
	box-sizing: border-box;
	padding: 42px 16px 72px;
	color: var(--fdm-commerce-text);
	font: 400 15px/1.35 var(--fdm-body);
}

.fdm-commerce > .fdm-commerce__title {
	margin-block: 30px;
	font: 600 42px/1.35 var(--fdm-editorial);
}

.fdm-commerce > .fdm-commerce__navigation {
	margin-block-start: 0;
}

.fdm-commerce__navigation a {
	color: var(--wp--preset--color--hover);
	font: 600 14px/1.35 var(--fdm-body);
	text-decoration: none;
}

.fdm-commerce__navigation a:is(:hover, :focus-visible) {
	text-decoration: underline;
}

.fdm-commerce > .wp-block-woocommerce-store-notices:empty {
	display: none;
}

.fdm-commerce > .wp-block-post-content {
	margin-block: 0;
}

.fdm-header__actions .fdm-commerce-cart-link a {
	display: grid;
	place-items: center;
	min-width: var(--fdm-target);
	min-height: var(--fdm-target);
	color: var(--wp--preset--color--text);
	border-radius: 50%;
}

.fdm-commerce-cart-link .wc-block-mini-cart__icon,
.fdm-commerce-cart-link .wc-block-cart-link__text:empty {
	display: none;
}

.fdm-commerce-cart-link a::before {
	content: "";
	width: var(--fdm-header-action-glyph);
	height: var(--fdm-header-action-glyph);
	background: currentcolor;
	mask: url(../icons/cart.svg) center / contain no-repeat;
}

.fdm-commerce-cart-link a:hover {
	background: var(--wp--preset--color--surface);
}

.fdm-has-empty-checkout .fdm-commerce {
	padding-block: 38px 60px;
}

.fdm-has-empty-checkout .fdm-commerce__title {
	margin-block: 0 26px;
	font-size: 48px;
	line-height: 57px;
}

.fdm-empty-checkout {
	display: grid;
	gap: 15px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	padding: 24px 25px 23px;
}

.fdm-empty-checkout strong {
	font: 600 18px/24px var(--fdm-body);
}

.fdm-empty-checkout p {
	margin: 0;
	font: 400 16px/22px var(--fdm-body);
}

/* Keep cart and checkout component overrides in order. */
/* stylelint-disable-next-line no-descending-specificity */
.fdm-empty-checkout a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.fdm-commerce .wc-block-components-sidebar-layout {
	column-gap: min(4.8vw, 60px);
	margin-block-end: 0;
}

.fdm-commerce .wc-block-components-sidebar-layout > :is(.wc-block-components-main, .wc-block-components-sidebar) {
	padding: 0;
}

.fdm-commerce :is(.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout) {
	color: inherit;
	font-family: var(--fdm-body);
}

.fdm-commerce .wc-block-components-sidebar-layout > .wc-block-components-sidebar {
	box-sizing: border-box;
	border-radius: 8px;
	background: var(--fdm-commerce-surface);
	padding: 20px;
	align-self: start;
}

.fdm-commerce :is(.wc-block-components-title, .wc-block-components-checkout-step__title, .wc-block-cart__totals-title, .wc-block-components-checkout-order-summary__title-text) {
	color: inherit;
	font: 600 20px/1.35 var(--fdm-editorial);
	text-transform: none;
}

.fdm-commerce .wc-block-checkout__sidebar :is(.wp-block-woocommerce-checkout-order-summary-block, .checkout-order-summary-block-fill) {
	border: 0;
}

.fdm-commerce .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title {
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
}

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

.fdm-commerce .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title-text {
	margin: 0;
	font: 600 20px/1.35 var(--fdm-editorial);
}

.fdm-commerce :is(.wc-block-components-totals-item__value, .wc-block-components-totals-footer-item, .wc-block-components-product-name, .wc-block-components-order-summary-item__total-price) {
	color: inherit;
	font-weight: 600;
}

.fdm-commerce :is(.wp-block-button__link, .wc-block-components-button:not(.is-link)) {
	box-sizing: border-box;
	min-block-size: 46px;
	border-radius: 24px;
	font: 600 14px/20px var(--fdm-body);
}

.fdm-commerce :is(.wc-block-cart__submit-button, .wc-block-components-checkout-place-order-button):not(:disabled) {
	background: var(--fdm-commerce-brand);
	color: var(--wp--preset--color--on-brand);
}

.fdm-commerce :is(.wc-block-cart__submit-button, .wc-block-components-checkout-place-order-button):not(:disabled):hover {
	background: var(--wp--preset--color--hover);
}

.fdm-commerce .wc-block-cart-items__header {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.fdm-commerce .wc-block-components-product-metadata {
	color: var(--wp--preset--color--muted);
	font-size: 14px;
}

.fdm-commerce .wc-block-components-quantity-selector {
	gap: 4px;
	width: auto;
	min-width: 98px;
	margin: 0;
	border: 0;
}

.fdm-commerce .wc-block-components-quantity-selector::after {
	content: none;
}

.fdm-commerce .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
	box-sizing: content-box;
	width: 2.25ch;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	font: 600 16px/1.35 var(--fdm-body);
}

.fdm-commerce .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	flex: 0 0 40px;
	height: 40px;
	border: 1px solid var(--fdm-commerce-border);
	border-radius: 50%;
	background: var(--wp--preset--color--canvas);
	color: var(--wp--preset--color--hover);
	font: 600 16px/1 var(--fdm-body);
}

.fdm-commerce .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled {
	color: var(--wp--preset--color--disabled-text);
}

.fdm-commerce :is(.wc-block-components-quantity-selector__button, .wc-block-cart-item__remove-link):focus-visible {
	outline: 2px solid var(--wp--preset--color--focus);
	outline-offset: 2px;
}

.fdm-commerce .wc-block-components-text-input :is(input, input[type="tel"]) {
	min-height: 48px;
	border-color: var(--wp--preset--color--field-border);
	border-radius: 5px;
	background: var(--wp--preset--color--canvas);
	color: var(--fdm-commerce-text);
	font-family: var(--fdm-body);
}

.fdm-commerce .wc-block-components-text-input:not(.has-error) input:focus {
	border-color: var(--fdm-commerce-brand);
}

.fdm-commerce .wc-block-components-text-input input[type]:focus {
	background-color: var(--wp--preset--color--canvas);
	color: var(--fdm-commerce-text);
}

.fdm-commerce .wc-block-components-text-input.has-error input[type] {
	border-color: var(--wp--preset--color--error);
}

.fdm-commerce .wc-block-components-text-input label {
	font-family: var(--fdm-body);
	font-weight: 600;
}

.fdm-commerce .wc-block-components-text-input.has-error label,
.fdm-commerce .wc-block-components-validation-error {
	color: var(--wp--preset--color--error);
}

.fdm-commerce .wc-blocks-components-select .wc-blocks-components-select__container {
	background-color: var(--wp--preset--color--canvas);
	color: var(--fdm-commerce-text);
}

.fdm-commerce :where(.has-error) .wc-blocks-components-select .wc-blocks-components-select__container {
	color: var(--wp--preset--color--error);
}

.fdm-commerce .wc-blocks-components-select :is(.wc-blocks-components-select__select, .wc-blocks-components-select__label) {
	color: inherit;
}

.fdm-commerce .wc-blocks-components-select .wc-blocks-components-select__expand {
	fill: currentcolor;
}

.fdm-commerce .wc-block-components-radio-control__input {
	border-color: var(--fdm-commerce-brand);
}

.fdm-commerce .wc-block-components-radio-control__input:checked::before {
	background: var(--fdm-commerce-brand);
}

.fdm-commerce .wc-block-components-radio-control__option {
	border-radius: 8px;
	color: var(--fdm-commerce-text);
}

.fdm-commerce :is(.wc-block-components-radio-control__label, .wc-block-checkout__shipping-method-option-title) {
	font: 600 15px/1.35 var(--fdm-body);
}

.fdm-commerce .wc-block-components-radio-control__description {
	color: var(--wp--preset--color--muted);
	font: 400 14px/1.35 var(--fdm-body);
}

.fdm-commerce :is(.wc-block-components-radio-control__option-checked, .wc-block-checkout__shipping-method-option--selected) {
	background: var(--fdm-commerce-surface);
}

.fdm-commerce .wc-block-checkout__shipping-option .wc-block-components-shipping-rates-control__no-shipping-address-message {
	color: var(--wp--preset--color--muted);
}

.fdm-commerce .wc-block-checkout__shipping-method .wc-block-checkout__shipping-method-container {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
	padding: 0;
	background: transparent;
}

.fdm-commerce .wc-block-checkout__shipping-method-container .wc-block-checkout__shipping-method-option--selected {
	border-color: var(--fdm-commerce-brand);
	background: var(--fdm-commerce-surface);
}

.fdm-commerce .wc-block-checkout__shipping-method-option:focus-visible {
	outline: 2px solid var(--wp--preset--color--focus);
	outline-offset: 2px;
}

.fdm-commerce .wc-block-checkout__shipping-method-option-title,
.fdm-commerce .wp-block-woocommerce-checkout-payment-block .wc-block-components-radio-control__label {
	min-inline-size: 0;
	overflow-wrap: anywhere;
}

.fdm-commerce .wc-block-checkout__shipping-method-option-price {
	flex-basis: auto;
	margin-inline-start: auto;
}

.fdm-commerce .wc-block-components-radio-control-accordion-option {
	border-radius: 8px;
}

.fdm-commerce .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	background: var(--fdm-commerce-surface);
}

/* Scope the layout to Woo's own method rows: a gateway may render more
   radio controls or brand images inside its payment form. */
.fdm-commerce .wp-block-woocommerce-checkout-payment-block > .wc-block-components-checkout-step__content > .wc-block-components-radio-control {
	display: grid;
	gap: 14px;

	&::after,
	& > .wc-block-components-radio-control-accordion-option::after {
		display: none;
	}

	& > .wc-block-components-radio-control-accordion-option {
		--fdm-payment-text-inset: 42px;
		position: relative;
		border: 1px solid var(--fdm-commerce-border);
		border-radius: 8px;
		box-shadow: none;

		&:has(> label > input:checked) {
			border-color: var(--fdm-commerce-brand);
		}

		& > .wc-block-components-radio-control__option {
			position: relative;
			display: flex;
			align-items: center;
			box-sizing: border-box;
			min-block-size: 46px;
			padding-block: 12px;
			padding-inline: var(--fdm-payment-text-inset) 14px;

			& > .wc-block-components-radio-control__option-layout,
			& .wc-block-components-radio-control__label-group {
				min-inline-size: 0;
				inline-size: 100%;
			}

			& > .wc-block-components-radio-control__input {
				inset-inline-start: 14px;
				transform: translateY(-50%);
				box-sizing: border-box;
				inline-size: 16px;
				block-size: 16px;
				min-inline-size: 0;
				min-block-size: 0;
				border: 1px solid var(--fdm-commerce-brand);

				&:checked {
					background: var(--fdm-commerce-brand);
				}

				&:focus:not(:focus-visible) {
					outline: none;
				}

				&:focus-visible {
					outline: 2px solid var(--wp--preset--color--focus);
					outline-offset: 2px;
				}
			}

			& .wc-block-components-radio-control__label {
				line-height: 20px;
			}

			& .wc-block-components-radio-control__label:has(> :is(.wc-block-components-payment-method-icons, img:only-of-type, svg:only-of-type)),
			& .wc-block-components-payment-method-label--with-icon:has(> :is(img, svg)) {
				display: flex;
				flex: 1 1 auto;
				flex-wrap: wrap;
				align-items: center;
				justify-content: space-between;
				gap: 4px 8px;
				min-inline-size: 0;
				overflow-wrap: anywhere;
			}

			& .wc-block-components-radio-control__label > .wc-block-components-payment-method-icons {
				align-items: center;
				justify-content: flex-end;
				flex: none;
				gap: 4px 8px;
				max-inline-size: 100%;
				margin: 0;
			}

			& .wc-block-components-payment-method-icons > .wc-block-components-payment-method-icon,
			& .wc-block-components-radio-control__label > :is(img:only-of-type, svg:only-of-type),
			& .wc-block-components-payment-method-label--with-icon > :is(img, svg) {
				order: 1;
				display: block;
				block-size: 20px;
				max-block-size: 20px;
				inline-size: auto;
				max-inline-size: 100%;
				margin: 0;
				object-fit: contain;
			}

			& .wc-block-components-payment-method-icons > img.wc-block-components-payment-method-icon {
				box-sizing: border-box;
				padding: 3px 5px;
				border: 1px solid var(--fdm-commerce-border);
				border-radius: 2px;
				background-color: var(--wp--preset--color--canvas);
			}

			&:has(> input[value="bacs"]) .wc-block-components-radio-control__label {
				display: flex;
				align-items: center;
				justify-content: space-between;
				gap: 8px;
				inline-size: 100%;
			}

			&:has(> input[value="bacs"]) .wc-block-components-radio-control__label::after {
				content: "";
				flex: 0 0 20px;
				block-size: 20px;
				background: currentcolor;
				mask: url(../icons/bank-transfer.svg) no-repeat center / contain;
			}
		}

		&:has(input[value="bacs"]) > .wc-block-components-radio-control-accordion-content {
			padding-block: 0 12px;
			padding-inline: var(--fdm-payment-text-inset) 14px;
			color: var(--wp--preset--color--muted);
			font: 400 14px/19px var(--fdm-body);
		}
	}
}

.woocommerce-order-received .wp-site-blocks > main {
	padding: 42px 16px 72px;
}

.woocommerce-order-received :is(.wp-block-woocommerce-order-confirmation-status, .wc-block-order-confirmation-totals__heading) {
	font-family: var(--fdm-editorial);
	font-weight: 600;
}

@media (min-width: 952px) {

	.fdm-commerce .wc-block-components-sidebar-layout > .wc-block-components-sidebar {
		flex: 0 0 34.24%;
		max-width: 428px;
	}

}

@media (min-width: 768px) {

	body:has(.fdm-commerce) .wp-site-blocks > header .fdm-header {
		min-height: 88px;
	}
}

@media (max-width: 782px) {

	.fdm-commerce .wc-block-cart .wc-block-cart__submit-container--sticky {
		position: static;
		width: auto;
		padding: 0;
		background: transparent;
	}

	.fdm-commerce .wc-block-cart .wc-block-cart__submit-container--sticky::before {
		display: none;
	}
}

@media (max-width: 767px) {

	.fdm-commerce {
		padding-block: 26px 46px;
	}

	.fdm-commerce > .fdm-commerce__title {
		margin-block: 22px;
		font-size: 31px;
	}

	.fdm-has-empty-checkout .fdm-commerce {
		padding-block: 25px 38px;
	}

	.fdm-has-empty-checkout .fdm-commerce__title {
		margin-block: 0 17px;
		font-size: 34px;
		line-height: 41px;
	}

	.fdm-empty-checkout {
		padding: 16px 17px 15px;
	}

	.fdm-commerce .wc-block-cart.wc-block-components-sidebar-layout > .wc-block-components-sidebar {
		margin-block-start: 26px;
	}
}

/* Woo owns the cart rows and all actions. Adapt to the actual list width. */
.fdm-commerce .wc-block-cart__main {
	container: fdm-cart-list / inline-size;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items,
.fdm-commerce .wc-block-cart__main table.wc-block-cart-items > tbody {
	display: block;
	width: 100%;
	border: 0;
}

.fdm-commerce .wc-block-cart .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-items__row {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) minmax(85px, max-content);
	align-items: start;
	gap: 0 18px;
	margin: 0;
	padding: 0;
	border: 0;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-items__row + .wc-block-cart-items__row {
	margin-block-start: 30px;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-items__row > td {
	display: block;
	box-sizing: border-box;
	min-width: 0;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__image {
	grid-area: 1 / 1;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__image img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__product {
	grid-area: 1 / 2;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__wrap {
	position: relative;
	box-sizing: border-box;
	min-height: 76px;
	padding-inline-end: 128px;
	gap: 4px;
	overflow-wrap: anywhere;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-components-product-name {
	font: 600 16px/22px var(--fdm-body);
	text-decoration: none;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-components-product-name:hover {
	text-decoration: underline;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__prices {
	order: 1;
	color: var(--wp--preset--color--muted);
	font: 400 13px/18px var(--fdm-body);
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items :is(.wc-block-components-product-metadata, .wc-block-components-product-backorder-badge) {
	padding: 0;
	background: transparent;
	color: var(--wp--preset--color--muted);
	font: 400 13px/18px var(--fdm-body);
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__total {
	grid-area: 1 / 3;
	align-self: start;
	text-align: end;
	font: 600 17px/24px var(--fdm-body);
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__quantity {
	position: absolute;
	inset-block-start: 0;
	inset-inline-end: 0;
	display: flex;
	flex-flow: column nowrap;
	align-items: center;
	width: 110px;
	gap: 0;
	padding: 0;
}

.fdm-commerce .wc-block-cart__main .wc-block-components-quantity-selector {
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	width: 110px;
	height: 40px;
	min-width: 0;
	gap: 0;
	border: 1px solid var(--wp--preset--color--field-border);
	border-radius: 20px;
}

.fdm-commerce .wc-block-cart__main .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
	box-sizing: border-box;
	flex: 1 1 auto;
	width: 30px;
	min-width: 0;
	max-width: none;
	text-align: center;
}

.fdm-commerce .wc-block-cart__main .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
}

/* Keep Woo's accessible button names and native quantity limits. */
.fdm-commerce .wc-block-cart__main .wc-block-components-quantity-selector button {
	position: relative;
	font-size: 0;
	opacity: 1;
}

.fdm-commerce .wc-block-cart__main .wc-block-components-quantity-selector button::before {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	width: 18px;
	height: 18px;
	background: currentcolor;
	mask: url(../icons/plus.svg) center / contain no-repeat;
}

.fdm-commerce .wc-block-cart__main .wc-block-components-quantity-selector button.wc-block-components-quantity-selector__button--minus::before {
	mask-image: url(../icons/minus.svg);
}

.fdm-commerce .wc-block-cart__main .wc-block-components-quantity-selector button:disabled {
	--fdm-disabled-background: transparent;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__quantity button.wc-block-cart-item__remove-link:not([hidden]) {
	text-decoration: none;
	display: grid;
	place-items: center;
	width: 100%;
	height: auto;
	min-height: 36px;
	padding: 4px;
	border: 0;
	text-align: center;
	white-space: normal;
	font: 600 13px/18px var(--fdm-body);
}

.fdm-commerce .wc-block-cart__main button[data-fdm-remove] > svg {
	display: none;
}

.fdm-commerce .wc-block-cart__main button[data-fdm-remove]::after {
	content: attr(data-fdm-remove);
}

@container fdm-cart-list (max-width: 499px) {

	.fdm-commerce .wc-block-cart .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-items__row {
		grid-template-columns: 64px minmax(110px, 1fr) minmax(0, max-content);
		column-gap: 12px;
	}

	.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-items__row + .wc-block-cart-items__row {
		margin-block-start: 24px;
	}

	.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__product {
		grid-column: 2 / -1;
	}

	.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__wrap {
		padding-inline-end: 0;
	}

	.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-item__quantity {
		position: static;
		order: 3;
		margin-block-start: 6px;
	}

	.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-cart-items__row > td.wc-block-cart-item__total {
		align-self: end;
		max-width: 100%;
		min-width: min(68px, 100%);
		margin-block-end: 54px;
		font-size: 15px;
		line-height: 22px;
		overflow-wrap: anywhere;
	}
}

/*
 * The native blocks still own taxes, discounts, shipping rates and
 * payment actions.
 */
.fdm-commerce .wc-block-cart .wc-block-components-sidebar {
	padding: var(--fdm-summary-inset);
	margin-block-end: 0;
}

.fdm-commerce .wp-block-woocommerce-cart-order-summary-block {
	display: grid;
	row-gap: var(--fdm-summary-group-gap);
	margin: 0;
	padding: 0;
	border: 0;
}

.fdm-commerce .wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title {
	display: block;
	margin-block: 0 15px;
	padding: 0;
	font: 600 20px/1.35 var(--fdm-editorial);
	margin: 0;
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-totals-wrapper,
.fdm-commerce .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-totals-block {
	padding: 0;
	margin: 0;
	border: 0;
	box-shadow: none;
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-panel__button,
.fdm-commerce .wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	padding: 0;
	font: 600 14px/20px var(--fdm-body);
}
/* stylelint-disable no-descending-specificity */
.fdm-commerce .wc-block-cart__sidebar .wc-block-components-panel__button > svg,
.fdm-commerce .wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button > svg {
	position: static;
	transform: none;
	order: 1;
	width: 18px;
	height: 18px;
	margin: 0;
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-panel__button[aria-expanded="true"] > svg,
.fdm-commerce .wc-block-checkout .wc-block-components-totals-coupon .wc-block-components-panel__button[aria-expanded="true"] > svg {
	transform: rotate(180deg);
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-totals-item,
.fdm-commerce .wc-block-checkout .checkout-order-summary-block-fill .wc-block-components-totals-item,
.fdm-commerce .wc-block-checkout__sidebar .wc-block-components-totals-item {
	align-items: center;
	min-height: 25px;
	padding: 0;
	font: 400 15px/1.35 var(--fdm-body);
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-totals-item__description:empty,
.fdm-commerce .wc-block-checkout .checkout-order-summary-block-fill .wc-block-components-totals-item__description:empty,
.fdm-commerce .wc-block-checkout__sidebar .wc-block-components-totals-item__description:empty {
	display: none;
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-totals-footer-item,
.fdm-commerce .wc-block-checkout .checkout-order-summary-block-fill .wc-block-components-totals-footer-item,
.fdm-commerce .wc-block-checkout__sidebar .wc-block-components-totals-footer-item {
	min-height: 29px;
	row-gap: 0;
	font: 600 18px/29px var(--fdm-body);
}
/* stylelint-enable no-descending-specificity */

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-totals-footer-item :is(.wc-block-components-totals-item__label, .wc-block-components-totals-item__value),
.fdm-commerce .wc-block-checkout .checkout-order-summary-block-fill .wc-block-components-totals-footer-item :is(.wc-block-components-totals-item__label, .wc-block-components-totals-item__value),
.fdm-commerce .wc-block-checkout__sidebar .wc-block-components-totals-footer-item :is(.wc-block-components-totals-item__label, .wc-block-components-totals-item__value) {
	font: inherit;
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-totals-item__description:has(> .wc-block-components-totals-footer-item-shipping:only-child) {
	order: -1;
	width: 100%;
	margin: 0 0 22px;
	color: var(--wp--preset--color--muted);
	font: 400 14px/19px var(--fdm-body);
}

.fdm-commerce .wc-block-cart__sidebar .wc-block-components-totals-footer-item:has(.wc-block-components-totals-footer-item-shipping:only-child) {
	margin-top: -14px;
}

.fdm-commerce .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-totals-block > * + * {
	margin-block-start: var(--fdm-summary-row-gap);
}

.fdm-commerce .wc-block-cart .wc-block-cart__submit {
	margin: 18px 0 0;
}

.fdm-commerce .wc-block-cart .wc-block-cart__submit-container {
	border-radius: 24px;

	/* Woo sets the sticky background inline after scrolling. */
	background: transparent !important;
}

.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-components-product-details,
.fdm-commerce .wc-block-cart__main table.wc-block-cart-items .wc-block-components-product-metadata__description p,
.fdm-commerce .wc-block-cart__main table.wc-block-cart-items :is(.wc-block-cart-item__prices, .wc-block-cart-item__total) .price {
	font: inherit;
}

.fdm-commerce:has(.wc-block-cart) .fdm-commerce__navigation {
	font: 600 14px/19px var(--fdm-body);
}

/* Contact controls edit the same Woo address shown later in the form. Keep
   the separate billing form available when the customer requests one. */
.wc-block-checkout__form:has(.fdm-contact[data-address="shipping"]) #shipping-fields,
.wc-block-checkout__form:has(.fdm-contact[data-address="billing"]) #billing-fields {

	.wc-block-components-address-form__first_name,
	.wc-block-components-address-form__last_name,
	.wc-block-components-address-form__phone {
		display: none;
	}
}

/*
 * Space the native form steps without touching the borders of their
 * controls.
 */
.fdm-commerce .wc-block-checkout__form > .wc-block-components-checkout-step {
	border-block-end: 0;
	padding-block-end: 0;
	margin-block-end: calc(2 * var(--wp--preset--spacing--medium, 16px));
}

.fdm-commerce .wc-block-checkout__form > .wc-block-checkout__terms--with-separator {
	border-block-start: 0;
	padding-block-start: 0;
}
/* stylelint-disable no-descending-specificity */
.fdm-commerce #contact-fields:has(.fdm-contact) .wc-block-components-checkout-step__heading,
.fdm-commerce #shipping-method .wc-block-components-checkout-step__heading {
	margin: 0 0 12px;
}

.fdm-commerce #contact-fields:has(.fdm-contact) .wc-block-components-checkout-step__content,
.fdm-commerce #shipping-method .wc-block-components-checkout-step__content {
	padding: 0;
}
/* stylelint-enable no-descending-specificity */

.fdm-commerce #contact-fields:has(.fdm-contact) #contact {
	margin: 0;
}

.fdm-commerce #contact-fields:has(.fdm-contact) .wc-block-checkout__guest-checkout-notice {
	position: absolute;
	clip-path: inset(50%);
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.fdm-commerce #contact-fields:has(.fdm-contact) .wc-block-components-address-form__email {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}

.fdm-commerce #contact-fields:has(.fdm-contact) .wc-block-components-address-form__email label {
	order: -1;
	position: static;
	transform: none;
	max-width: none;
	margin: 0;
	font: 600 14px/20px var(--fdm-body);
}
/* stylelint-disable no-descending-specificity */
.fdm-commerce #contact-fields:has(.fdm-contact) #email,
.fdm-commerce .fdm-contact input {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	height: 48px;
	padding: 0 12px;
	border: 1px solid var(--wp--preset--color--field-border);
	border-radius: 5px;
	color: var(--fdm-commerce-text);
	background: var(--wp--preset--color--canvas);
	font: 400 15px/20px var(--fdm-body);
}
/* stylelint-enable no-descending-specificity */

.fdm-commerce #contact-fields:has(.fdm-contact) #email[aria-invalid="true"],
.fdm-commerce .fdm-contact input[aria-invalid="true"] {
	border-color: var(--wp--preset--color--error);
}

.fdm-contact {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 12px;
	margin-top: 14px;
}

.fdm-contact__field {
	display: grid;
	gap: 6px;
	min-width: 0;
}
/* stylelint-disable no-descending-specificity */
.fdm-contact__field label {
	font: 600 14px/20px var(--fdm-body);
}

.fdm-contact__phone {
	grid-column: 1 / -1;
}

.fdm-contact__number {
	position: relative;
}

.fdm-commerce .fdm-contact__number input {
	padding-inline-start: 108px;
}
/* stylelint-enable no-descending-specificity */

.fdm-contact__number select {
	position: absolute;
	inset: 1px auto 1px 1px;
	width: 97px;
	padding-inline: 12px 24px;
	appearance: none;
	border: 0;
	border-radius: 4px;
	background: transparent url(../icons/chevron-down.svg) right 9px center / 14px no-repeat;
	color: inherit;
	font: 400 13px/20px var(--fdm-body);
}

.fdm-contact__number::after {
	content: "";
	position: absolute;
	inset: 13px auto 13px 98px;
	border-inline-end: 1px solid var(--fdm-commerce-border);
	pointer-events: none;
}

.fdm-contact :focus-visible {
	outline: 2px solid var(--wp--preset--color--focus);
	outline-offset: 1px;
}

.fdm-commerce .wc-block-checkout__shipping-method-container .wc-block-checkout__shipping-method-option {
	justify-content: flex-start;
	width: 100%;
	min-height: 46px;
	border: 1px solid var(--fdm-commerce-border);
	border-radius: 8px;
	padding: 10px 14px;
	flex-direction: row;
}

.fdm-commerce .wc-block-checkout__shipping-method-option-title-wrapper {
	align-items: center;
	gap: 12px;
	min-inline-size: 0;
	justify-content: start;
}

/* Woo 11.3 renders the complete live summary in the action slot on narrow
   layouts. Remove the redundant toggle only when that slot is present. */
.fdm-commerce .wc-block-checkout:is(.is-mobile, .is-small, .is-medium):has(.checkout-order-summary-block-fill-wrapper[aria-hidden="false"]) .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	display: none;
}

.fdm-commerce .wc-block-checkout:is(.is-mobile, .is-small, .is-medium):has(.checkout-order-summary-block-fill-wrapper[aria-hidden="false"]) > .wc-block-checkout__sidebar:has(.wp-block-woocommerce-checkout-order-summary-block) {
	padding: 0;
	margin: 0;
}

.fdm-commerce .checkout-order-summary-block-fill-wrapper[aria-hidden="false"] {
	background: var(--fdm-commerce-surface);
	border: 0;
	border-radius: 8px;
	padding: var(--fdm-summary-inset);
}

.fdm-commerce .wc-block-checkout__actions .checkout-order-summary-block-fill-wrapper[aria-hidden="false"] {
	margin-block-end: var(--wp--preset--spacing--medium, 16px);
}

/* Woo renders the same groups in the sidebar and in its narrow-screen slot. */
/* stylelint-disable-next-line no-descending-specificity */
.fdm-commerce .wc-block-checkout.wc-block-components-sidebar-layout > .wc-block-checkout__sidebar {
	padding: var(--fdm-summary-inset);
}

.fdm-commerce .wc-block-checkout :is(.wc-block-checkout__sidebar, .checkout-order-summary-block-fill-wrapper) .checkout-order-summary-block-fill {
	border: 0;
}

.fdm-commerce .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__title:not([role="button"]) {
	min-height: 0;
}

.fdm-commerce .wc-block-checkout .checkout-order-summary-block-fill-wrapper[aria-hidden="false"] .wc-block-components-checkout-step__title {
	margin-block: 0 var(--fdm-summary-group-gap);
}

.fdm-commerce .wc-block-checkout .wc-block-checkout__sidebar .wc-block-components-checkout-order-summary__content {
	margin-block-start: var(--fdm-summary-group-gap);
}

.fdm-commerce .wc-block-checkout .wc-block-components-checkout-order-summary__content-container,
.fdm-commerce .wc-block-checkout .wp-block-woocommerce-checkout-order-summary-totals-block {
	display: grid;
	min-inline-size: 0;
}

.fdm-commerce .wc-block-checkout .wc-block-components-checkout-order-summary__content-container {
	gap: var(--fdm-summary-group-gap);
}

.fdm-commerce .wc-block-checkout .wp-block-woocommerce-checkout-order-summary-totals-block {
	gap: var(--fdm-summary-row-gap);
}

.fdm-commerce .wc-block-checkout .wc-block-components-checkout-order-summary__content-container :is(
	.wc-block-components-totals-wrapper,
	.wp-block-woocommerce-checkout-order-summary-totals-block,
	.wc-block-components-order-summary,
	.wc-block-components-totals-coupon
) {
	margin: 0;
	padding: 0;
	border: 0;
}

.fdm-commerce .wc-block-checkout .wp-block-woocommerce-checkout-order-summary-totals-block > :empty,
.fdm-commerce .wc-block-checkout .wc-block-components-checkout-order-summary__content-container > :empty {
	display: none;
}

.fdm-commerce .wc-block-checkout .wc-block-components-checkout-order-summary__content-container :is(
	.wc-block-components-order-summary-item__description,
	.wc-block-components-totals-item__label,
	.wc-block-components-totals-item__value
) {
	min-inline-size: 0;
	overflow-wrap: anywhere;
}

.fdm-commerce .wc-block-checkout .wc-block-components-totals-item__value {
	text-align: end;
}
/* stylelint-disable no-descending-specificity */
.fdm-commerce #contact-fields:has(.fdm-contact) .wc-block-components-checkout-step__heading-container,
.fdm-commerce #shipping-method .wc-block-components-checkout-step__heading-container,
.fdm-commerce .fdm-contact__field label {
	margin: 0;
}

.fdm-delivery-window {
	margin-block-start: 14px;
}

.fdm-checkout-date-time {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.fdm-checkout-date-time .picker label {
	margin: 0;
}
/* stylelint-enable no-descending-specificity */

.fdm-checkout-date-time .picker-trigger {
	min-height: 48px;
}

.fdm-checkout-date-time .picker-panel {
	width: min(320px, 100%);
	z-index: 5;
}

.fdm-delivery-window [role="status"]:not(:empty) {
	margin-block-start: 6px;
	color: var(--wp--preset--color--error);
}

@media (max-width: 767px) {

	.fdm-checkout-date-time {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
	}

	.fdm-checkout-date-time .picker-panel {
		width: 100%;
	}
}

.fdm-commerce .fdm-cart-continue {
	margin: 30px 0 0;
	font: 600 14px/19px var(--fdm-body);
}

@container fdm-cart-list (max-width: 499px) {

	.fdm-commerce .fdm-cart-continue {
		margin-top: 24px;
	}
}

.fdm-commerce .fdm-cart-continue a {
	font: inherit;
	text-decoration: none;
}

.fdm-commerce .fdm-cart-continue a:hover {
	text-decoration: underline;
}

.fdm-commerce .wc-block-cart__main .wc-block-cart-item__prices[data-fdm-unit] {
	display: inline-flex;
	align-items: baseline;
	column-gap: 4px;
}

.fdm-commerce .wc-block-cart__main .wc-block-cart-item__prices[data-fdm-unit]::after {
	content: attr(data-fdm-unit);
}

/* The native select remains Woo's state and validation target. */
/* stylelint-disable no-descending-specificity */
.fdm-commerce .fdm-checkout-native-select,
.fdm-commerce .fdm-checkout-native-label,
.fdm-commerce .wc-blocks-components-select__container:has(> .fdm-checkout-picker) > svg {
	display: none;
}
/* stylelint-enable no-descending-specificity */

.fdm-commerce .wc-blocks-components-select__container:has(> .fdm-checkout-picker) {
	height: auto;
	border: 0;
	background: transparent;
}

.fdm-commerce .fdm-checkout-picker [data-picker="country"] .picker-trigger {
	min-block-size: 48px;
	font: 400 15px/20px var(--fdm-body);
}

.fdm-commerce .fdm-contact__number > .fdm-checkout-picker {
	position: absolute;
	inset: 1px auto 1px 1px;
	inline-size: 97px;
}

.fdm-commerce .fdm-contact__number .fdm-checkout-picker .picker-phone {
	height: 46px;
	min-height: 46px;
	padding: 0;
	border: 0;
	background: transparent;
}

.fdm-commerce .fdm-contact__number .fdm-checkout-picker .picker-prefix {
	min-width: 100%;
	max-width: none;
	min-height: 46px;
}

.fdm-commerce .fdm-contact__number .fdm-checkout-picker .picker-prefix::after {
	content: none;
}

.fdm-commerce .fdm-checkout-picker .picker-panel {
	z-index: 5;
}

.fdm-commerce .fdm-contact__number .fdm-checkout-picker .picker-panel {
	inline-size: min(350px, calc(100vw - 34px));
}
