/**
 * Attractech WooCommerce Points — front-end styles.
 *
 * Deliberately minimal and theme-neutral. Everything is driven by custom
 * properties so a site can restyle it without overriding selectors:
 *
 *   :root {
 *     --awp-accent: #B4127E;
 *     --awp-positive: #1a7f4b;
 *   }
 */

:root {
	--awp-accent: currentColor;
	--awp-positive: #1a7f4b;
	--awp-negative: #b3261e;
	--awp-muted: rgba(0, 0, 0, 0.6);
	--awp-surface: rgba(0, 0, 0, 0.04);
	--awp-radius: 8px;
}

/* --- Header badge ------------------------------------------------------ */

.awp-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	line-height: 1;
}

.awp-badge--empty {
	display: none;
}

.awp-badge a {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	text-decoration: none;
	color: inherit;
}

.awp-badge__count {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--awp-accent);
}

.awp-badge__value {
	font-size: 0.85em;
	color: var(--awp-muted);
}

/* --- My Account -------------------------------------------------------- */

.awp-account__summary {
	background: var(--awp-surface);
	border-radius: var(--awp-radius);
	padding: 1.25em 1.5em;
	margin-bottom: 1.5em;
}

.awp-account__balance {
	display: flex;
	align-items: baseline;
	gap: 0.4em;
}

.awp-account__number {
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--awp-accent);
}

.awp-account__unit {
	font-size: 1rem;
	color: var(--awp-muted);
}

.awp-account__value {
	margin: 0.5em 0 0;
}

.awp-account__value--negative {
	color: var(--awp-negative);
}

.awp-account__how ul {
	margin: 0 0 1.5em;
	padding-left: 1.2em;
}

.awp-account__how li {
	margin-bottom: 0.4em;
}

/* --- History ----------------------------------------------------------- */

.awp-history {
	width: 100%;
}

.awp-history__points {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.awp-history .awp-positive {
	color: var(--awp-positive);
}

.awp-history .awp-negative {
	color: var(--awp-negative);
}

.awp-pagination {
	display: flex;
	align-items: center;
	gap: 1em;
	margin-top: 1em;
}

.awp-pagination__status {
	color: var(--awp-muted);
	font-size: 0.9em;
}

/* --- Cart / checkout redemption panel ---------------------------------- */

.awp-redeem {
	background: var(--awp-surface);
	border-radius: var(--awp-radius);
	padding: 1em 1.25em;
	margin-bottom: 1.5em;
}

/*
 * When the panel is placed inside a custom order review (see README —
 * do_action('awp_redemption_panel')), it should read as part of that review
 * rather than as a separate card. Drops the card chrome and matches the
 * surrounding control sizing.
 */
#cco-order-review .awp-redeem,
.awp-redeem--inline {
	background: none;
	border-radius: 0;
	padding: 0;
	margin: 0 0 8px;
}

#cco-order-review .awp-redeem .awp-redeem__title,
.awp-redeem--inline .awp-redeem__title {
	font-size: 14px;
	font-weight: 500;
	color: #333;
	margin: 0 0 8px;
}

#cco-order-review .awp-redeem .awp-redeem__hint,
.awp-redeem--inline .awp-redeem__hint {
	font-size: 13px;
	line-height: 1.4;
	color: #737373;
	margin: 0 0 8px;
}

#cco-order-review .awp-redeem .awp-redeem__form,
.awp-redeem--inline .awp-redeem__form {
	gap: 8px;
	margin-bottom: 6px;
}

#cco-order-review .awp-redeem .awp-redeem__input,
.awp-redeem--inline .awp-redeem__input {
	flex: 1;
	min-width: 0;
	width: auto;
	padding: 12px 14px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	font-size: 14px;
	line-height: 24px;
	background: #fff;
	margin: 0;
	box-shadow: none;
	box-sizing: border-box;
}

#cco-order-review .awp-redeem .awp-redeem__input:focus,
.awp-redeem--inline .awp-redeem__input:focus {
	border-color: #333;
	outline: none;
}

#cco-order-review .awp-redeem .button,
.awp-redeem--inline .button {
	padding: 10px 18px;
	background: #e0e0e0;
	color: #333;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	line-height: 24px;
	margin: 0;
	flex-shrink: 0;
	white-space: nowrap;
	transition: background 0.2s;
}

#cco-order-review .awp-redeem .button:hover,
.awp-redeem--inline .button:hover {
	background: #d0d0d0;
}

/* Applied state reads as a confirmation, so it gets the positive treatment
   rather than the neutral one. */
#cco-order-review .awp-redeem .awp-redeem__applied,
.awp-redeem--inline .awp-redeem__applied {
	align-items: center;
	gap: 8px;
	font-size: 13px;
	line-height: 1.4;
	color: #2d7a2d;
	background: rgba(45, 122, 45, 0.08);
	border-radius: 6px;
	padding: 10px 12px;
}

#cco-order-review .awp-redeem .awp-redeem__applied .awp-redeem__remove,
.awp-redeem--inline .awp-redeem__applied .awp-redeem__remove {
	padding: 6px 12px;
	font-size: 13px;
	background: transparent;
	color: #2d7a2d;
	border: 1px solid rgba(45, 122, 45, 0.35);
}

#cco-order-review .awp-redeem .awp-redeem__applied .awp-redeem__remove:hover,
.awp-redeem--inline .awp-redeem__applied .awp-redeem__remove:hover {
	background: rgba(45, 122, 45, 0.12);
}

.awp-redeem__title {
	margin: 0 0 0.35em;
	font-weight: 600;
}

.awp-redeem__hint {
	margin: 0 0 0.75em;
	color: var(--awp-muted);
	font-size: 0.9em;
}

.awp-redeem__form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

.awp-redeem__input {
	width: 8em;
	font-variant-numeric: tabular-nums;
}

.awp-redeem__applied {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
}

.awp-redeem__error {
	color: var(--awp-negative);
	margin: 0.5em 0 0;
	font-size: 0.9em;
}

.awp-redeem.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

@media (prefers-color-scheme: dark) {
	:root {
		--awp-muted: rgba(255, 255, 255, 0.65);
		--awp-surface: rgba(255, 255, 255, 0.07);
	}
}
