.hsc-free-label {
	display: inline-block;
	margin-left: 5px;
	color: inherit;
	font-weight: 600;
	white-space: nowrap;
}

/* --------------------------------------------------------
 * ORDER REVIEW — SUBTOTAL / COUPON / SHIPPING SECTION
 * -------------------------------------------------------- */

.woocommerce-checkout-review-order-table tr.cart-subtotal th,
.woocommerce-checkout-review-order-table tr.cart-subtotal td,
.woocommerce-checkout-review-order-table tr.cart-discount th,
.woocommerce-checkout-review-order-table tr.cart-discount td,
.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td,
.woocommerce-checkout-review-order-table tr.shipping th,
.woocommerce-checkout-review-order-table tr.shipping td {
	font-family: inherit !important;
}

.woocommerce-checkout-review-order-table tr.cart-discount th {
	text-transform: none !important;
	color: inherit !important;
	font-weight: 600 !important;
}

.woocommerce-checkout-review-order-table tr.cart-discount th .hsc-coupon-name {
	color: #008000 !important;
	font-weight: 600 !important;
}

.woocommerce-checkout-review-order-table tr.cart-discount td {
	color: #008000 !important;
	font-weight: 600 !important;
}

.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th {
	text-transform: none !important;
	color: inherit !important;
	font-weight: 600 !important;
}

.woocommerce-checkout-review-order-table ul#shipping_method li {
	padding: 6px 0 !important;
}

.woocommerce-checkout-review-order-table tr.order-total th,
.woocommerce-checkout-review-order-table tr.order-total td {
	padding-top: 16px !important;
	font-size: 17px !important;
	font-weight: 700 !important;
	border-top: 2px solid #000000 !important;
}

/*
 * Shipping method labels may wrap between words when they do not fit, so
 * they never stick out of the table. The price stays together with the
 * last word ("3-5d · 10,00 €"): hsc_shipping_method_full_label() joins
 * them with non-breaking spaces, and the amount never wraps inside.
 */
.woocommerce-checkout-review-order-table ul#shipping_method li label,
.woocommerce-checkout-review-order-table ul#shipping_method li label * {
	white-space: normal !important;
	overflow-wrap: normal !important;
	word-wrap: normal !important;
	word-break: normal !important;
	hyphens: none !important;
}

.woocommerce-checkout-review-order-table ul#shipping_method li label .amount,
.woocommerce-checkout-review-order-table ul#shipping_method li label .amount * {
	white-space: nowrap !important;
}

/*
 * Flex trick: the <li> holding the Sendcloud button becomes a flex row,
 * and ::after (flex-basis 100%, order 2) forces a line break so the
 * button (order 3, below) drops to its own row, right-aligned.
 */
.woocommerce-checkout-review-order-table ul#shipping_method li:has(#sendcloudshipping_service_point_select) {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	justify-content: flex-end !important;
}

.woocommerce-checkout-review-order-table ul#shipping_method li:has(#sendcloudshipping_service_point_select)::after {
	content: "";
	flex-basis: 100% !important;
	order: 2 !important;
}

/* Neutralize Avada's "form.checkout .shop_table tfoot td { width: 40% }" (max-width: 800px),
   which squeezes the whole totals block into 40% of the row below 800px */
@media (max-width: 800px) {
	form.checkout .shop_table.woocommerce-checkout-review-order-table > tfoot > tr > td {
		width: 100% !important;
	}
}

/* --------------------------------------------------------
 * SENDCLOUD "SELECT SERVICE POINT" BUTTON — single canonical
 * style block: base look, position in the shipping list,
 * responsive sizing.
 * -------------------------------------------------------- */

#sendcloudshipping_service_point_select {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	min-width: 0 !important;
	min-height: 34px !important;
	margin: 7px 0 3px 0 !important;
	padding: 8px 18px !important;
	background: #000 !important;
	color: #fff !important;
	border: 1px solid #000 !important;
	border-radius: 20px !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 11px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	white-space: nowrap !important;
	cursor: pointer !important;
}

#sendcloudshipping_service_point_select:hover,
#sendcloudshipping_service_point_select:focus {
	background: #222 !important;
	color: #fff !important;
	border-color: #222 !important;
	box-shadow: none !important;
}

