/* ===========================================================================
   Cart + checkout.

   This is a transaction surface, so the brand is quieter than the programme
   pages: compact masthead, obvious progress, generous form space and one clear
   action. WooCommerce Blocks retain all behaviour and state management.
   =========================================================================== */

.fts-commerce-page {
	background: var(--fts-paper);
}

.fts-commerce-mast {
	padding-block: calc(var(--fts-hdr-h) + clamp(2rem, 5vw, 3.25rem)) clamp(1.75rem, 4vw, 2.5rem);
}

.fts-commerce-mast__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(30rem, 0.85fr);
	gap: clamp(2rem, 6vw, 5rem);
	align-items: end;
}

.fts-commerce-mast__copy .fts-mast__h1 {
	font-size: clamp(2.4rem, 6vw, 4rem);
}

.fts-commerce-mast__copy .fts-mast__lede {
	max-width: 51ch;
}

.fts-commerce-progress ol {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fts-commerce-progress--payment ol {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fts-commerce-progress li {
	position: relative;
	min-width: 0;
}

.fts-commerce-progress li::before {
	content: "";
	position: absolute;
	top: 0.95rem;
	left: 0;
	width: 100%;
	height: 1px;
	background: rgba(255, 255, 255, 0.28);
}

.fts-commerce-progress li:first-child::before { left: 50%; width: 50%; }
.fts-commerce-progress li:last-child::before { width: 50%; }

.fts-commerce-progress a,
.fts-commerce-progress li > span {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	color: var(--fts-blue-soft);
}

.fts-commerce-progress a > span,
.fts-commerce-progress li > span > b {
	display: grid;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	border: 1px solid rgba(255, 255, 255, 0.36);
	border-radius: 50%;
	background: var(--fts-navy-deep);
	font-size: 0.76rem;
	font-weight: 700;
	font-style: normal;
	color: var(--fts-blue-soft);
}

.fts-commerce-progress .is-complete a,
.fts-commerce-progress .is-current > span { color: #fff; }

.fts-commerce-progress .is-complete a > span {
	border-color: var(--fts-mist);
	background: var(--fts-mist);
	color: var(--fts-navy-deep);
}

.fts-commerce-progress .is-current > span > b {
	border-color: #fff;
	background: #fff;
	box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7);
	color: var(--fts-navy-deep);
}

.fts-commerce-progress a:hover,
.fts-commerce-progress a:focus-visible { color: #fff; }

.fts-commerce-progress a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 0.35rem;
	border-radius: 0.25rem;
}

.fts-commerce-stage {
	padding-block: clamp(2rem, 5vw, 4rem);
	background: var(--fts-paper);
}

.fts-commerce-surface {
	font-family: var(--fts-font);
	color: var(--fts-navy-deep);
}

/* WordPress marks Cart/Checkout as alignwide; the parent theme translates that
   outside its content column on narrow screens. This shell is already the
   width owner, so Blocks must start at zero and fill it exactly. */
.fts-commerce-surface > .wp-block-woocommerce-cart,
.fts-commerce-surface > .wp-block-woocommerce-checkout,
.fts-commerce-surface .wc-block-components-sidebar-layout {
	width: 100%;
	max-width: none;
	margin-inline: 0 !important;
}

.fts-commerce-surface .wc-block-components-sidebar-layout {
	gap: clamp(1.5rem, 4vw, 3rem);
}

.fts-commerce-surface .wc-block-components-main,
.fts-commerce-surface .wc-block-components-sidebar {
	min-width: 0;
	margin: 0;
}

.fts-commerce-surface .wc-block-components-main {
	padding-right: 0;
}

.fts-commerce-surface .wc-block-components-sidebar {
	padding-left: 0;
}

/* --- Shared Block typography and controls -------------------------------- */

.fts-commerce-surface h2,
.fts-commerce-surface h3,
.fts-commerce-surface .wc-block-components-title {
	font-family: var(--fts-font-cond);
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--fts-navy);
}

.fts-commerce-surface .wc-block-components-title.wc-block-components-title {
	font-size: clamp(1.45rem, 3vw, 1.8rem);
	line-height: 1.1;
}

.fts-commerce-surface .wc-block-components-product-name {
	font-weight: 700;
	color: var(--fts-navy);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.fts-commerce-surface .wc-block-components-product-details {
	margin-top: 0.5rem;
	font-size: 0.88rem;
	line-height: 1.45;
	color: var(--fts-slate);
}

.fts-commerce-surface .wc-block-components-product-details__name {
	font-weight: 700;
	color: var(--fts-navy);
}

.fts-commerce-surface .wc-block-components-formatted-money-amount,
.fts-commerce-surface .wc-block-components-totals-item__value,
.fts-commerce-surface .wc-block-components-product-price {
	font-variant-numeric: tabular-nums;
}

.fts-commerce-surface input[type="text"],
.fts-commerce-surface input[type="email"],
.fts-commerce-surface input[type="tel"],
.fts-commerce-surface select,
.fts-commerce-surface .wc-block-components-text-input input {
	min-height: 3.25rem;
	border-color: #aeb7c7;
	border-radius: 0.65rem;
	background: #fff;
	font-family: var(--fts-font);
	font-size: 1rem;
	color: var(--fts-navy-deep);
}

.fts-commerce-surface input:focus,
.fts-commerce-surface select:focus,
.fts-commerce-surface button:focus-visible,
.fts-commerce-surface a:focus-visible {
	outline: 2px solid var(--fts-blue);
	outline-offset: 2px;
}

.fts-commerce-surface .wc-block-components-button,
.fts-commerce-surface .wp-element-button {
	min-height: 3.25rem;
	border-radius: 999px;
	font-family: var(--fts-font);
	font-weight: 700;
	text-decoration: none;
	transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease, box-shadow 180ms ease;
}

.fts-commerce-surface .wc-block-components-button:hover,
.fts-commerce-surface .wc-block-components-button:focus-visible,
.fts-commerce-surface .wp-element-button:hover,
.fts-commerce-surface .wp-element-button:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 14px 28px -16px rgba(11, 24, 48, 0.75);
}

.fts-commerce-surface .wc-block-components-button:disabled,
.fts-commerce-surface .wp-element-button:disabled {
	transform: none;
	box-shadow: none;
	opacity: 0.5;
	cursor: not-allowed;
}

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

.fts-commerce-cart .wc-block-cart__main,
.fts-commerce-cart .wc-block-cart__sidebar {
	padding: clamp(1.2rem, 3vw, 2rem);
	border-radius: 0.9rem;
	background: #fff;
}

.fts-commerce-cart .wc-block-cart__main {
	box-shadow: 0 22px 50px -38px rgba(11, 24, 48, 0.68);
}

.fts-commerce-cart .wc-block-cart__sidebar {
	align-self: start;
	box-shadow: 0 18px 44px -36px rgba(11, 24, 48, 0.7);
}

.fts-commerce-cart .wc-block-cart-items {
	margin: 0;
	border: 0;
}

.fts-commerce-cart .wc-block-cart-items thead th {
	padding: 0 0 0.75rem;
	border-bottom: 1px solid var(--fts-line);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--fts-slate);
}

