/*
 * Cart totals box, the checkout's order summary and payment methods, and the cart and checkout shipping options as
 * cards (see cart-shipping.php)
 */

.woocommerce-cart .cart_totals,
.woocommerce-checkout #order_review,
.woocommerce ul#shipping_method {
	--ufs-gold: #b98036;      /* the shop's buttons */
	--ufs-gold-dark: #a06c2a;
	--ufs-gold-ink: #8a5a1e;  /* gold text on white */
	--ufs-cream: #fdf8f1;
	--ufs-line: #e7e2d9;
	--ufs-ink: #1a1a1a;
	--ufs-muted: #6b665f;
}

/*
 * Cart totals: a card with the theme's table laid out as rows of label and amount (it put the amounts in a thin second
 * column), the shipping row's heading above full-width options, and the total, checkout button and a reassurance line.
 */
.woocommerce-cart .cart-collaterals .cart_totals {
	padding: 28px;
	border: 1px solid var(--ufs-line);
	border-radius: 16px;
	background: #fff;
	color: var(--ufs-ink);
}
body.woocommerce-cart .cart-collaterals .cart_totals > h2 { /* "body": the theme's own rule loads after this file */
	margin: 0 0 6px;
	color: var(--ufs-ink);
	font-size: 26px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.25;
	text-transform: none;
}
.woocommerce-cart .cart_totals table.shop_table,
.woocommerce-cart .cart_totals table.shop_table > tbody {
	display: block;
	width: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
}
.woocommerce-cart .cart_totals table.shop_table tr {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	padding: 18px 0;
	border-top: 1px solid var(--ufs-line);
	background: none;
}
.woocommerce-cart .cart_totals table.shop_table_responsive tr > th,
.woocommerce-cart .cart_totals table.shop_table_responsive tr > td {
	display: block;
	width: auto;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: 16px;
	line-height: 1.35;
}
.woocommerce-cart .cart_totals table.shop_table_responsive tr > th {
	color: var(--ufs-muted);
	font-weight: 400;
	text-align: left;
}
.woocommerce-cart .cart_totals table.shop_table_responsive tr > td {
	font-weight: 700;
	text-align: right;
}
.woocommerce-cart .cart_totals table.shop_table_responsive tr > td::before { /* WooCommerce's small-screen labels: the headings are shown */
	display: none;
}

.woocommerce-cart .cart_totals table.shop_table tr.woocommerce-shipping-totals {
	display: block;
}
.woocommerce-cart .cart_totals table.shop_table_responsive tr.woocommerce-shipping-totals > td {
	margin-top: 14px;
	font-weight: 400;
	text-align: left;
}
.woocommerce-cart .cart_totals .ufs-ship-to,
.woocommerce-checkout #order_review .ufs-ship-to {
	display: block;
	color: #3d3a36;
	font-size: 17px;
	font-weight: 700;
}
.woocommerce-cart .cart_totals .ufs-ship-to__hint,
.woocommerce-checkout #order_review .ufs-ship-to__hint {
	display: block;
	margin-top: 6px;
	color: var(--ufs-muted);
	font-size: 15px;
}
.woocommerce-cart .cart_totals tr.woocommerce-shipping-totals:has(.ufs-ship-to) .woocommerce-shipping-destination { /* in the heading */
	display: none;
}
.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
.woocommerce-cart .cart_totals .woocommerce-shipping-calculator {
	margin: 14px 0 0;
	font-size: 14px;
}
.woocommerce-cart .cart_totals .shipping-calculator-button {
	color: var(--ufs-gold-ink);
	font-weight: 600;
}
.woocommerce-cart .cart_totals .shipping-calculator-button:hover {
	color: var(--ufs-ink);
}

.woocommerce-cart .cart_totals table.shop_table_responsive tr.order-total {
	align-items: center;
	padding-top: 22px;
}
.woocommerce-cart .cart_totals table.shop_table_responsive tr.order-total > th {
	color: var(--ufs-ink);
	font-size: 22px;
	font-weight: 700;
}
.woocommerce-cart .cart_totals tr.order-total > td strong {
	font-size: 26px;
	font-weight: 700;
}
.woocommerce-cart .cart_totals tr.order-total .includes_tax {
	display: block;
	margin-top: 4px;
	color: var(--ufs-muted);
	font-size: 14px;
	font-weight: 600;
}
.woocommerce-cart .cart_totals tr.order-total .includes_tax .amount {
	font-weight: inherit;
}

