/**
 * CoinRewards — My Account coins page.
 *
 * Uses the host theme's design tokens when present (Garden defines --c-p*,
 * --c-a*, --c-n*, --fb, --fd, semantic colours) and falls back to a clean
 * green palette elsewhere, so it matches Garden but stays white-label.
 */
.coinrewards-account {
	--cr-primary: var(--c-p500, #1b4332);
	--cr-accent: var(--c-a500, #95c11f);
	--cr-ink: var(--c-n800, #1a2b18);
	--cr-muted: var(--c-n500, #5c7a59);
	--cr-line: var(--c-n200, #e2ebe0);
	--cr-surface: var(--c-n0, #ffffff);
	--cr-soft: var(--c-p50, #edf7f0);
	--cr-pos: var(--c-ok-base, #2d6a4f);
	--cr-neg: var(--c-err-base, #c0392b);
	--cr-radius: 14px;
	font-family: var(--fb, inherit);
	color: var(--cr-ink);
}

/* Balance hero — compact single row */
.coinrewards-account .cr-hero {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	background: var(--cr-soft);
	border: 1px solid var(--cr-line);
	border-radius: var(--cr-radius);
	margin-bottom: 24px;
}

.coinrewards-account .cr-hero-icon {
	flex: 0 0 auto;
	line-height: 0;
}

.coinrewards-account .cr-coin-img,
.coinrewards-account .cr-coin-svg {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
	object-fit: cover;
}

/* Compact balance strip on the My Account dashboard. Rendered outside
   .coinrewards-account (straight into the dashboard content), so it defines its
   own tokens and is fully self-contained / white-label. */
.cr-dash-card {
	--cr-primary: var(--c-p500, #1b4332);
	--cr-muted: var(--c-n500, #5c7a59);
	--cr-line: var(--c-n200, #e2ebe0);
	--cr-soft: var(--c-p50, #edf7f0);
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	margin: 0 0 20px;
	background: var(--cr-soft);
	border: 1px solid var(--cr-line);
	border-radius: 14px;
	text-decoration: none;
	color: var(--c-n800, #1a2b18);
	font-family: var(--fb, inherit);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.cr-dash-card:hover,
.cr-dash-card:focus-visible {
	border-color: var(--cr-primary);
	box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
	outline: none;
}

.cr-dash-card .cr-coin-img,
.cr-dash-card .cr-coin-svg {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: block;
	object-fit: cover;
	flex: 0 0 auto;
}

.cr-dash-text {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 8px;
	line-height: 1.2;
	flex: 1 1 auto;
}

.cr-dash-bal {
	font-family: var(--fd, var(--fb, inherit));
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--cr-primary);
}

.cr-dash-unit {
	font-size: .8rem;
	font-weight: 600;
	color: var(--cr-muted);
	text-transform: uppercase;
	letter-spacing: .04em;
}

.cr-dash-worth {
	font-size: .88rem;
	color: var(--cr-muted);
}

.cr-dash-arrow {
	flex: 0 0 auto;
	color: var(--cr-muted);
	font-size: 1.1rem;
	transition: transform .15s ease, color .15s ease;
}

.cr-dash-card:hover .cr-dash-arrow {
	transform: translateX(3px);
	color: var(--cr-primary);
}

@media (prefers-reduced-motion: reduce) {
	.cr-dash-card,
	.cr-dash-arrow {
		transition: none;
	}
}

/* Coin image swapped in for the "Coins" account-menu icon (replaces the theme's
   Font Awesome glyph). Sized to match the other nav icons. Unscoped: it lives in
   the theme's nav, outside .coinrewards-account. */
.cr-nav-icon {
	width: 18px;
	height: 18px;
	object-fit: cover;
	border-radius: 50%;
	display: inline-block;
	vertical-align: middle;
	flex: 0 0 auto;
}

.coinrewards-account .cr-hero-body {
	display: flex;
	flex-direction: row;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 8px;
	line-height: 1.2;
}

.coinrewards-account .cr-hero-balance {
	font-family: var(--fd, var(--fb, inherit));
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--cr-primary);
}

.coinrewards-account .cr-hero-label {
	font-size: .85rem;
	font-weight: 600;
	color: var(--cr-muted);
	text-transform: uppercase;
	letter-spacing: .04em;
}

.coinrewards-account .cr-hero-value {
	font-size: .9rem;
	color: var(--cr-muted);
}

/* Sections */
.coinrewards-account .cr-section {
	margin-bottom: 24px;
}

.coinrewards-account .cr-section-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 12px;
	color: var(--cr-ink);
}

/* Admin-authored intro block */
.coinrewards-account .cr-intro {
	background: var(--cr-surface);
	border: 1px solid var(--cr-line);
	border-radius: var(--cr-radius);
	padding: 18px 20px;
	margin-bottom: 24px;
	line-height: 1.6;
	color: var(--cr-ink);
}

/* Colour the text elements directly so a theme rule that targets paragraphs
   can't override the inherited colour (inheritance always loses to a direct
   rule). */
.coinrewards-account .cr-intro p,
.coinrewards-account .cr-intro li,
.coinrewards-account .cr-intro h2,
.coinrewards-account .cr-intro h3,
.coinrewards-account .cr-intro h4,
.coinrewards-account .cr-intro strong,
.coinrewards-account .cr-intro blockquote {
	color: var(--cr-ink);
}

.coinrewards-account .cr-intro > :first-child {
	margin-top: 0;
}

.coinrewards-account .cr-intro > :last-child {
	margin-bottom: 0;
}

.coinrewards-account .cr-intro a {
	color: var(--cr-primary);
	text-decoration: underline;
}

/* Vertical rhythm for the admin-authored intro (semantic content only). The
   first/last-child resets above keep the block flush top and bottom. */
.coinrewards-account .cr-intro h2,
.coinrewards-account .cr-intro h3,
.coinrewards-account .cr-intro h4 {
	margin: 1.6em 0 .5em;
	line-height: 1.3;
}

.coinrewards-account .cr-intro p,
.coinrewards-account .cr-intro ul,
.coinrewards-account .cr-intro ol {
	margin: 0 0 1em;
}

.coinrewards-account .cr-intro li {
	margin: 0 0 .25em;
}

/* Foldable sections (native <details>) */
.coinrewards-account .cr-fold {
	margin-bottom: 24px;
}

.coinrewards-account .cr-fold-summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 2px;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--cr-ink);
	user-select: none;
}

.coinrewards-account .cr-fold-summary::-webkit-details-marker {
	display: none;
}

.coinrewards-account .cr-fold-summary::after {
	content: "";
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--cr-muted);
	border-bottom: 2px solid var(--cr-muted);
	transform: rotate(45deg);
	transition: transform .15s ease;
}

.coinrewards-account .cr-fold[open] > .cr-fold-summary::after {
	transform: rotate(225deg);
}

.coinrewards-account .cr-fold-summary:focus-visible {
	outline: 2px solid var(--cr-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

.coinrewards-account .cr-fold-content {
	margin-top: 12px;
}

.coinrewards-account .cr-fold-content > .cr-intro {
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.coinrewards-account .cr-fold-summary::after {
		transition: none;
	}
}

/* Card grid: single column on mobile, two columns on desktop. The grid gap
   replaces each card's bottom margin. Referral + Activity span the full width. */
.coinrewards-account .cr-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}

.coinrewards-account .cr-grid > .cr-fold {
	margin-bottom: 0;
	min-width: 0;
}

@media (min-width: 783px) {
	.coinrewards-account .cr-grid {
		grid-template-columns: 1fr 1fr;
	}

	.coinrewards-account .cr-grid > .cr-referrals,
	.coinrewards-account .cr-grid > .cr-activity {
		grid-column: 1 / -1;
	}
}

/* Tables */
.coinrewards-account .cr-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--cr-surface);
	border: 1px solid var(--cr-line);
	border-radius: var(--cr-radius);
	overflow: hidden;
}

.coinrewards-account .cr-table th,
.coinrewards-account .cr-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--cr-line);
	vertical-align: middle;
}

.coinrewards-account .cr-table thead th {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--cr-muted);
	background: var(--cr-soft);
}

.coinrewards-account .cr-table tr:last-child td {
	border-bottom: 0;
}

.coinrewards-account .cr-num {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Earn table */
.coinrewards-account .cr-earn-reward {
	text-align: right;
	font-weight: 700;
	color: var(--cr-primary);
	white-space: nowrap;
}

/* Activity log */
.coinrewards-account .cr-log-desc {
	display: flex;
	flex-direction: column;
}

.coinrewards-account .cr-log-type {
	font-weight: 600;
}

.coinrewards-account .cr-log-note {
	font-size: .85rem;
	color: var(--cr-muted);
}

.coinrewards-account .cr-log-amount {
	font-weight: 700;
}

.coinrewards-account .cr-pos {
	color: var(--cr-pos);
}

.coinrewards-account .cr-neg {
	color: var(--cr-neg);
}

.coinrewards-account .cr-empty {
	color: var(--cr-muted);
	padding: 8px 0;
}

/* Pagination */
.coinrewards-account .cr-pagination {
	display: flex;
	gap: 6px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.coinrewards-account .cr-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--cr-line);
	border-radius: 8px;
	text-decoration: none;
	color: var(--cr-ink);
	background: var(--cr-surface);
}

.coinrewards-account .cr-pagination .page-numbers.current {
	background: var(--cr-primary);
	border-color: var(--cr-primary);
	color: #fff;
}

.coinrewards-account .cr-pagination a.page-numbers:hover {
	border-color: var(--cr-primary);
}

/* Submission form */
.coinrewards-account .cr-submit-form {
	background: var(--cr-surface);
	border: 1px solid var(--cr-line);
	border-radius: var(--cr-radius);
	padding: 18px 20px;
	max-width: 560px;
}

.coinrewards-account .cr-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 14px;
}

.coinrewards-account .cr-field label {
	font-weight: 600;
	font-size: .9rem;
}

.coinrewards-account .cr-field select,
.coinrewards-account .cr-field input[type="url"],
.coinrewards-account .cr-field textarea {
	padding: 9px 11px;
	border: 1px solid var(--cr-line);
	border-radius: 8px;
	font: inherit;
	width: 100%;
	box-sizing: border-box;
}

.coinrewards-account .cr-field-hint {
	font-size: .82rem;
	color: var(--cr-muted);
}

.coinrewards-account .cr-field-error {
	font-size: .82rem;
	color: var(--cr-neg);
	font-weight: 600;
}

.coinrewards-account .cr-submit-btn {
	background: var(--cr-primary);
	border-color: var(--cr-primary);
	color: #fff;
	align-self: flex-start;
}

.coinrewards-account .cr-submit-blocked {
	color: var(--cr-muted);
	background: var(--cr-soft);
	border: 1px solid var(--cr-line);
	border-radius: var(--cr-radius);
	padding: 14px 16px;
}

.coinrewards-account .cr-submit-list {
	margin-top: 18px;
}

/* Status badges */
.coinrewards-account .cr-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: .78rem;
	font-weight: 600;
}

.coinrewards-account .cr-badge--pending {
	background: var(--c-warn-lt, #fef9e7);
	color: var(--c-warn-dk, #7d6608);
}

.coinrewards-account .cr-badge--approved {
	background: var(--c-ok-lt, #edf7f0);
	color: var(--c-ok-dk, #1b4332);
}

.coinrewards-account .cr-badge--rejected {
	background: var(--c-err-lt, #fdedec);
	color: var(--c-err-dk, #922b21);
}

@media (max-width: 600px) {
	/* Stack the data tables into clean rows on phones (no more cramped columns). */
	.coinrewards-account .cr-submit-list,
	.coinrewards-account .cr-activity-table,
	.coinrewards-account .cr-submit-list tbody,
	.coinrewards-account .cr-activity-table tbody {
		display: block;
	}

	.coinrewards-account .cr-submit-list thead,
	.coinrewards-account .cr-activity-table thead {
		display: none;
	}

	.coinrewards-account .cr-submit-list tbody td,
	.coinrewards-account .cr-activity-table tbody td {
		padding: 0;
		border: 0;
	}

	.coinrewards-account .cr-submit-list tbody tr,
	.coinrewards-account .cr-activity-table tbody tr {
		display: grid;
		grid-template-columns: 1fr auto;
		gap: 4px 12px;
		align-items: center;
		padding: 12px 14px;
		border-bottom: 1px solid var(--cr-line);
	}

	.coinrewards-account .cr-submit-list tbody tr:last-child,
	.coinrewards-account .cr-activity-table tbody tr:last-child {
		border-bottom: 0;
	}

	/* Your submissions: platform + status, date underneath. */
	.coinrewards-account .cr-submit-list tbody tr {
		grid-template-areas: "platform status" "date status";
	}
	.coinrewards-account .cr-submit-list tbody td:nth-child(1) {
		grid-area: platform;
		font-weight: 600;
	}
	.coinrewards-account .cr-submit-list tbody td:nth-child(2) {
		grid-area: date;
		font-size: .8rem;
		color: var(--cr-muted);
		white-space: nowrap;
	}
	.coinrewards-account .cr-submit-list tbody td:nth-child(3) {
		grid-area: status;
		justify-self: end;
	}

	/* Activity: description + amount, date underneath. */
	.coinrewards-account .cr-activity-table tbody tr {
		grid-template-areas: "desc amount" "date amount";
		align-items: start;
	}
	.coinrewards-account .cr-activity-table .cr-log-desc {
		grid-area: desc;
	}
	.coinrewards-account .cr-activity-table .cr-log-amount {
		grid-area: amount;
		justify-self: end;
		align-self: center;
		font-size: 1rem;
	}
	.coinrewards-account .cr-activity-table .cr-log-date {
		grid-area: date;
		font-size: .78rem;
		color: var(--cr-muted);
		white-space: nowrap;
	}
}

/* Status badges never wrap (e.g. "Goedgekeurd"). */
.coinrewards-account .cr-badge {
	white-space: nowrap;
}

/* --- Refer a friend (featured earn card) --- */
.coinrewards-account .cr-ref-panel {
	background: var(--cr-soft);
	border: 1px solid var(--cr-accent);
	border-radius: var(--cr-radius);
	padding: 18px 20px;
}

.coinrewards-account .cr-ref-how {
	margin: 0 0 14px;
	color: var(--cr-ink);
	line-height: 1.5;
}

.coinrewards-account .cr-ref-share {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.coinrewards-account .cr-ref-link {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 11px;
	border: 1px solid var(--cr-line);
	border-radius: 8px;
	background: var(--cr-surface);
	font: inherit;
	color: var(--cr-ink);
}

.coinrewards-account .cr-ref-copy {
	flex: 0 0 auto;
	background: var(--cr-primary);
	border: 1px solid var(--cr-primary);
	color: #fff;
	border-radius: 8px;
	padding: 9px 18px;
	font-weight: 600;
	cursor: pointer;
}

.coinrewards-account .cr-ref-copy.is-copied {
	opacity: .75;
}

.coinrewards-account .cr-ref-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.coinrewards-account .cr-ref-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--cr-line);
	border-radius: 50%;
	background: var(--cr-surface);
	color: var(--cr-muted);
	text-decoration: none;
	transition: border-color .15s ease, color .15s ease, transform .15s ease;
}

.coinrewards-account .cr-ref-btn:hover,
.coinrewards-account .cr-ref-btn:focus-visible {
	border-color: var(--cr-primary);
	color: var(--cr-primary);
	transform: translateY(-1px);
	outline: none;
}

.coinrewards-account .cr-ref-icon {
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.coinrewards-account .cr-ref-btn {
		transition: none;
	}
}

.coinrewards-account .cr-ref-stats {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.coinrewards-account .cr-ref-stat {
	flex: 1 1 0;
	min-width: 90px;
	text-align: center;
	background: var(--cr-surface);
	border: 1px solid var(--cr-line);
	border-radius: 10px;
	padding: 12px 8px;
}

.coinrewards-account .cr-ref-stat-num {
	display: block;
	font-family: var(--fd, var(--fb, inherit));
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--cr-primary);
	line-height: 1.1;
}

.coinrewards-account .cr-ref-stat-label {
	display: block;
	margin-top: 4px;
	font-size: .78rem;
	color: var(--cr-muted);
}

.coinrewards-account .cr-ref-milestone {
	margin-bottom: 4px;
}

.coinrewards-account .cr-ref-milestone-text {
	font-size: .85rem;
	color: var(--cr-muted);
	margin-bottom: 6px;
}

.coinrewards-account .cr-ref-milestone--done {
	font-size: .9rem;
	font-weight: 600;
	color: var(--cr-pos);
	margin: 0;
}

.coinrewards-account .cr-ref-bar {
	height: 8px;
	border-radius: 999px;
	background: var(--cr-surface);
	border: 1px solid var(--cr-line);
	overflow: hidden;
}

.coinrewards-account .cr-ref-bar-fill {
	display: block;
	height: 100%;
	background: var(--cr-accent);
}

.coinrewards-account .cr-ref-friends {
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
}

.coinrewards-account .cr-ref-friend {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid var(--cr-line);
}

.coinrewards-account .cr-ref-friend:last-child {
	border-bottom: 0;
}

.coinrewards-account .cr-ref-friend-name {
	font-weight: 600;
}

.coinrewards-account .cr-ref-badge {
	font-size: .75rem;
	font-weight: 600;
	padding: 2px 10px;
	border-radius: 999px;
	white-space: nowrap;
}

.coinrewards-account .cr-ref-badge--ok {
	background: var(--c-ok-lt, #edf7f0);
	color: var(--c-ok-dk, #1b4332);
}

.coinrewards-account .cr-ref-badge--pending {
	background: var(--cr-surface);
	color: var(--cr-muted);
}

/* Earn-on-every-order note */
.coinrewards-account .cr-earn-note {
	margin: 10px 2px 0;
	font-size: .82rem;
	color: var(--cr-muted);
}
