/* RarezPoints – checkout (block + classic). Inherits the theme's colours and fonts. */

.rarezpoints-checkout__inner {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 0;
}

/* Match WooCommerce: totals rows are inset 16px only in the wide (sidebar) layout. */
.wc-block-components-sidebar-layout.is-large .rarezpoints-checkout__inner {
	padding-left: 16px;
	padding-right: 16px;
}

.rarezpoints-checkout.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

.rarezpoints-checkout__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
}

.rarezpoints-checkout__title {
	font-weight: 600;
}

.rarezpoints-checkout__balance {
	font-size: 0.875em;
	opacity: 0.85;
}

.rarezpoints-checkout__form {
	display: flex;
	gap: 8px;
	margin: 0;
}

.rarezpoints-checkout__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 3em;
	padding: 0 12px;
	border: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
}

.rarezpoints-checkout__input:focus {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.rarezpoints-checkout__apply {
	flex: 0 0 auto;
	min-height: 3em;
}

.rarezpoints-checkout__applied {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 12px;
	font-size: 0.875em;
}

/*
 * Text-style buttons ("Use max", "Remove"). Themes often style every button inside the
 * checkout block (e.g. Astra's `[class*="wc-block"] button`), so these selectors are kept
 * more specific than that, including hover/focus states.
 */
.rarezpoints-checkout .rarezpoints-checkout__link,
.rarezpoints-checkout .rarezpoints-checkout__link:hover,
.rarezpoints-checkout .rarezpoints-checkout__link:focus,
.rarezpoints-checkout .rarezpoints-checkout__link:active {
	align-self: flex-start;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.875em;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: underline;
	cursor: pointer;
}

.rarezpoints-checkout .rarezpoints-checkout__link:hover {
	text-decoration-thickness: 2px;
}

.rarezpoints-checkout .rarezpoints-checkout__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.rarezpoints-checkout .rarezpoints-checkout__applied .rarezpoints-checkout__link {
	font-size: 1em;
}

.rarezpoints-checkout .rarezpoints-checkout__link:disabled {
	cursor: default;
	opacity: 0.6;
}

.rarezpoints-checkout__error {
	margin: 0;
	color: #cc1818;
	font-size: 0.875em;
}

.rarezpoints-checkout__earn {
	margin: 0;
	font-size: 0.875em;
}

.rarezpoints-checkout__earn-detail {
	opacity: 0.75;
}

/* Classic checkout row */
.rarezpoints-classic td > div + div {
	margin-top: 6px;
}

.rarezpoints-classic.is-busy {
	opacity: 0.6;
}

.rarezpoints-classic__form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

/* Themes right-align the last cell of the order review (Astra: `... form #order_review td:last-child`). */
.woocommerce .woocommerce-checkout-review-order-table tr.rarezpoints-classic td,
.woocommerce-page.woocommerce-checkout form #order_review tr.rarezpoints-classic td {
	text-align: left;
}

.rarezpoints-classic__input {
	flex: 1 1 7em;
	max-width: 12em;
}

/* "Use max" / "Remove" as text links, more specific than theme button rules
   such as Astra's `.woocommerce button` styles. */
.woocommerce-checkout .rarezpoints-classic button.rarezpoints-classic__max,
.woocommerce-checkout .rarezpoints-classic button.rarezpoints-classic__remove,
.woocommerce-checkout .rarezpoints-classic button.rarezpoints-classic__max:hover,
.woocommerce-checkout .rarezpoints-classic button.rarezpoints-classic__remove:hover,
.woocommerce-checkout .rarezpoints-classic button.rarezpoints-classic__max:focus,
.woocommerce-checkout .rarezpoints-classic button.rarezpoints-classic__remove:focus {
	display: inline;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: underline;
	cursor: pointer;
}

.woocommerce-checkout .rarezpoints-classic button.rarezpoints-classic__max {
	flex-basis: 100%;
	text-align: left;
}

.rarezpoints-classic__earn,
.rarezpoints-classic__balance,
.rarezpoints-classic__applied {
	font-size: 0.9em;
}