/* "You qualify for free standard delivery." / "Spend $35.00 more ...", under the shipping options (cart and checkout) */
.woocommerce-cart .cart_totals table.shop_table tr.ufs-free-ship,
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.ufs-free-ship {
	display: block;
	padding: 0 0 18px;
	border-top: 0;
}
.woocommerce-cart .cart_totals table.shop_table_responsive tr.ufs-free-ship > td,
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.ufs-free-ship > td {
	font-weight: 600;
	text-align: left;
}
.ufs-free-ship__note {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 14px;
	border-radius: 10px;
	background: var(--ufs-cream);
	color: var(--ufs-gold-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}
.ufs-free-ship__note.is-free {
	background: #eef5ef;
	color: #2f6b45;
}
.ufs-free-ship__note svg {
	flex: none;
	width: 20px;
	height: 20px;
}

/*
 * Checkout's order summary: a card like the cart totals in one column (the theme's two-column table left the shipping
 * options a narrow strip on phones): each product and amount on a row, the delivery heading above full-width options,
 * then the total. "body ... #order_review" outranks the theme's table rules.
 */
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table {
	display: block;
	width: 100%;
	margin: 0 0 32px;
	padding: 4px 20px 22px;
	border: 1px solid var(--ufs-line);
	border-radius: 16px;
	background: #fff;
	color: var(--ufs-ink);
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table thead {
	display: none;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table > tbody,
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table > tfoot {
	display: block;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
	border-top: 1px solid var(--ufs-line);
	background: none;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table > tbody > tr:first-child {
	border-top: 0;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr > th,
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr > td {
	display: block;
	width: auto;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tfoot tr > th {
	color: var(--ufs-muted);
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr:not(.woocommerce-shipping-totals) > td:last-child:not(:first-child) { /* the amounts */
	flex: none;
	font-weight: 700;
	text-align: right;
	white-space: nowrap;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table td.product-name {
	flex: 1;
	min-width: 0;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table td.product-name .product-quantity {
	margin-left: 2px;
	color: var(--ufs-muted);
	font-weight: 600;
	white-space: nowrap;
}

body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals {
	display: block;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals > td {
	margin-top: 14px;
	font-weight: 400;
	text-align: left;
	white-space: normal;
}

body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.order-total {
	align-items: center;
	padding: 22px 0 0;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.order-total > th {
	color: var(--ufs-ink);
	font-size: 22px;
	font-weight: 700;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.order-total > td strong {
	font-size: 26px;
	font-weight: 700;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.order-total .includes_tax { /* "Includes $13.18 GST" */
	display: block;
	margin-top: 2px;
	color: var(--ufs-muted);
	font-size: 14px;
	font-weight: 600;
}
body.woocommerce-checkout #order_review .woocommerce-checkout-review-order-table tr.order-total .includes_tax .amount {
	font-weight: inherit;
}

/*
 * Payment methods: a card like the order summary, each method a row with its radio beside the name and its form
 * (Square's card fields) in a soft panel under it, then a full-width Place order button like the cart's.
 */
body.woocommerce-checkout #order_review #payment {
	border: 1px solid var(--ufs-line);
	border-radius: 16px;
	background: #fff;
	color: var(--ufs-ink);
}
body.woocommerce-checkout #order_review #payment ul.payment_methods {
	margin: 0;
	padding: 6px 20px;
	border-bottom: 1px solid var(--ufs-line);
}
body.woocommerce-checkout #order_review #payment ul.payment_methods > li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 12px;
	margin: 0;
	padding: 16px 0;
	border-top: 1px solid var(--ufs-line);
	line-height: 1.4;
}
body.woocommerce-checkout #order_review #payment ul.payment_methods > li:first-child {
	border-top: 0;
}
body.woocommerce-checkout #order_review #payment ul.payment_methods > li > input[type=radio] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--ufs-gold);
	cursor: pointer;
}
body.woocommerce-checkout #order_review #payment ul.payment_methods > li > label {
	display: flex;
	flex: 1;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	min-width: 0;
	margin: 0;
	padding: 0;
	color: var(--ufs-ink);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}
body.woocommerce-checkout #order_review #payment ul.payment_methods > li > label img {
	margin: 0;
}
body.woocommerce-checkout #order_review #payment div.payment_box {
	flex-basis: 100%;
	margin: 14px 0 0;
	padding: 16px;
	border-radius: 12px;
	background: #f7f4ef;
	color: var(--ufs-muted);
	font-size: 14px;
}
body.woocommerce-checkout #order_review #payment div.payment_box::before,
body.woocommerce-checkout #order_review #payment div.payment_box::after { /* the theme's pointer to the radio */
	content: none;
}
body.woocommerce-checkout #order_review #payment div.payment_box p {
	margin: 0 0 12px;
}
body.woocommerce-checkout #order_review #payment div.payment_box p:last-child {
	margin-bottom: 0;
}
body.woocommerce-checkout #order_review #payment div.payment_box fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}
body.woocommerce-checkout #order_review #payment .place-order {
	margin: 0;
	padding: 20px;
	color: var(--ufs-muted);
	font-size: 14px;
	line-height: 1.55;
}
body.woocommerce-checkout #order_review #payment .place-order .woocommerce-privacy-policy-text p {
	margin: 0 0 14px;
}
body.woocommerce-checkout #order_review #payment .place-order .woocommerce-terms-and-conditions-wrapper {
	margin-bottom: 18px;
	color: var(--ufs-ink);
	font-size: 15px;
}
body.woocommerce-checkout #order_review #payment .place-order .woocommerce-terms-and-conditions-wrapper input[type=checkbox] {
	accent-color: var(--ufs-gold);
}
body.woocommerce-checkout #order_review #payment #place_order {
	display: block;
	float: none;
	width: 100%;
	margin: 0;
	padding: 16px 20px;
	border: 0;
	border-radius: 10px;
	background: var(--ufs-gold);
	box-shadow: none;
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.3;
	text-transform: none;
	transition: background-color .15s;
}
body.woocommerce-checkout #order_review #payment #place_order:hover,
body.woocommerce-checkout #order_review #payment #place_order:focus-visible {
	background: var(--ufs-gold-dark);
	color: #fff;
}
body.woocommerce-checkout #order_review #payment #place_order:focus-visible {
	outline: 2px solid var(--ufs-ink);
	outline-offset: 2px;
}

