/* 阿翔的購物金 — front end (product hint, cart / checkout, My Account).
 *
 * 3C翔 UI: white cards with thin borders on the theme's page, one accent colour,
 * Lucide line icons, hierarchy from weight and grey. Everything is scoped to .axp
 * so the theme is not affected, and theme rules for buttons / lists are reset here.
 *
 * Colours follow the theme: Blocksy's variables when they are there (button, text, headings,
 * border, form field and palette colours), the 3C翔 defaults otherwise. The font is the theme's.
 * 設定 → 前台樣式 overrides any of them with `.axp.axp { … }` printed after this file
 * (Axiang_Points_Style::css). */

.axp {
	--axp-accent-src: var(--theme-button-background-initial-color, #1d6fb8);
	--axp-accent: var(--axp-accent-src);
	--axp-accent-strong: var(--theme-button-background-hover-color, color-mix(in srgb, var(--axp-accent-src) 82%, #000));
	--axp-accent-soft: color-mix(in srgb, var(--axp-accent-src) 9%, var(--axp-surface));
	--axp-accent-border: color-mix(in srgb, var(--axp-accent-src) 35%, var(--axp-surface));
	--axp-on-accent: var(--theme-button-text-initial-color, #fff);
	--axp-surface: var(--theme-palette-color-8, #fff);
	--axp-sunken: var(--theme-palette-color-7, #f8f9fb);
	--axp-border: var(--theme-border-color, #e5e8ee);
	--axp-border-strong: color-mix(in srgb, var(--axp-border) 86%, var(--axp-text));
	--axp-input-border: var(--theme-form-field-border-initial-color, #d5dae2);
	--axp-input: var(--axp-surface);
	--axp-hover: var(--theme-palette-color-6, #f2f4f7);
	--axp-text: var(--theme-text-color, #1f2633);
	--axp-heading: var(--theme-headings-color, var(--axp-text));
	--axp-muted: color-mix(in srgb, var(--axp-text) 76%, var(--axp-surface));
	--axp-icon: color-mix(in srgb, var(--axp-text) 55%, var(--axp-surface));
	--axp-neutral-bg: var(--axp-hover);
	--axp-neutral-fg: color-mix(in srgb, var(--axp-text) 88%, var(--axp-surface));
	--axp-warning-bg: #fef3c7;
	--axp-warning-fg: #92400e;
	--axp-warning-num: #b45309;
	--axp-danger-bg: #fee4e2;
	--axp-danger-fg: #b42318;
	--axp-success-bg: #dcfae6;
	--axp-success-fg: #067647;
	--axp-radius-sm: 8px;
	--axp-radius: 12px;
	--axp-radius-md: min(var(--axp-radius), 10px);
	--axp-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	--axp-ease: .12s ease;

	color: var(--axp-text);
	font-family: var(--axp-font, inherit);
	font-size: 14px;
	line-height: 1.55;
	text-align: left;
}

/* Themes with a dark mode switch (html[data-theme=dark] / .dark). */
html[data-theme="dark"] .axp,
html.dark .axp,
body.dark .axp {
	--axp-accent: color-mix(in srgb, var(--axp-accent-src) 78%, #fff);
	--axp-accent-strong: color-mix(in srgb, var(--axp-accent-src) 90%, #fff);
	--axp-accent-soft: color-mix(in srgb, var(--axp-accent-src) 22%, #171b23);
	--axp-accent-border: color-mix(in srgb, var(--axp-accent-src) 40%, #171b23);
	--axp-on-accent: #0f1218;
	--axp-surface: #171b23;
	--axp-sunken: #1b2029;
	--axp-border: #2a303b;
	--axp-border-strong: #3a4250;
	--axp-input-border: #343b48;
	--axp-input: #11151c;
	--axp-hover: #20252f;
	--axp-text: #e6e9ef;
	--axp-heading: #e6e9ef;
	--axp-muted: #9aa3b2;
	--axp-icon: #7d8696;
	--axp-neutral-bg: #232934;
	--axp-neutral-fg: #c3cad6;
	--axp-warning-bg: rgba(245, 176, 65, .16);
	--axp-warning-fg: #f5c46b;
	--axp-warning-num: #f5b041;
	--axp-danger-bg: rgba(249, 112, 102, .16);
	--axp-danger-fg: #f99a92;
	--axp-success-bg: rgba(50, 213, 131, .14);
	--axp-success-fg: #6ce9a6;
	--axp-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.axp *,
.axp *::before,
.axp *::after {
	box-sizing: border-box;
}

.axp p,
.axp h3,
.axp ul,
.axp li {
	margin: 0;
	padding: 0;
}

.axp ul {
	list-style: none;
}

.axp a {
	color: var(--axp-accent);
	text-decoration: none;
}

.axp a:hover {
	color: var(--axp-accent-strong);
}

.axp :focus-visible {
	outline: 2px solid var(--axp-accent);
	outline-offset: 2px;
}

.axp .axp-svg {
	display: block;
	flex: none;
}

.axp .axp-muted {
	color: var(--axp-muted);
	font-size: 13px;
}

/* Cards ---------------------------------------------------------------- */

.axp .axp-card {
	border: 1px solid var(--axp-border);
	border-radius: var(--axp-radius);
	background: var(--axp-surface);
	box-shadow: var(--axp-shadow);
}

.axp .axp-card--pad {
	padding: 16px 18px;
}

.axp .axp-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.axp .axp-section {
	margin-top: 16px;
}

.axp .axp-section__title {
	color: var(--axp-heading);
	font-family: var(--axp-font, inherit);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
}

.axp .axp-icon-box {
	display: grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: var(--axp-radius-md);
	background: var(--axp-accent-soft);
	color: var(--axp-accent);
}

.axp .axp-icon-box--sm {
	width: 34px;
	height: 34px;
}

/* Buttons and inputs ---------------------------------------------------- */

.axp .axp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--axp-border);
	border-radius: var(--axp-radius-sm);
	background: var(--axp-surface);
	box-shadow: none;
	color: var(--axp-text);
	font-family: var(--axp-font, inherit);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--axp-ease), border-color var(--axp-ease), color var(--axp-ease);
}

.axp .axp-btn:hover {
	background: var(--axp-hover);
	color: var(--axp-text);
}

.axp .axp-btn--primary {
	border-color: var(--axp-accent);
	background: var(--axp-accent);
	color: var(--axp-on-accent);
}

.axp .axp-btn--primary:hover {
	border-color: var(--axp-accent-strong);
	background: var(--axp-accent-strong);
	color: var(--axp-on-accent);
}

.axp .axp-btn--outline {
	border-color: var(--axp-accent);
	color: var(--axp-accent);
}

.axp .axp-btn--outline:hover {
	background: var(--axp-accent);
	color: var(--axp-on-accent);
}

.axp .axp-btn--ghost {
	min-height: 32px;
	padding: 0 10px;
	color: var(--axp-muted);
	font-weight: 500;
}

.axp .axp-btn.is-disabled,
.axp .axp-btn:disabled {
	opacity: .45;
	cursor: default;
	pointer-events: none;
}

.axp .axp-btn.is-busy {
	opacity: .6;
	pointer-events: none;
}

.axp .axp-input {
	display: flex;
	align-items: center;
	flex: 1 1 140px;
	min-width: 0;
	min-height: 38px;
	border: 1px solid var(--axp-input-border);
	border-radius: var(--axp-radius-sm);
	background: var(--axp-input);
	transition: border-color var(--axp-ease), box-shadow var(--axp-ease);
}

.axp .axp-input:focus-within {
	border-color: var(--axp-accent);
	box-shadow: 0 0 0 1px var(--axp-accent);
}

.axp .axp-input__prefix {
	padding-left: 10px;
	color: var(--axp-muted);
	font-weight: 600;
}

.axp .axp-input input {
	flex: 1;
	width: 100%;
	min-width: 0;
	height: 36px;
	margin: 0;
	padding: 0 10px 0 6px;
	border: 0;
	border-radius: var(--axp-radius-sm);
	background: transparent;
	box-shadow: none;
	color: var(--axp-text);
	font-family: var(--axp-font, inherit);
	font-size: 15px;
	font-weight: 600;
	line-height: normal;
	font-variant-numeric: tabular-nums;
	outline: none;
}

.axp .axp-input input:focus,
.axp .axp-input input:focus-visible {
	border: 0;
	box-shadow: none;
	outline: none;
}

.axp .axp-input input::-webkit-outer-spin-button,
.axp .axp-input input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.axp .axp-input input[type="number"] {
	-moz-appearance: textfield;
}

.axp .axp-input input::placeholder {
	color: var(--axp-muted);
	font-weight: 400;
	opacity: .8;
}

.axp .axp-tag {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--axp-neutral-bg);
	color: var(--axp-neutral-fg);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.axp .axp-tag--success {
	background: var(--axp-success-bg);
	color: var(--axp-success-fg);
}

/* Hints: product page, cart totals, checkout, thank-you page ------------ */

.axp.axp-hint {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 16px;
	padding: 10px 14px;
	border-radius: var(--axp-radius-md);
	background: var(--axp-accent-soft);
	color: var(--axp-accent-strong);
	font-size: 14px;
	line-height: 1.6;
}

.axp.axp-hint .axp-hint__ico {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	color: var(--axp-accent);
}

.axp.axp-hint strong {
	font-weight: 700;
}

.axp.axp-hint a {
	margin-left: 6px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.axp.axp-hint--product {
	margin: 0 0 14px;
	font-size: 13px;
}

/* Checkout card --------------------------------------------------------- */

.axp.axp-checkout {
	margin: 0 0 20px;
}

.axp.axp-checkout .axp-hint {
	margin-bottom: 12px;
}

.axp .axp-redeem {
	margin-bottom: 12px;
	padding: 16px 18px;
}

.axp .axp-redeem__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.axp .axp-redeem__ico {
	display: grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: var(--axp-radius-md);
	background: var(--axp-accent-soft);
	color: var(--axp-accent);
}

.axp .axp-redeem__ico .axp-hint__ico {
	width: 20px;
	height: 20px;
	margin: 0;
}

.axp .axp-redeem__title {
	color: var(--axp-heading);
	font-family: var(--axp-font, inherit);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
}

.axp .axp-redeem__sub {
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-redeem__sub strong {
	color: var(--axp-text);
	font-weight: 700;
}

.axp .axp-redeem__hint {
	margin-top: 12px;
	color: var(--axp-text);
	font-size: 14px;
}

.axp .axp-redeem__hint--muted {
	padding: 10px 12px;
	border-radius: var(--axp-radius-md);
	background: var(--axp-sunken);
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-redeem__form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.axp .axp-redeem__note {
	margin-top: 8px;
	color: var(--axp-muted);
	font-size: 12px;
}

.axp .axp-redeem__applied {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: var(--axp-radius-md);
	background: var(--axp-sunken);
}

.axp .axp-redeem__msg:empty {
	display: none;
}

.axp .axp-redeem__msg {
	margin-top: 10px;
	padding: 8px 12px;
	border-radius: var(--axp-radius-sm);
	background: var(--axp-danger-bg);
	color: var(--axp-danger-fg);
	font-size: 13px;
}

/* Checkout block: the card sits inside the order summary, so no frame of its own. */
.axp.axp-checkout--block,
.wc-block-components-totals-wrapper .axp.axp-checkout--block {
	margin: 0;
	padding: 8px 16px 12px;
}

.axp .axp-redeem--flat {
	margin: 0;
	padding: 4px 0;
	border: 0;
	background: none;
	box-shadow: none;
}

.axp.axp-hint--block {
	margin: 0 16px 16px;
	font-size: 13px;
}

/* YANGSHEEP 結帳強化: the card sits in its 購物金 slot beside 折扣代碼, which is already
 * framed. No frame of its own, and YANGSHEEP's own colours and corners (set in its settings)
 * as the defaults here; 前台樣式 (.axp.axp, printed later) still overrides them. */
.yangsheep-coupon-point .axp {
	--axp-text: var(--ys-text-primary, #1f2633);
	--axp-heading: var(--ys-text-heading, var(--axp-text));
	--axp-muted: var(--ys-text-secondary, var(--ys-text-muted, #6b7385));
	--axp-input: var(--form-field-bg-color, #fff);
	--axp-sunken: var(--section-bg-color, #f8f9fb);
	--axp-radius-sm: var(--block-border-radius, 8px);
}

.yangsheep-coupon-point .axp.axp-checkout {
	margin: 0;
}

.yangsheep-coupon-point .axp .axp-redeem {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

.yangsheep-coupon-point .axp .axp-redeem__ico {
	display: none;
}

.yangsheep-coupon-point .axp .axp-redeem__title {
	margin: 0 0 6px;
	color: var(--axp-heading);
	font-size: 18px;
	font-weight: 600;
}

.yangsheep-coupon-point .axp .axp-redeem__sub,
.yangsheep-coupon-point .axp .axp-redeem__hint {
	color: var(--axp-muted);
	font-size: 14px;
}

.yangsheep-coupon-point .axp .axp-redeem__hint--muted {
	background: var(--axp-input);
	border: 1px dashed var(--axp-input-border);
}

.yangsheep-coupon-point .axp .axp-input,
.yangsheep-coupon-point .axp .axp-btn {
	min-height: 44px;
	border-radius: var(--axp-radius-sm);
}

.yangsheep-coupon-point .axp .axp-input input {
	height: 42px;
}

.yangsheep-coupon-point .axp .axp-redeem__form .axp-input {
	flex-basis: 100%;
}

.yangsheep-coupon-point .axp .axp-redeem__form .axp-btn {
	flex: 1;
}

.yangsheep-coupon-point .axp.axp-hint {
	background: var(--axp-input);
	color: var(--axp-muted);
}

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

.axp.axp-account {
	max-width: 880px;
}

.axp .axp-balance {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px;
}

.axp .axp-balance__main {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.axp .axp-balance__main .axp-icon-box {
	width: 48px;
	height: 48px;
	border-radius: var(--axp-radius);
}

.axp .axp-balance__label {
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-balance__value {
	color: var(--axp-heading);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.axp .axp-balance__sub {
	margin-top: 2px;
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: var(--axp-radius-md);
	background: var(--axp-accent-soft);
	color: var(--axp-accent-strong);
	font-size: 13px;
	line-height: 1.6;
}

.axp .axp-note .axp-svg {
	margin-top: 2px;
}

.axp .axp-note--warning {
	background: var(--axp-warning-bg);
	color: var(--axp-warning-fg);
}

.axp .axp-kpis {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-top: 12px;
}

.axp .axp-kpi {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px;
	border: 1px solid var(--axp-border);
	border-radius: var(--axp-radius);
	background: var(--axp-surface);
	box-shadow: var(--axp-shadow);
}

.axp .axp-kpi__label {
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-kpi__value {
	color: var(--axp-heading);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.axp .axp-kpi.is-warning .axp-kpi__value {
	color: var(--axp-warning-num);
}

.axp .axp-history > li + li {
	border-top: 1px solid var(--axp-border);
}

.axp .axp-history__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 2px;
}

.axp .axp-history__ico {
	display: grid;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 999px;
}

.axp .axp-history__ico.is-plus {
	background: var(--axp-success-bg);
	color: var(--axp-success-fg);
}

.axp .axp-history__ico.is-minus {
	background: var(--axp-neutral-bg);
	color: var(--axp-neutral-fg);
}

.axp .axp-history__text {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.axp .axp-history__desc {
	overflow: hidden;
	color: var(--axp-text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.axp .axp-history__date {
	color: var(--axp-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.axp .axp-history__amount {
	flex: none;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.axp .axp-history__amount.is-plus {
	color: var(--axp-success-fg);
}

.axp .axp-history__amount.is-minus {
	color: var(--axp-text);
}

.axp .axp-pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--axp-border);
}

.axp .axp-pager__info {
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 28px 16px;
	color: var(--axp-muted);
	text-align: center;
}

.axp .axp-program__sub {
	margin: 16px 0 8px;
	color: var(--axp-muted);
	font-size: 13px;
	font-weight: 600;
}

.axp .axp-earn {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.axp .axp-earn--1 {
	grid-template-columns: minmax(0, 1fr);
}

.axp .axp-earn--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.axp .axp-earn__tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	padding: 12px 14px;
	border-radius: var(--axp-radius-md);
	background: var(--axp-sunken);
}

.axp .axp-earn__label {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-earn__label .axp-svg {
	color: var(--axp-accent);
}

.axp .axp-earn__value {
	color: var(--axp-heading);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.axp .axp-earn__cap {
	color: var(--axp-muted);
	font-size: 12px;
}

.axp .axp-program__row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.axp .axp-program__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	color: var(--axp-text);
	font-size: 14px;
}

.axp .axp-program__text small {
	color: var(--axp-muted);
	font-size: 12px;
}

.axp .axp-tag--accent {
	background: var(--axp-accent-soft);
	color: var(--axp-accent-strong);
}

.axp .axp-program__foot {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid var(--axp-border);
	color: var(--axp-muted);
	font-size: 13px;
}

.axp .axp-program__foot .axp-svg {
	color: var(--axp-icon);
}

/* Phones ---------------------------------------------------------------- */

@media (max-width: 600px) {
	.axp .axp-balance {
		padding: 16px;
	}

	.axp .axp-balance__value {
		font-size: 26px;
	}

	.axp .axp-balance__cta {
		width: 100%;
	}

	.axp .axp-kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.axp .axp-kpi:last-child {
		grid-column: 1 / -1;
	}

	.axp .axp-kpi__value {
		font-size: 18px;
	}

	.axp .axp-earn,
	.axp .axp-earn--2 {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	/* One way per row: label and caption on the left, the number on the right. */
	.axp .axp-earn__tile {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "label value" "cap value";
		align-items: center;
		gap: 2px 12px;
	}

	.axp .axp-earn__label {
		grid-area: label;
	}

	.axp .axp-earn__cap {
		grid-area: cap;
	}

	.axp .axp-earn__value {
		grid-area: value;
		font-size: 20px;
	}

	.axp .axp-program__row {
		flex-wrap: wrap;
		row-gap: 8px;
	}

	/* Text takes the rest of the line, so the rate tag drops below it. */
	.axp .axp-program__text {
		flex-basis: calc(100% - 46px);
	}

	.axp .axp-program__row .axp-tag {
		margin-left: 46px;
	}

	.axp .axp-redeem__form .axp-input {
		flex-basis: 100%;
	}

	.axp .axp-redeem__form .axp-btn {
		flex: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.axp * {
		transition: none !important;
	}
}