.fts-commerce-cart .wc-block-cart-items tbody td {
	padding-block: 1.25rem;
	border-color: var(--fts-line);
}

.fts-commerce-cart .wc-block-cart-item__image img,
.fts-commerce-checkout .wc-block-components-order-summary-item__image img {
	border-radius: 0.65rem;
}

.fts-commerce-cart .wc-block-components-quantity-selector {
	flex: 0 0 8.25rem;
	width: 8.25rem;
	min-width: 8.25rem;
	min-height: 2.75rem;
	border-color: #b9c1cf;
	border-radius: 0.55rem;
	overflow: hidden;
}

.fts-commerce-cart .wc-block-components-quantity-selector__button {
	flex: 0 0 2.75rem;
	width: 2.75rem;
	min-width: 2.75rem;
	min-height: 2.75rem;
	border: 0;
	background: #f0f3f8;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1;
	color: var(--fts-navy);
	opacity: 1;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

.fts-commerce-cart .wc-block-components-quantity-selector__button:hover,
.fts-commerce-cart .wc-block-components-quantity-selector__button:focus-visible {
	background: var(--fts-navy);
	color: #fff;
}

.fts-commerce-cart .wc-block-components-quantity-selector__button:disabled {
	background: #eef1f6;
	color: var(--fts-slate);
	opacity: 1;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.fts-commerce-cart .wc-block-components-quantity-selector__input {
	min-width: 0;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--fts-navy-deep);
}

.fts-commerce-cart .wc-block-cart-item__quantity {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

body.fts-commerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link {
	display: grid;
	place-items: center;
	flex: 0 0 2.75rem;
	width: 2.75rem;
	height: 2.75rem;
	min-width: 2.75rem;
	min-height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f0f3f8;
	color: var(--fts-slate);
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

body.fts-commerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link svg {
	width: 1.25rem;
	height: 1.25rem;
	fill: currentColor;
	pointer-events: none;
}

body.fts-commerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:hover,
body.fts-commerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity .wc-block-cart-item__remove-link:focus-visible {
	background: var(--fts-pale);
	color: var(--fts-blue);
}

.fts-commerce-cart .wc-block-components-product-badge {
	border-color: var(--fts-mist);
	color: var(--fts-navy);
}

.fts-commerce-cart .wc-block-cart__totals-title {
	padding-top: 0;
	font-family: var(--fts-font-cond);
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--fts-navy);
}

.fts-commerce-cart .wc-block-components-totals-wrapper {
	border-color: var(--fts-line);
}

.fts-commerce-cart .wc-block-cart__submit-container {
	padding: 0;
	background: transparent;
}

.fts-commerce-cart .wc-block-cart__submit-container--sticky {
	position: static;
	inset: auto;
	z-index: auto;
	width: auto;
	box-shadow: none;
}

/* --- Empty Cart ---------------------------------------------------------- */

.fts-commerce-cart .wp-block-woocommerce-empty-cart-block {
	width: min(100%, 44rem);
	margin-inline: auto;
	padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 3rem);
	border-radius: 0.9rem;
	background: #fff;
	box-shadow: 0 22px 50px -38px rgba(11, 24, 48, 0.68);
	text-align: center;
}

.fts-commerce-cart .wc-block-cart__empty-cart__title {
	margin: 0;
	font-family: var(--fts-font-cond);
	font-size: clamp(2rem, 6vw, 3rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--fts-navy);
}

/* Replace WooCommerce's crying-face mask with the real FTS wing emblem. The
	navy field is part of the image treatment, not an empty decorative card. */
.fts-commerce-cart .wc-block-cart__empty-cart__title.with-empty-cart-icon::before {
	display: block;
	width: clamp(7.5rem, 24vw, 10rem);
	height: clamp(4.5rem, 14vw, 5.75rem);
	margin: 0 auto 1.5rem;
	border-radius: 0.9rem;
	background-color: var(--fts-navy);
	background-image: url("fts-emblem-white.png");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 82% auto;
	-webkit-mask-image: none;
	mask-image: none;
}

.fts-commerce-cart .fts-empty-cart__copy {
	max-width: 46ch;
	margin: 1rem auto 0;
	font-size: clamp(1rem, 2vw, 1.08rem);
	line-height: 1.6;
	color: var(--fts-slate);
	text-wrap: pretty;
}

.fts-commerce-cart .fts-empty-cart__actions {
	justify-content: center;
	margin-top: 1.5rem;
}

.fts-commerce-cart .fts-empty-cart__actions .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3.25rem;
	padding: 0.85rem 1.6rem;
	border-radius: 999px;
	background: var(--fts-navy);
	font-weight: 700;
	color: #fff;
	text-decoration: none;
	transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease, box-shadow 180ms ease;
}