.woocommerce-cart .cart-collaterals .wc-proceed-to-checkout {
	padding: 8px 0 0;
}
.woocommerce-cart .cart-collaterals .wc-proceed-to-checkout a.checkout-button {
	display: block;
	width: 100%;
	margin: 12px 0 0;
	padding: 16px 20px;
	border: 0;
	border-radius: 10px;
	background: var(--ufs-gold);
	box-shadow: none;
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.3;
	text-align: center;
	text-transform: none;
	transition: background-color .15s;
}
.woocommerce-cart .cart-collaterals .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce-cart .cart-collaterals .wc-proceed-to-checkout a.checkout-button:focus-visible {
	background: var(--ufs-gold-dark);
	color: #fff;
}
.woocommerce-cart .cart-collaterals .wc-proceed-to-checkout a.checkout-button:focus-visible {
	outline: 2px solid var(--ufs-ink);
	outline-offset: 2px;
}
.ufs-secure {
	margin: 12px 0 4px;
	color: var(--ufs-muted, #6b665f);
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}
.ufs-secure svg {
	display: inline-block;
	width: 18px;
	height: 18px;
	margin: -3px 6px 0 0;
	vertical-align: middle;
}

/*
 * Shipping options (cart and checkout): each one a card, the radio inside it and the whole card clickable, the chosen
 * one in gold.
 */
.woocommerce ul#shipping_method:has(.ufs-ship) {
	margin: 0;
	padding: 0;
	list-style: none;
}
.woocommerce ul#shipping_method li:has(.ufs-ship) {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 12px;
	padding: 16px 16px 14px;
	border: 1.5px solid var(--ufs-line);
	border-radius: 14px;
	background: #fff;
	text-indent: 0;
	transition: border-color .15s, background-color .15s;
}
.woocommerce ul#shipping_method li:has(.ufs-ship):last-child {
	margin-bottom: 0;
}
.woocommerce ul#shipping_method li:has(.ufs-ship):hover {
	border-color: #cfc6b8;
}
.woocommerce ul#shipping_method li:has(.ufs-ship):has(> input:checked),
.woocommerce ul#shipping_method li:has(.ufs-ship):only-child {
	border-color: var(--ufs-gold);
	background: var(--ufs-cream);
}
/* Focus on the radio itself: WooCommerce refocuses it after every update, and a ring round the card was clipped */
.woocommerce ul#shipping_method li:has(.ufs-ship) > input[type=radio]:focus {
	outline: none;
}
.woocommerce ul#shipping_method li:has(.ufs-ship) > input[type=radio]:focus-visible {
	outline: 2px solid var(--ufs-gold);
	outline-offset: 2px;
}
.woocommerce ul#shipping_method li:has(.ufs-ship) > input[type=radio] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 8px 0 0;
	accent-color: var(--ufs-gold);
	cursor: pointer;
}
.woocommerce ul#shipping_method li:has(.ufs-ship) > label {
	display: block;
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0;
	cursor: pointer;
}
.woocommerce ul#shipping_method li:has(.ufs-ship) > label::after { /* the whole card selects it */
	content: "";
	position: absolute;
	inset: 0;
}