/* Inside the checkout shipping list: own row, right-aligned (see the flex trick above) */
.woocommerce-checkout-review-order-table #shipping_method #sendcloudshipping_service_point_select {
	order: 3 !important;
	width: fit-content !important;
	margin-top: 8px !important;
	margin-left: auto !important;
	margin-right: 0 !important;
}

.woocommerce-checkout-review-order-table #shipping_method li:has(#sendcloudshipping_service_point_select) {
	padding-bottom: 5px !important;
}

/*
 * Chosen pickup point (Sendcloud fills #sendcloudshipping_service_point_selected_label):
 * on its own line under the method name, right-aligned, above the button.
 * Without an order it stayed on the first line of the flex row, squeezed
 * next to "GLS Parcelshop 3-5d FREE". Hidden while empty, so it adds no
 * gap before a point is chosen.
 */
.woocommerce-checkout-review-order-table #shipping_method #sendcloudshipping_service_point_selected_label {
	order: 2 !important;
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 4px 0 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	color: #555555 !important;
	font-size: 13px !important;
	line-height: 1.4 !important;
	text-align: right !important;
	white-space: normal !important;
}

.woocommerce-checkout-review-order-table #shipping_method #sendcloudshipping_service_point_selected_label:empty {
	display: none !important;
}

/* With a point shown, it already starts a new line: the line-break helper would only add an empty one. */
.woocommerce-checkout-review-order-table ul#shipping_method li:has(#sendcloudshipping_service_point_selected_label:not(:empty))::after {
	display: none !important;
}

/*
 * Chosen point as a card (HSC > Checkout > Shipping > "Show the chosen
 * point as a card"): checkout-validation.js adds hsc-sp-chosen to the
 * method row once a point is chosen, and hsc-sp-button + data-hsc-change
 * (Texts: servicePointChange) to Sendcloud's button. Sendcloud's own
 * button text is hidden, never rewritten.
 */
.woocommerce-checkout-review-order-table #shipping_method li.hsc-sp-chosen #sendcloudshipping_service_point_selected_label {
	margin: 8px 0 0 !important;
	padding: 10px 12px !important;
	border: 1px solid #000 !important;
	border-radius: 8px !important;
	background: #fff !important;
	color: #000 !important;
	text-align: left !important;
}

.woocommerce-checkout-review-order-table #shipping_method li.hsc-sp-chosen #sendcloudshipping_service_point_selected_label b {
	font-weight: 600 !important;
}

.woocommerce-checkout-review-order-table #shipping_method li.hsc-sp-chosen #sendcloudshipping_service_point_select.hsc-sp-button[data-hsc-change] {
	background: #fff !important;
	color: #000 !important;
	font-size: 0 !important;
}

.woocommerce-checkout-review-order-table #shipping_method li.hsc-sp-chosen #sendcloudshipping_service_point_select.hsc-sp-button[data-hsc-change]::after {
	content: attr(data-hsc-change);
	font-size: 11px;
	line-height: 1;
}

.woocommerce-checkout-review-order-table #shipping_method li.hsc-sp-chosen #sendcloudshipping_service_point_select.hsc-sp-button[data-hsc-change]:hover,
.woocommerce-checkout-review-order-table #shipping_method li.hsc-sp-chosen #sendcloudshipping_service_point_select.hsc-sp-button[data-hsc-change]:focus {
	background: #f2f2f2 !important;
	color: #000 !important;
}

@media (max-width: 640px) {
	#sendcloudshipping_service_point_select {
		font-size: 10px !important;
		min-height: 32px !important;
		padding: 7px 14px !important;
	}

	.woocommerce-checkout-review-order-table #shipping_method li.hsc-sp-chosen #sendcloudshipping_service_point_select.hsc-sp-button[data-hsc-change]::after {
		font-size: 10px;
	}
}

/* --------------------------------------------------------
 * FREE SHIPPING COUNTDOWN BOX (section 4)
 *
 * The negative top margins pull the box up under the
 * "Select Service Point" button above. They depend on the
 * button's margins/padding: if those change, adjust these too.
 * -------------------------------------------------------- */

.hsc-free-shipping-row td {
	padding: 0 0 10px !important;
	border: 0 !important;
}

