/**
 * NeoGrow loyalty styles: the points card, the redemption form on both
 * checkout paths (classic and the Cart/Checkout blocks), My Account and the
 * order-received notice.
 *
 * Loaded on the cart, checkout and My Account pages, on any page carrying the
 * [neogrow_cart_redemption] shortcode, and by whatever renders this markup
 * anywhere else — never on a page that shows none of it.
 *
 * The --neo-* custom properties come from the merchant's Design settings and
 * are emitted at runtime on the neogrow-design handle; see
 * NeoGrow\Frontend\Assets.
 */

.neoplugin-card {
	border-radius: var( --neo-border-radius );
	border: 1px solid var( --neo-border );
	color: var( --neo-text );
	padding: 20px;
	background: #fff;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.05 );
}

.neoplugin-card-primary {
	border-left: 4px solid var( --neo-primary );
}

/* The text colour is stated, not inherited: a theme that colours every button
 * (Hello Elementor's reset sets pink text on all of them) otherwise draws the
 * label in its own colour on our brand background. Since 1.2.18. The class
 * also styles the Elementor editor's sample card, which carries no IDs. */
#neoplugin_apply_points_btn,
#neoplugin_apply_points_btn:hover,
#neoplugin_apply_points_btn:focus,
.neoplugin-apply-points.button,
.neoplugin-apply-points.button:hover,
.neoplugin-apply-points.button:focus {
	background-color: var( --neo-primary );
	border: none;
	border-radius: var( --neo-border-radius );
	color: #fff;
	cursor: pointer;
	white-space: nowrap;
}

#neoplugin_apply_points_btn:hover,
.neoplugin-apply-points.button:hover {
	opacity: 0.9;
}

.neoplugin-applied-notice {
	color: var( --neo-success );
	font-weight: bold;
	margin-bottom: 10px;
}

/* Redemption form */
.neoplugin-redemption-wrapper {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 15px;
	max-width: 100%;
}

input.neoplugin-redeem-input {
	width: 100%;
	max-width: 300px;
	border-radius: var( --neo-border-radius );
}

.neoplugin-remove-link {
	color: #e65050;
	margin-left: 10px;
	text-decoration: underline;
	cursor: pointer;
}

/*
 * Cart & Checkout blocks: the points redemption panel.
 *
 * `.wp-block-neogrow-points-redemption` is the placeholder the blocks hydrate;
 * `.neoplugin-block-redemption` is the panel itself. Both are stable and
 * documented for merchants who want to restyle the panel — see docs/index.html.
 */
.wp-block-neogrow-points-redemption {
	margin: 0 0 16px;
}

.neoplugin-block-redemption {
	padding: 20px;
}

.neoplugin-block-redemption > * {
	margin-block: 0;
}

.neoplugin-block-redemption > * + * {
	margin-block-start: 12px;
}

.neoplugin-block-redemption__title {
	font-size: 1.05em;
	line-height: 1.3;
}

.neoplugin-block-redemption .neoplugin-redemption-wrapper {
	margin-bottom: 0;
}

.neoplugin-block-redemption__input {
	padding: 8px 10px;
}

/*
 * Both controls are selected as `.panel button.control` rather than by class
 * alone. Themes commonly style buttons as `.woocommerce button`, which outranks
 * a single class and would otherwise repaint these — Astra turns the plain
 * "Remove" control into a full primary button.
 */
.neoplugin-block-redemption button.neoplugin-block-redemption__apply {
	border-radius: var( --neo-border-radius );
	padding: 10px 18px;
	white-space: nowrap;
}

/* "Remove" is a button for keyboard and screen-reader users, but reads as a
   link, so the theme's button skin is stripped back off it. */
.neoplugin-block-redemption button.neoplugin-block-redemption__remove {
	background: none;
	border: 0;
	border-radius: 0;
	padding: 0;
	margin-left: 8px;
	width: auto;
	min-height: 0;
	line-height: inherit;
	font: inherit;
	color: #e65050;
	text-decoration: underline;
	box-shadow: none;
}

.neoplugin-block-redemption button.neoplugin-block-redemption__remove:hover,
.neoplugin-block-redemption button.neoplugin-block-redemption__remove:focus {
	background: none;
	color: #c33;
}

.neoplugin-message {
	margin-top: 10px;
	font-size: 0.9em;
}

.neoplugin-message-error {
	color: #b32d2e;
	font-weight: 600;
}


/* My Account */
.neoplugin-balance-amount {
	font-size: 2em;
	font-weight: bold;
	color: var( --neo-primary );
	margin: 10px 0;
}

.neoplugin-earn-rules {
	margin-top: 15px;
	border-top: 1px dashed #eee;
	padding-top: 10px;
	font-size: 0.9em;
	color: #646970;
}

.neoplugin-rules-list {
	margin: 5px 0 0 15px;
	list-style: disc;
}

.neoplugin-points-delta {
	font-weight: bold;
}

.neoplugin-pagination {
	margin-top: 20px;
}

/*
 * Success callout — the notice shape from the Design settings preview, so what
 * a merchant picks a colour against is what the customer actually sees.
 *
 * Deliberately icon-free. The preview draws a dashicon, but that is an admin
 * screen; on a storefront the notice sits among a theme that has its own icon
 * set, and a tick in a different style reads as furniture from another plugin.
 * Colour, tint, border and radius carry the meaning, and all four are the
 * merchant's own settings.
 */
.neoplugin-notice {
	padding: 10px;
	margin: 0 0 15px;
	border-radius: var( --neo-border-radius );
	border: 1px solid currentColor;
}

.neoplugin-notice-success {
	color: var( --neo-success );
	/* Flat fallback first: a browser without color-mix() drops the rule below
	   and keeps the correct border and text colour on a neutral tint. */
	background: #f2f9f3;
	background: color-mix( in srgb, var( --neo-success ), transparent 90% );
}

.neoplugin-thankyou-points {
	font-weight: bold;
}

/* What the balance is worth, under the balance card's figure (1.2.7). */
.neoplugin-balance-worth {
	margin: -6px 0 10px;
	color: var( --neo-text );
	opacity: 0.8;
}

.neoplugin-balance-worth:empty,
.neoplugin-balance-worth-value:empty {
	display: none;
}

/* "100 points = $1.00" in the redemption panels (1.2.7). */
.neoplugin-points-rate {
	font-size: 0.85em;
	margin: -4px 0 12px;
	opacity: 0.75;
}