.ufs-ship {
	--ufs-c: #dc1928;      /* Australia Post red */
	--ufs-on: #fff;
	--ufs-bar: #dc1928;
	display: block;
	color: var(--ufs-ink, #1a1a1a);
	font-weight: 400;
	line-height: 1.35;
	text-align: left;
}
.ufs-ship--express {
	--ufs-c: #ffcc00;      /* Australia Post yellow */
	--ufs-on: #1a1a1a;
	--ufs-bar: #e8b800;
}
.ufs-ship__head {
	display: flex;
	align-items: center;
	gap: 10px;
}
.ufs-ship__title { /* the tag goes under the name when they don't fit beside the price */
	display: flex;
	flex: 1;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	min-width: 0;
}
.ufs-ship__badge {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--ufs-c);
	color: var(--ufs-on);
}
.ufs-ship__svg {
	display: block;
	width: 20px;
	height: 20px;
}
.ufs-ship__name {
	font-size: 17px;
	font-weight: 700;
}
.ufs-ship__tag {
	padding: 4px 10px;
	border-radius: 999px;
	background: #1a1a1a;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.2;
	text-transform: uppercase;
	white-space: nowrap;
}
.ufs-ship__price {
	align-self: flex-start;
	margin-top: 7px;
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
}
.ufs-ship__price--free {
	letter-spacing: .02em;
	text-transform: uppercase;
}
.ufs-ship__when {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 4px 16px;
	margin-top: 10px;
}
.ufs-ship__dispatch {
	color: var(--ufs-muted, #6b665f);
	font-size: 14px;
}
.ufs-ship__dispatch > span { /* "Dispatches today ·" and "1–2 business days" wrap whole */
	white-space: nowrap;
}
.ufs-ship__arrive {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin-left: auto;
	text-align: right;
}
.ufs-ship__arrive-label {
	color: #4a4741;
	font-size: 13px;
}
.ufs-ship__arrive strong {
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
}
/* Business days from today, one step each (both options on one scale); filled on the days it can arrive */
.ufs-ship__track {
	position: relative;
	display: block;
	height: 6px;
	margin-top: 12px;
	border-radius: 3px;
	background: repeating-linear-gradient(90deg, transparent 0 calc(var(--ufs-step) - 2px), #fff calc(var(--ufs-step) - 2px) var(--ufs-step)), #ebe6dd;
}
.ufs-ship__track::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--ufs-from);
	width: calc(var(--ufs-to) - var(--ufs-from));
	border-radius: 3px;
	background: var(--ufs-bar);
}

@media (max-width: 767px) {
	.woocommerce-cart .cart-collaterals .cart_totals {
		padding: 22px 18px;
	}
	.woocommerce ul#shipping_method li:has(.ufs-ship) {
		gap: 10px;
		padding: 14px 14px 12px 12px;
	}
	.ufs-ship__name,
	.ufs-ship__price {
		font-size: 16px;
	}
	/* Phones: the arrival dates first, on one line, then when it's dispatched, all left-aligned under the name */
	.ufs-ship__when {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		margin-top: 12px;
	}
	.ufs-ship__arrive {
		order: -1;
		flex-direction: row;
		align-items: baseline;
		gap: 6px;
		margin-left: 0;
		text-align: left;
	}
	.ufs-ship__arrive-label {
		font-size: 14px;
	}
	.ufs-ship__dispatch {
		font-size: 13.5px;
	}
	.ufs-ship__track {
		margin-top: 14px;
	}
	/* and across the card from the radio's edge, so the dispatch line fits on one line */
	.ufs-ship__when,
	.ufs-ship__track {
		margin-left: -30px;
	}
}

/* Wider screens: the dates and bar line up under the option's name */
@media (min-width: 768px) {
	.ufs-ship__when,
	.ufs-ship__track {
		margin-left: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.woocommerce ul#shipping_method li:has(.ufs-ship),
	.woocommerce-cart .cart-collaterals .wc-proceed-to-checkout a.checkout-button,
	body.woocommerce-checkout #order_review #payment #place_order {
		transition: none;
	}
}
