/*
 * WooCommerce checkout place-order refinements.
 *
 * Loaded only on checkout pages to keep Core Web Vitals impact minimal.
 */

body.woocommerce-checkout #payment .place-order {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}

body.woocommerce-checkout #payment .place-order #place_order,
body.woocommerce-checkout #payment #place_order,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button {
	float: none;
	width: 100%;
	box-shadow: none;
	transform: none;
}

body.woocommerce-checkout #payment .place-order #place_order:hover,
body.woocommerce-checkout #payment .place-order #place_order:focus-visible,
body.woocommerce-checkout #payment #place_order:hover,
body.woocommerce-checkout #payment #place_order:focus-visible,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:focus-visible,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button:hover,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button:focus-visible {
	box-shadow: none;
	transform: none;
}

/* Responsive decorative SVG lock icon before the Place Order text. */
body.woocommerce-checkout {
	--rir-theme-place-order-lock-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20d%3D%27M17%209V7A5%205%200%200%200%207%207v2H6a2%202%200%200%200-2%202v8a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-8a2%202%200%200%200-2-2h-1Zm-8%200V7a3%203%200%200%201%206%200v2H9Zm3%204a1.25%201.25%200%200%201%20.75%202.25V17a.75.75%200%200%201-1.5%200v-1.75A1.25%201.25%200%200%201%2012%2013Z%27%2F%3E%3C%2Fsvg%3E");
}

body.woocommerce-checkout #payment .place-order #place_order,
body.woocommerce-checkout #payment #place_order,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
}

body.woocommerce-checkout #payment .place-order #place_order::before,
body.woocommerce-checkout #payment #place_order::before,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button::before,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	flex: 0 0 1em;
	background-color: currentColor;
	-webkit-mask: var(--rir-theme-place-order-lock-icon) center / contain no-repeat;
	mask: var(--rir-theme-place-order-lock-icon) center / contain no-repeat;
}

@media (max-width: 480px) {
	body.woocommerce-checkout #payment .place-order #place_order,
	body.woocommerce-checkout #payment #place_order,
	body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
	body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button {
		gap: 0.45em;
	}

	body.woocommerce-checkout #payment .place-order #place_order::before,
	body.woocommerce-checkout #payment #place_order::before,
	body.woocommerce-checkout .wc-block-components-checkout-place-order-button::before,
	body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button::before {
		width: 0.95em;
		height: 0.95em;
		flex-basis: 0.95em;
	}
}

/* Secure note: icon + text close together and centered */
.rir-theme-secure-note--checkout[data-rir-theme-secure-note="1"] {
	display: grid !important;
	grid-template-columns: 16px auto !important;
	column-gap: 4px !important;

	justify-content: center !important;
	align-items: start !important;

	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;

	margin-top: 4px !important;
	margin-bottom: 0 !important;
	margin-left: auto !important;
	margin-right: auto !important;

	padding: 0 !important;

	line-height: 1.35 !important;
	text-align: left !important;
}

/* Icon aligned with first line */
.rir-theme-secure-note--checkout[data-rir-theme-secure-note="1"] .rir-theme-secure-note__icon {
	width: 16px !important;
	height: 16px !important;
	margin: 1px 0 0 0 !important;

	position: static !important;
	display: block !important;

	flex: none !important;
}

/* Text stays close and wraps normally */
.rir-theme-secure-note--checkout[data-rir-theme-secure-note="1"] .rir-theme-secure-note__text {
	display: block !important;
	width: auto !important;
	max-width: 100% !important;
	min-width: 0 !important;

	margin: 0 !important;
	padding: 0 !important;

	text-align: left !important;
}

body.woocommerce-checkout .wc-block-checkout__actions_row {
	flex-wrap: wrap;
}

body.woocommerce-checkout .wc-block-checkout__actions_row .rir-theme-secure-note--checkout {
	order: 2;
	flex: 0 0 100%;
}

/*
 * WooCommerce Blocks checkout: stack the place-order action row full-width.
 *
 * This mirrors the requested checkout-only block layout while keeping the CSS
 * isolated to the checkout stylesheet for better front-end performance.
 */
.wc-block-checkout__actions_row.wc-block-checkout__actions_row--justify-flex-end {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	justify-content: center !important;
	width: 100% !important;
	gap: 4px !important;
}

/* WooCommerce Blocks checkout: center secure note below the place-order button. */
body.woocommerce-checkout .wc-block-checkout__actions_row.wc-block-checkout__actions_row--justify-flex-end .rir-theme-secure-note--checkout {
	display: block !important;
	width: 100% !important;
	margin: 0 auto !important;
	text-align: center !important;
	line-height: 1.35 !important;
}

body.woocommerce-checkout .wc-block-checkout__actions_row.wc-block-checkout__actions_row--justify-flex-end .rir-theme-secure-note--checkout .rir-theme-secure-note__icon {
	display: inline-block !important;
	vertical-align: -3px !important;
	margin-right: 6px !important;
}

body.woocommerce-checkout .wc-block-checkout__actions_row.wc-block-checkout__actions_row--justify-flex-end .rir-theme-secure-note--checkout .rir-theme-secure-note__text {
	display: inline !important;
	text-align: center !important;
	font-weight: 500 !important;
}


/* Keep checkout payment CTAs aligned with the theme-wide requested radius. */
body.woocommerce-checkout #payment .place-order #place_order,
body.woocommerce-checkout #payment #place_order,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button {
	border-radius: 4px !important;
}


/* Purchase-flow button text: requested slightly larger place-order labels. */
body.woocommerce-checkout #payment .place-order #place_order,
body.woocommerce-checkout #payment #place_order,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button {
	font-size: clamp(15px, calc(var(--rir-theme-button-font-size, 14px) + 1px), 17px);
	font-weight: var(--rir-theme-button-font-weight, 800);
	line-height: 1.18;
}

@media (max-width: 760px) {
	body.woocommerce-checkout #payment .place-order #place_order,
	body.woocommerce-checkout #payment #place_order,
	body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
	body.woocommerce-checkout .wc-block-components-button.wc-block-components-checkout-place-order-button {
		font-size: clamp(15.5px, calc(var(--rir-theme-button-font-size, 14px) + 1.25px), 17px);
	}
}