.fts-commerce-cart .fts-empty-cart__actions .wp-block-button__link:hover,
.fts-commerce-cart .fts-empty-cart__actions .wp-block-button__link:focus-visible {
	transform: translateY(-1px);
	background: var(--fts-blue);
	box-shadow: 0 14px 28px -16px rgba(11, 24, 48, 0.75);
}

/* Belt-and-braces protection if WooCommerce ever restores its stock template
	in the editor: the generic separator, heading and newest-products grid are not
	part of the booking recovery path. */
.fts-commerce-cart .wp-block-woocommerce-empty-cart-block > .wp-block-separator,
.fts-commerce-cart .wp-block-woocommerce-empty-cart-block > h2:not(.wc-block-cart__empty-cart__title),
.fts-commerce-cart .wp-block-woocommerce-empty-cart-block > .wp-block-woocommerce-product-new {
	display: none;
}

/* --- Checkout ------------------------------------------------------------ */

.fts-commerce-checkout .wc-block-checkout__form {
	padding: clamp(1.2rem, 3vw, 2rem);
	border-radius: 0.9rem;
	background: #fff;
	box-shadow: 0 22px 50px -38px rgba(11, 24, 48, 0.68);
}

.fts-commerce-checkout .wc-block-checkout__sidebar {
	align-self: start;
	border: 0;
	border-radius: 0.9rem;
	background: #fff;
	box-shadow: 0 18px 44px -36px rgba(11, 24, 48, 0.7);
}

