/**
 * RestroPress checkout UX (3.5): minimum-order hint, service switch note,
 * inline validation messages and mobile polish for the redesigned checkout.
 *
 * Loads after assets/css/rpress-checkout.css. The redesigned checkout leaks
 * styles from the legacy rpress.css on any property it does not declare, so
 * every box here declares its display, margin, padding, border, background,
 * width and font explicitly. Checkout rules reuse the double-id scope of
 * rpress-checkout.css so they win without !important where possible.
 */

/* Screen-reader-only live region. */
.rpress-cux-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
}

/* ------------------------------------------------------------------ */
/* Minimum-order hint (shared look)                                     */
/* ------------------------------------------------------------------ */
.rpress-cux-min-hint {
	box-sizing: border-box;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	margin: 0 0 12px;
	padding: 10px 12px;
	border: 1px solid #f5c26b;
	border-radius: 10px;
	background: #fff8eb;
	color: #7a4b00;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	text-align: start;
	float: none;
	position: static;
	box-shadow: none;
}
.rpress-cux-min-hint .rpress-cux-min-icon {
	display: inline-flex;
	flex: none;
	margin: 1px 0 0;
	padding: 0;
	color: #b26a00;
}
.rpress-cux-min-hint .rpress-cux-min-text {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow-wrap: anywhere;
}
.rpress-cux-min-hint .rpress-cux-min-msg {
	font-weight: 600;
	color: #5c3800;
}
.rpress-cux-min-hint .rpress-cux-min-detail {
	color: #7a4b00;
}

/* Sidebar cart: sits above the totals area. */
.rpress-sidebar-cart-wrap .rpress-cux-min-hint.is-cart {
	margin: 12px 0;
}

/* Mobile cart bar: one compact line under the total. */
.rpress-mobile-cart-icons .rpress-cux-min-hint.is-bar {
	display: block;
	width: auto;
	margin: 4px 0 0;
	padding: 3px 8px;
	border: 0;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.92);
	color: #5c3800;
	font-size: 11.5px;
	line-height: 1.3;
}
.rpress-mobile-cart-icons .rpress-cux-min-hint.is-bar .rpress-cux-min-icon,
.rpress-mobile-cart-icons .rpress-cux-min-hint.is-bar .rpress-cux-min-detail {
	display: none;
}
.rpress-mobile-cart-icons .rpress-cux-min-hint.is-bar .rpress-cux-min-text {
	display: inline;
}

/* ------------------------------------------------------------------ */
/* Checkout                                                             */
/* ------------------------------------------------------------------ */
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap .rpress-cux-min-hint.is-checkout {
	margin: 0 0 12px;
	font-family: var(--rpc-font-body, inherit);
}
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap .rpress-checkout-sticky-bar .rpress-cux-min-hint.is-sbar {
	margin: 0 0 10px;
	padding: 8px 10px;
	font-family: var(--rpc-font-body, inherit);
	font-size: 12.5px;
}

/* Place order while below the minimum. */
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap #rpress-purchase-button.rpress-cux-blocked,
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap .rpress-sbar-button.rpress-cux-blocked {
	opacity: 0.55;
	cursor: not-allowed;
	box-shadow: none;
}

/* Service switch note: what the change did to the total. */
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap #rpress_checkout_order_details .rpress-cux-switch-note {
	box-sizing: border-box;
	display: block;
	grid-column: 1 / -1;
	width: 100%;
	margin: 0 0 12px;
	padding: 8px 12px;
	border: 1px solid var(--rpc-border-subtle, #eae8e7);
	border-radius: 10px;
	background: var(--rpc-surface, #fafafa);
	color: var(--rpc-ink, #000f37);
	font: 500 13px/1.4 var(--rpc-font-body, inherit);
	text-align: start;
}
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap #rpress_checkout_order_details .rpress-cux-switch-note.is-less {
	border-color: #bfe5c8;
	background: var(--rpc-success-bg, #e7f6ec);
}

/* Inline validation message (our copy of the core .rpress-field-error). */
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap .rpress-cux-field-error {
	display: block;
	width: 100%;
	margin: 6px 0 0;
	padding: 0;
	border: 0;
	background: none;
	font: 500 12px/1.4 var(--rpc-font-body, inherit);
	color: var(--rpc-danger, #e5402b);
	text-align: start;
}
body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap .rpress-checkout-error-banner .rpress-cux-banner-icon {
	display: inline-flex;
	flex: none;
	margin: 0;
	padding: 0;
}

/* ------------------------------------------------------------------ */
/* Mobile (matches the 782px breakpoint used by rp-checkout-ui.js)      */
/* ------------------------------------------------------------------ */
@media (max-width: 782px) {
	/* No sideways page scroll from wide children (long totals, gateway
	   badges). clip, unlike hidden, keeps position: sticky working. */
	body.rpress-checkout {
		overflow-x: clip;
	}
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap #rpress_checkout_form_wrap,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap #rpress_checkout_cart_form {
		min-width: 0;
		max-width: 100%;
	}
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap input.rpress-input,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap select,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap textarea {
		box-sizing: border-box;
		max-width: 100%;
	}

	/* The sticky bar carries the hint on mobile; hide the in-form copy. */
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-has-sticky-bar #rpress-cux-min-hint {
		display: none;
	}
	/* Room for the taller bar while the hint shows (core reserves 160px). */
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2.rpress-has-sticky-bar.rpress-cux-below-min {
		padding-bottom: 210px !important;
	}

	/* Tap targets: at least 44px tall. */
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 .rpress-sbar-button {
		box-sizing: border-box;
		min-height: 48px;
	}
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 .rpress-mobile-summary-toggle,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 #rpressdeliveryTab .nav-link,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 #rpress-payment-mode-wrap label.rpress-gateway-option {
		box-sizing: border-box;
		min-height: 48px;
	}
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 .rpress-coupon-toggle,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 #rpress-discount-code-submit,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 .rpress-checkout-sticky-bar button {
		min-height: 44px;
	}
	/* 16px inputs stop iOS Safari from zooming the page on focus. */
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 input.rpress-input,
	body.rpress-checkout #rpress_checkout_wrap#rpress_checkout_wrap#rpress_checkout_wrap.rpress-checkout-v2 textarea.rpress-input {
		font-size: 16px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rpress-cux-min-hint,
	.rpress-cux-switch-note {
		transition: none;
		animation: none;
	}
}

/* Theme back-to-top buttons (Astra, GeneratePress, Kadence) are fixed to the
   bottom corner and sat on top of the sticky Place order bar on phones. */
@media (max-width: 782px) {
	body.rpress-checkout #ast-scroll-top,
	body.rpress-checkout .generate-back-to-top,
	body.rpress-checkout #kt-scroll-up {
		bottom: 176px !important;
	}
}
