/* ==========================================================================
   Currency switcher + single-currency prices (inc/pricing.php, currency.js).
   Which option is visible is set by inline CSS generated from
   tawa_currencies() + <html data-tawa-currency="…">.
   ========================================================================== */

/* Switcher ---------------------------------------------------------------- */
.tawa-currency {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--tawa-gutter-sm) var(--tawa-gutter-md);
	width: 100%;
}

/* No JS → prices show the default currency and the (inert) switcher hides. */
html:not([data-tawa-currency]) .tawa-currency {
	display: none;
}

.tawa-currency__label {
	font-size: var(--tawa-fs-small);
	font-weight: var(--tawa-fw-bold);
	color: var(--tawa-on-surface-variant);
}

.tawa-currency__group {
	display: inline-flex;
	gap: var(--tawa-gutter-xs);
	padding: var(--tawa-gutter-xs);
	background: var(--tawa-surface);
	border: 1px solid var(--tawa-outline-variant);
	border-radius: var(--tawa-radius-full);
	box-shadow: var(--tawa-shadow-sm);
}

body.tawa .tawa-currency__option {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35em;
	min-width: 92px;
	min-height: 44px;
	margin: 0;
	padding: 0 var(--tawa-gutter-md);
	border: 0;
	border-radius: var(--tawa-radius-full);
	background: transparent;
	box-shadow: none;
	color: var(--tawa-on-surface-variant);
	font-family: var(--tawa-font-primary);
	font-size: var(--tawa-fs-small);
	font-weight: var(--tawa-fw-bold);
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: none;
	cursor: pointer;
	transition: background-color var(--tawa-ease-state), color var(--tawa-ease-state);
}

body.tawa .tawa-currency__option:hover {
	background: var(--tawa-surface-container);
	color: var(--tawa-primary);
}

body.tawa .tawa-currency__option[aria-checked="true"] {
	background: var(--tawa-primary);
	color: var(--tawa-on-primary);
	box-shadow: var(--tawa-shadow-sm);
}

body.tawa .tawa-currency__option:focus {
	outline: none;
}

body.tawa .tawa-currency__option:focus-visible {
	outline: 2px solid var(--tawa-primary);
	outline-offset: 2px;
}

.tawa-currency__symbol {
	font-size: 1.15em;
}

/* /pricing/ page: switcher sits above the Spectra cards. */
.tawa-currency--block {
	flex: none; /* root wrap is a column flexbox: a 100% basis would mean 100% height */
	align-self: stretch;
	margin-bottom: var(--tawa-gutter-lg);
}

/* Prices ------------------------------------------------------------------ */
.tawa-price {
	display: inline-flex;
	align-items: baseline;
	font-variant-numeric: tabular-nums;
}

.tawa-price__opt {
	display: inline-flex;
	align-items: baseline;
	gap: 0.06em;
}

/* Subtle fade when the visitor switches (class added by currency.js). */
html.tawa-currency-anim .tawa-price__opt {
	animation: tawa-price-in 260ms ease-out;
}

@keyframes tawa-price-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.tawa-currency-anim .tawa-price__opt {
		animation: none;
	}

	body.tawa .tawa-currency__option {
		transition: none;
	}
}

/* Spectra price row on /pricing/ (replaces the "£ 15 /$ 20" headings). */
.tawa-block-price {
	display: flex;
	justify-content: center;
}

.tawa-price--block {
	font-family: var(--tawa-font-primary);
	font-size: clamp(2rem, 1.6rem + 1vw, 2.375rem);
	font-weight: var(--tawa-fw-bold);
	line-height: 1.2;
	color: var(--tawa-on-surface);
}

.tawa-price--block .tawa-price__symbol {
	color: var(--tawa-olive-green);
}

@media (max-width: 400px) {
	body.tawa .tawa-currency__option {
		min-width: 80px;
		padding: 0 var(--tawa-gutter-sm);
	}
}