.fts-commerce-checkout .wc-block-components-checkout-step {
	margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.fts-commerce-checkout .wc-block-components-checkout-step__heading {
	margin-bottom: 0.9rem;
}

.fts-commerce-checkout .wc-block-components-checkout-step__title {
	font-family: var(--fts-font-cond);
	font-size: clamp(1.4rem, 3vw, 1.7rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--fts-navy);
}

.fts-commerce-checkout .wc-block-checkout__guest-checkout-notice {
	font-size: 0.88rem;
	color: var(--fts-slate);
}

.fts-commerce-checkout .wc-block-checkout__payment-method {
	border-color: var(--fts-line);
	border-radius: 0.75rem;
	overflow: hidden;
}

.fts-commerce-checkout .wc-block-components-radio-control__option {
	min-height: 3.25rem;
}

.fts-commerce-checkout .wc-block-components-checkout-order-summary__title,
.fts-commerce-checkout .wc-block-components-order-summary,
.fts-commerce-checkout .wc-block-components-totals-wrapper {
	border-color: var(--fts-line);
}

.fts-commerce-checkout .wc-block-components-checkout-order-summary__title {
	padding: 1.2rem;
}

.fts-commerce-checkout .wc-block-components-order-summary,
.fts-commerce-checkout .wc-block-components-totals-wrapper {
	padding-inline: 1.2rem;
}

.fts-commerce-checkout .wc-block-checkout__terms {
	font-size: 0.88rem;
	line-height: 1.55;
	color: var(--fts-slate);
}

.fts-commerce-checkout .wc-block-checkout__terms a {
	color: var(--fts-navy);
	text-decoration-color: var(--fts-blue-soft);
	text-underline-offset: 0.16em;
}

.fts-commerce-checkout .wc-block-components-checkout-place-order-button {
	width: 100%;
}

/* --- Airwallex hosted payment step --------------------------------------- */

.fts-commerce-mast__secure {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.8rem;
	font-family: var(--fts-font-cond);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fts-blue-soft);
}

.fts-commerce-mast__secure svg {
	flex: none;
	color: #fff;
}