.hsc-free-shipping-box {
	display: block;
	position: relative;
	width: 100%;
	box-sizing: border-box;
	margin-top: -22px;
	margin-bottom: 0;
	padding: 10px 14px;
	background-color: #F3FCE6;
	border: 1px solid #C4F280;
	border-radius: 5px;
	color: #000000;
	font-family: "Poppins", sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	text-align: center;
}

.hsc-free-shipping-box strong {
	color: #000000;
	font-weight: 600;
}

/* Countdown, bar style: the side cart bar (free-shipping.css) in the place of the box */
.hsc-fsb--checkout {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	margin-top: -22px;
	padding: 10px 14px;
	background: #f4f4f4;
	border-radius: 5px;
	font-family: "Poppins", sans-serif;
}

.hsc-fsb--checkout.is-reached {
	background: #C4F280;
}

.hsc-fsb--checkout.is-reached .hsc-fsb__fill {
	background: #000;
}

body.woocommerce-cart .hsc-fsb--checkout {
	margin-top: -34px;
}

@media (max-width: 600px) {
	.hsc-fsb--checkout {
		margin-top: -18px;
		padding: 9px 10px;
	}

	.hsc-fsb--checkout .hsc-fsb__text {
		font-size: 12px;
	}

	body.woocommerce-cart .hsc-fsb--checkout {
		margin-top: -28px;
	}
}

/* Cart page: the box needs to come up a bit more */
body.woocommerce-cart .hsc-free-shipping-box {
	margin-top: -34px;
}

@media (max-width: 600px) {
	.hsc-free-shipping-row td {
		padding-bottom: 8px !important;
	}

	.hsc-free-shipping-box {
		margin-top: -18px;
		padding: 9px 10px;
		font-size: 12px;
	}

	body.woocommerce-cart .hsc-free-shipping-box {
		margin-top: -28px;
	}
}

/* --------------------------------------------------------
 * MOBILE: stack the shipping row vertically, labels left,
 * shipping options right
 *
 * Same 800px breakpoint as "HSC – Cart & checkout customizations"
 * and "HSC – Checkout form" (it used to be 768px here, so between
 * 769 and 799px this snippet applied its desktop layout to rows the
 * other one had already switched to mobile). Keep the three in sync.
 * -------------------------------------------------------- */
@media (max-width: 799px) {

	.woocommerce-checkout-review-order-table tr.cart-subtotal th,
	.woocommerce-checkout-review-order-table tr.cart-discount th,
	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
	.woocommerce-checkout-review-order-table tr.shipping th,
	.woocommerce-checkout-review-order-table tr.order-total th {
		text-align: left !important;
		padding-right: 0 !important;
	}

	.woocommerce-checkout-review-order-table .awb-cart-totals-table,
	.woocommerce-checkout-review-order-table .awb-cart-totals-table tbody {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	.woocommerce-checkout-review-order-table tr.cart-subtotal,
	.woocommerce-checkout-review-order-table tr.cart-discount,
	.woocommerce-checkout-review-order-table tr.order-total {
		display: flex !important;
		justify-content: space-between !important;
		align-items: baseline !important;
		width: 100% !important;
	}

	.woocommerce-checkout-review-order-table tr.cart-subtotal th,
	.woocommerce-checkout-review-order-table tr.cart-subtotal td,
	.woocommerce-checkout-review-order-table tr.cart-discount th,
	.woocommerce-checkout-review-order-table tr.cart-discount td,
	.woocommerce-checkout-review-order-table tr.order-total th,
	.woocommerce-checkout-review-order-table tr.order-total td {
		display: block !important;
		width: auto !important;
		margin: 0 !important;
		padding: 8px 0 !important;
		box-sizing: border-box !important;
	}

	.woocommerce-checkout-review-order-table tr.order-total {
		border-top: 2px solid #000000 !important;
		padding-top: 16px !important;
	}

	.woocommerce-checkout-review-order-table tr.order-total th,
	.woocommerce-checkout-review-order-table tr.order-total td {
		border-top: none !important;
		padding-top: 0 !important;
	}

	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals,
	.woocommerce-checkout-review-order-table tr.shipping {
		display: block !important;
		width: 100% !important;
	}

	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td,
	.woocommerce-checkout-review-order-table tr.shipping th,
	.woocommerce-checkout-review-order-table tr.shipping td {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 8px 0 !important;
		box-sizing: border-box !important;
	}

	.woocommerce-checkout-review-order-table tr.shipping td,
	.woocommerce-checkout-review-order-table tr.shipping td > * {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}

	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
	.woocommerce-checkout-review-order-table tr.shipping th {
		padding-top: 14px !important;
		padding-bottom: 8px !important;
	}

	.woocommerce-checkout-review-order-table ul#shipping_method {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.woocommerce-checkout-review-order-table ul#shipping_method li {
		display: flex !important;
		flex-wrap: wrap !important;
		align-items: center !important;
		justify-content: flex-end !important;
		width: 100% !important;
		max-width: 100% !important;
		gap: 8px !important;
		margin: 10px 0 !important;
		padding: 0 !important;
		text-align: right !important;
	}

	.woocommerce-checkout-review-order-table ul#shipping_method input {
		flex: 0 0 auto !important;
		margin: 0 !important;
	}

	/* Shrinks next to the radio (and wraps) instead of pushing out of the row. */
	.woocommerce-checkout-review-order-table ul#shipping_method label {
		flex: 0 1 auto !important;
		min-width: 0 !important;
		max-width: calc(100% - 24px) !important; /* room for the radio + gap */
		margin: 0 !important;
		text-align: right !important;
	}
}

