/**
 * Wix Donations ([wix_donations]). The card grid and status lines are the
 * shared ones in wix-apps.css; colours come from the storefront tokens.
 *
 * @package Headless_Connect_For_Wix
 */

.wixhc-donations__progress { display: flex; flex-direction: column; gap: 6px; }
.wixhc-donations__raised { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.wixhc-donations__bar {
	position: relative;
	height: 8px;
	border-radius: var(--wixhc-radius-pill);
	overflow: hidden;
	background: var(--wixhc-surface-alt);
	box-shadow: inset 0 0 0 1px var(--wixhc-border);
}
.wixhc-donations__bar-fill {
	display: block;
	height: 100%;
	max-width: 100%;
	border-radius: inherit;
	background: var(--wixhc-accent);
}
.wixhc-donations__stats,
.wixhc-donations__ends,
.wixhc-donations__recurring { font-size: var(--wixhc-font-size-s); color: var(--wixhc-muted); }
.wixhc-donations__closed { color: var(--wixhc-muted); }

.wixhc-donations__form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.wixhc-donations__amounts,
.wixhc-donations__frequency {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}
.wixhc-donations__amounts legend,
.wixhc-donations__frequency legend {
	padding: 0;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.95em;
}
.wixhc-donations__amount,
.wixhc-donations__freq {
	display: inline-flex;
	flex-direction: column;
	gap: 2px;
	position: relative;
	padding: 10px 14px;
	border: 1px solid var(--wixhc-border-strong);
	border-radius: var(--wixhc-radius-m);
	background: var(--wixhc-surface);
	color: var(--wixhc-ink);
	cursor: pointer;
	transition: border-color var(--wixhc-duration) ease, box-shadow var(--wixhc-duration) ease;
	max-width: 100%;
	box-sizing: border-box;
}
.wixhc-donations__freq { flex-direction: row; align-items: center; gap: 6px; }
.wixhc-donations__amount input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.wixhc-donations__amount:hover,
.wixhc-donations__freq:hover { border-color: currentColor; }
.wixhc-donations__amount:has(input:checked),
.wixhc-donations__freq:has(input:checked) {
	border-color: var(--wixhc-brand);
	box-shadow: 0 0 0 1px var(--wixhc-brand) inset;
	background: var(--wixhc-brand-soft);
}
.wixhc-donations__amount:has(input:focus-visible) {
	outline: 2px solid var(--wixhc-focus);
	outline-offset: 2px;
}
.wixhc-donations__value { font-weight: 600; }
.wixhc-donations__impact { color: var(--wixhc-muted); font-size: 0.85em; overflow-wrap: anywhere; }
.wixhc-donations__fee { display: flex; gap: 8px; align-items: flex-start; font-size: 0.95em; }
.wixhc-donations__custom input { max-width: 200px; }

/* ---------- layout ----------
   A campaign card carries a whole donation form, which needs room. The
   widget is a size container: in a wide area the cards sit side by side
   (as many ~320 px cards as fit, never more than `columns`), each at its own
   height; in a text column (under ~720 px) they stack, one full-width card
   per campaign with its cover beside the form. */
.wixhc-root[data-wixhc="donations"] { container: wixhc-donations / inline-size; }
.wixhc-donations__list.wixhc-app-grid {
	grid-template-columns: repeat(auto-fill, minmax(max(320px, calc((100% - (var(--wixhc-columns, 3) - 1) * var(--wixhc-gap, 16px)) / var(--wixhc-columns, 3))), 1fr));
	align-items: start;
}
.wixhc-donations__list > .wixhc-donations__card:only-child { grid-column: 1 / -1; }
@container wixhc-donations (max-width: 719px) {
	.wixhc-donations__list.wixhc-app-grid { grid-template-columns: minmax(0, 1fr); gap: var(--wixhc-space-5); }
}
@container wixhc-donations (min-width: 520px) and (max-width: 719px) {
	.wixhc-donations__card:has(> .wixhc-donations__cover) { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: stretch; }
	.wixhc-donations__card > .wixhc-donations__cover { aspect-ratio: auto; min-height: 220px; height: 100%; }
	.wixhc-donations__card > .wixhc-donations__cover + .wixhc-app-card__body { padding: var(--wixhc-space-5); }
}
@container wixhc-donations (min-width: 720px) {
	.wixhc-donations__list > .wixhc-donations__card:only-child:has(> .wixhc-donations__cover) {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: stretch;
	}
	.wixhc-donations__card:only-child > .wixhc-donations__cover { height: 100%; min-height: 260px; aspect-ratio: auto; }
	.wixhc-donations__card:only-child > .wixhc-donations__cover + .wixhc-app-card__body { padding: var(--wixhc-space-5); }
}
.wixhc-donations__name { text-wrap: balance; }

/* Amount chips: an even grid, every chip the same width and height. */
.wixhc-donations__amounts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
	gap: var(--wixhc-space-2);
}
.wixhc-donations__amount { justify-content: center; min-height: 56px; padding: 10px 12px; text-align: left; }
.wixhc-donations__amount--other .wixhc-donations__value { font-weight: 500; font-size: 0.92em; }
.wixhc-donations__frequency { gap: var(--wixhc-space-2); }
.wixhc-donations__freq { flex: 1 1 120px; justify-content: flex-start; white-space: nowrap; min-height: var(--wixhc-control-h); padding-block: 8px; }
.wixhc-donations__freq input { margin: 0; }
.wixhc-donations__fee input { margin-top: 0.2em; }
.wixhc-donations__custom input { width: 100%; max-width: 240px; }
.wixhc-donations__form .wixhc-app-card__actions { padding-top: var(--wixhc-space-1); }
.wixhc-donations__donate { min-width: 160px; }
.wixhc-donations__card:only-child .wixhc-app-card__actions > .wixhc-card__btn { width: auto; align-self: flex-start; }