body.fts-commerce-payment .fts-commerce-stage {
	background:
		linear-gradient(rgba(246, 248, 251, 0.94), rgba(246, 248, 251, 0.98)),
		linear-gradient(90deg, rgba(22, 48, 94, 0.06) 1px, transparent 1px);
	background-size: auto, 5rem 100%;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-content-drop-in {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout.airwallex-tpl-2col-1,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout.airwallex-tpl-2col-2 {
	display: grid;
	grid-template-columns: minmax(17rem, 0.82fr) minmax(0, 1.55fr);
	gap: clamp(1.25rem, 4vw, 3rem);
	align-items: start;
	width: 100%;
	margin: 0;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .airwallex-col-1,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .airwallex-col-2 {
	min-width: 0;
	padding: 0;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .airwallex-col-1,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .payment-section {
	border: 1px solid rgba(22, 48, 94, 0.07);
	border-radius: 0.9rem;
	background: #fff;
	box-shadow: 0 22px 50px -38px rgba(11, 24, 48, 0.68);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .airwallex-col-1 {
	padding: clamp(1.2rem, 3vw, 1.75rem);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .payment-section {
	min-height: 24rem;
	padding: clamp(1.2rem, 4vw, 2.5rem);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .cart-heading {
	margin: 0 0 1.25rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--fts-line);
	font-family: var(--fts-font-cond);
	font-size: clamp(1.35rem, 3vw, 1.65rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--fts-navy);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .cart-contents,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .totals-table {
	width: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: transparent;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .cart-item td {
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--fts-line);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .product-image {
	width: 4.75rem;
	padding-right: 0.9rem;
	vertical-align: top;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .product-image:empty {
	display: none;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .product-image img {
	width: 3.85rem;
	height: 3.85rem;
	border-radius: 0.6rem;
	object-fit: cover;
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .product-info {
	padding-block: 0.85rem;
	font-size: 0.94rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--fts-navy-deep);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .product-quantity {
	font-weight: 700;
	color: var(--fts-slate);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .price,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .wc-item-meta {
	margin-top: 0.35rem;
	font-size: 0.82rem;
	font-weight: 400;
	line-height: 1.45;
	color: var(--fts-slate);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .totals-table th,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .totals-table td {
	padding: 0.8rem 0;
	border-bottom: 1px solid var(--fts-line);
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--fts-slate);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .totals-table td {
	font-variant-numeric: tabular-nums;
	color: var(--fts-navy-deep);
}

body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .totals-table tr:last-child th,
body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .totals-table tr:last-child td {
	padding-top: 1rem;
	border-bottom: 0;
	font-family: var(--fts-font-cond);
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--fts-navy);
}

body.fts-commerce-payment .fts-commerce-surface #airwallex-drop-in {
	width: 100%;
	min-height: 16rem;
}

body.fts-commerce-payment .fts-commerce-surface #airwallex-drop-in iframe {
	width: 100% !important;
	max-width: 100%;
}

body.fts-commerce-payment .fts-commerce-surface #airwallex-error-message {
	margin: 0 0 1rem;
	padding: 0.9rem 1rem;
	border: 1px solid #e9aaa1;
	border-radius: 0.65rem;
	background: #fff1ef;
	font-weight: 600;
	color: #812a1b;
}

body.fts-commerce-payment .fts-commerce-surface #success-message {
	font-family: var(--fts-font-cond);
	font-size: 1.3rem;
	font-weight: 700;
	text-align: center;
}

/* Notices, including the empty-cart recovery path. */
.fts-commerce-surface .wc-block-components-notice-banner,
.fts-commerce-surface .woocommerce-message,
.fts-commerce-surface .woocommerce-error,
.fts-commerce-surface .woocommerce-info {
	border: 0;
	border-radius: 0.75rem;
	background: var(--fts-pale);
	color: var(--fts-navy-deep);
}

.fts-commerce-surface .woocommerce-message,
.fts-commerce-surface .woocommerce-error,
.fts-commerce-surface .woocommerce-info {
	position: relative;
	padding-left: 2.75rem;
}

.fts-commerce-surface .woocommerce-message::before,
.fts-commerce-surface .woocommerce-error::before,
.fts-commerce-surface .woocommerce-info::before {
	left: 1rem;
	margin: 0;
}

.fts-commerce-help {
	padding-block: 1.35rem;
	border-top: 1px solid var(--fts-line);
	background: #fff;
}

.fts-commerce-help__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
}

.fts-commerce-help p {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--fts-slate);
}

@media (max-width: 60rem) {
	.fts-commerce-mast__inner {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}

	.fts-commerce-progress { max-width: 34rem; }
}

@media (min-width: 48.9375rem) {
	/* WooCommerce's native percentage columns total 100%. Adding a real gutter
	   to that flex row makes it wrap, so this shell owns the desktop columns as
	   an explicit grid instead of relying on percentage arithmetic. */
	.fts-commerce-surface .wc-block-components-sidebar-layout {
		display: grid;
		grid-template-columns: minmax(0, 1.72fr) minmax(20rem, 0.93fr);
		align-items: start;
	}

	.fts-commerce-surface .wc-block-components-sidebar-layout > .wc-block-components-main {
		grid-column: 1;
		width: auto;
	}

	.fts-commerce-surface .wc-block-components-sidebar-layout > .wc-block-components-sidebar {
		grid-column: 2;
		width: auto;
	}

	/* Blocks injects this zero-height mobile summary copy before the desktop
	   columns. It is useful only after the layout switches to is-mobile. */
	.fts-commerce-checkout .wc-block-checkout:not(.is-mobile) > :first-child:not(.wc-block-components-main) {
		display: none;
	}
}

@media (max-width: 48.875rem) {
	/* The fixed chat disc can cover totals or a payment control on a one-column
	   transaction screen. The help link remains directly below the form. */
	.fts-commerce-page .fts-wa { display: none !important; }

	.fts-commerce-surface .wc-block-components-sidebar-layout {
		display: block;
	}

	body.fts-commerce-cart .wc-block-cart-items__row {
		grid-template-columns: 4rem minmax(0, 1fr) max-content;
		column-gap: 0.75rem;
	}

	.fts-commerce-cart .wc-block-cart-item__image { grid-column: 1; }
	.fts-commerce-cart .wc-block-cart-item__product { grid-column: 2; min-width: 0; }
	.fts-commerce-cart .wc-block-cart-item__total { grid-column: 3; }

	.fts-commerce-surface .wc-block-components-main,
	.fts-commerce-surface .wc-block-components-sidebar {
		width: 100%;
	}

	.fts-commerce-surface .wc-block-components-sidebar {
		margin-top: 1.25rem;
	}

	.fts-commerce-checkout .wc-block-checkout__sidebar {
		display: none;
	}

	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout,
	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout.airwallex-tpl-2col-1,
	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout.airwallex-tpl-2col-2 {
		display: flex;
		flex-direction: column;
		gap: 1.25rem;
	}

	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .airwallex-col-2 { order: 1; }
	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .airwallex-col-1 { order: 2; }
}

@media (max-width: 34rem) {
	.fts-commerce-mast {
		padding-bottom: 1.5rem;
	}

	.fts-commerce-progress a,
	.fts-commerce-progress li > span {
		font-size: 0.7rem;
	}

	.fts-commerce-stage { padding-block: 1.25rem 1.75rem; }

	.fts-commerce-cart .wc-block-cart__main,
	.fts-commerce-cart .wc-block-cart__sidebar,
	.fts-commerce-checkout .wc-block-checkout__form {
		padding: 1rem;
		border-radius: 0.75rem;
	}

	.fts-commerce-checkout .wc-block-checkout__sidebar {
		border-radius: 0.75rem;
	}

	.fts-commerce-cart .wc-block-cart-items tbody td {
		padding-block: 1rem;
	}

	.fts-commerce-help__inner {
		align-items: flex-start;
		flex-direction: column;
	}

	.fts-commerce-progress--payment a,
	.fts-commerce-progress--payment li > span {
		font-size: 0.64rem;
	}

	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .airwallex-col-1,
	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .payment-section {
		padding: 1rem;
		border-radius: 0.75rem;
	}

	body.fts-commerce-payment .fts-commerce-surface .airwallex-checkout .payment-section {
		min-height: 20rem;
	}
}

@media (max-width: 21.25rem) {
	/* WooCommerce's mobile row reserves four 16px-gapped tracks even though the
	   rendered row has only image, details and total cells. At 320px that makes
	   a 306px table inside a 248px content box. Name the three real columns and
	   let the details track absorb the remaining width. */
	.fts-commerce-cart .wc-block-cart-items,
	.fts-commerce-cart .wc-block-cart-items__row {
		display: block;
		width: 100%;
	}

	body.fts-commerce-cart .wc-block-cart-items__row {
		display: grid;
		grid-template-columns: 3.5rem minmax(0, 1fr) max-content;
		column-gap: 0.5rem;
	}

	.fts-commerce-cart .wc-block-cart-item__image { grid-column: 1; }
	.fts-commerce-cart .wc-block-cart-item__product { grid-column: 2; min-width: 0; }
	.fts-commerce-cart .wc-block-cart-item__total { grid-column: 3; }

	body.fts-commerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 2.75rem;
		gap: 0.5rem;
	}

	.fts-commerce-cart .wc-block-components-quantity-selector {
		grid-column: 1 / -1;
		width: 100%;
		min-width: 0;
	}

	.fts-commerce-cart .wc-block-cart-item__remove-link {
		grid-column: 2;
		justify-self: end;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fts-commerce-surface .wc-block-components-button,
	.fts-commerce-surface .wp-element-button,
	.fts-commerce-cart .fts-empty-cart__actions .wp-block-button__link { transition: none; }
}