/* --------------------------------------------------------
 * DESKTOP ONLY: right-align labels toward the value column
 * (same 800px breakpoint as the mobile block above)
 * -------------------------------------------------------- */
@media (min-width: 800px) {
	.woocommerce-checkout-review-order-table tr.cart-subtotal th,
	.woocommerce-checkout-review-order-table tr.cart-discount th,
	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
	.woocommerce-checkout-review-order-table tr.order-total th {
		text-align: right !important;
		padding-right: 12px !important;
	}

	.woocommerce-checkout-review-order-table tr.cart-subtotal td,
	.woocommerce-checkout-review-order-table tr.cart-discount td,
	.woocommerce-checkout-review-order-table tr.order-total td {
		text-align: right !important;
	}

	.woocommerce-checkout-review-order-table tr.cart-discount th {
		white-space: nowrap !important;
	}

	/*
	 * Shipping options below the "Shipment" title, across the whole width
	 * of the summary and right-aligned, as on mobile: method names can be
	 * as long as needed (one wider than the summary still wraps).
	 *
	 * For that the totals table (Avada's .awb-cart-totals-table) becomes a
	 * list of rows, as on mobile. The other rows keep the desktop look:
	 * two equal columns, label right-aligned next to its amount.
	 */
	.woocommerce-checkout-review-order-table > tfoot > tr:has(.awb-cart-totals-table),
	.woocommerce-checkout-review-order-table > tfoot > tr > td:has(.awb-cart-totals-table),
	.woocommerce-checkout-review-order-table .awb-cart-totals-table,
	.woocommerce-checkout-review-order-table .awb-cart-totals-table tbody {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}

	/* Every other totals row (subtotal, coupons, fees, taxes, total): two columns. */
	.woocommerce-checkout-review-order-table .awb-cart-totals-table tr:not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row),
	.woocommerce-checkout-review-order-table > tfoot > tr:not(:has(.awb-cart-totals-table)):not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row) {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
		align-items: baseline;
		width: 100% !important;
	}

	.woocommerce-checkout-review-order-table .awb-cart-totals-table tr:not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row) > th,
	.woocommerce-checkout-review-order-table > tfoot > tr:not(:has(.awb-cart-totals-table)):not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row) > th,
	.woocommerce-checkout-review-order-table .awb-cart-totals-table tr:not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row) > td,
	.woocommerce-checkout-review-order-table > tfoot > tr:not(:has(.awb-cart-totals-table)):not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row) > td {
		display: block !important;
		width: auto !important;
		box-sizing: border-box !important;
	}

	/* A row with a single cell takes both columns. */
	.woocommerce-checkout-review-order-table .awb-cart-totals-table tr:not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row) > :only-child,
	.woocommerce-checkout-review-order-table > tfoot > tr:not(:has(.awb-cart-totals-table)):not(.woocommerce-shipping-totals):not(.shipping):not(.hsc-free-shipping-row) > :only-child {
		grid-column: 1 / -1;
	}

	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals,
	.woocommerce-checkout-review-order-table tr.shipping,
	.woocommerce-checkout-review-order-table tr.hsc-free-shipping-row {
		display: block !important;
		width: 100% !important;
	}

	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td,
	.woocommerce-checkout-review-order-table tr.shipping th,
	.woocommerce-checkout-review-order-table tr.shipping td,
	.woocommerce-checkout-review-order-table tr.hsc-free-shipping-row td {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		box-sizing: border-box !important;
	}

	/* "Shipment" stays where the other labels are: right edge of the first column. */
	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
	.woocommerce-checkout-review-order-table tr.shipping th {
		width: 50% !important;
	}

	/* Options right under the title: no space below the title nor above the list. */
	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
	.woocommerce-checkout-review-order-table tr.shipping th {
		padding-bottom: 2px !important;
	}

	.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td,
	.woocommerce-checkout-review-order-table tr.shipping td {
		padding-top: 0 !important;
	}

	/*
	 * Order total: the black line goes on the whole row, not on each cell.
	 * "Total" and the amount have different font sizes and are lined up on
	 * their text, so lines drawn on each cell would sit at different heights.
	 * Same as on mobile.
	 */
	.woocommerce-checkout-review-order-table tr.order-total {
		border-top: 2px solid #000000 !important;
		padding-top: 16px !important;
	}

	.woocommerce-checkout-review-order-table tr.order-total th,
	.woocommerce-checkout-review-order-table tr.order-total td {
		border-top: none !important;
		padding-top: 0 !important;
	}

	.woocommerce-checkout-review-order-table tr.shipping td > * {
		max-width: 100% !important;
		box-sizing: border-box !important;
	}

	.woocommerce-checkout-review-order-table ul#shipping_method {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* One option per line: radio + name, pushed to the right edge. */
	.woocommerce-checkout-review-order-table ul#shipping_method li {
		display: flex !important;
		flex-wrap: wrap !important;
		align-items: center !important;
		justify-content: flex-end !important;
		gap: 8px !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		box-sizing: border-box !important;
		text-align: right !important;
	}

	.woocommerce-checkout-review-order-table ul#shipping_method input {
		flex: 0 0 auto !important;
		margin: 0 !important;
	}

	/* Shrinks next to the radio (and wraps) instead of pushing out of the row. */
	.woocommerce-checkout-review-order-table ul#shipping_method label {
		flex: 0 1 auto !important;
		min-width: 0 !important;
		max-width: calc(100% - 24px) !important; /* room for the radio + gap */
		margin: 0 !important;
		text-align: right !important;
	}
}

/*
 * Small screens: "Close" bar on top of Sendcloud's full-screen pickup
 * point map (assets/js/sendcloud-bridge.js, switch in HSC > Checkout >
 * Shipping). Since 1.10.3. Sendcloud shows its phone layout (no "×") up
 * to at least 768px and its wide layout (with "×") at 800px, so the bar
 * is shown below 800px. Wide screens keep Sendcloud's own "×".
 */
.hsc-sp-close-bar {
	display: none;
}

@media (max-width: 799px) {
	.hsc-sp-overlay {
		display: flex !important;
		flex-direction: column !important;
		background: #fff !important;
	}

	.hsc-sp-overlay .hsc-sp-close-bar {
		display: flex;
		flex: 0 0 auto;
		align-items: center;
		justify-content: flex-end;
		min-height: 48px;
		padding: 0 8px;
		background: #fff;
		border-bottom: 1px solid #e2e2e2;
		box-sizing: border-box;
	}

	.hsc-sp-overlay > iframe {
		flex: 1 1 0 !important;
		width: 100% !important;
		height: auto !important;
		min-height: 0 !important;
	}

	.hsc-sp-overlay .hsc-sp-close {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		min-height: 44px;
		padding: 0 12px;
		margin: 0;
		border: 0;
		background: transparent;
		color: #000;
		font-family: inherit;
		font-size: 15px;
		font-weight: 600;
		line-height: 1;
		cursor: pointer;
	}

	.hsc-sp-overlay .hsc-sp-close span {
		font-size: 22px;
		font-weight: 400;
	}

	.hsc-sp-overlay .hsc-sp-close:focus-visible {
		outline: 2px solid #000;
		outline-offset: 2px;
	}
}
