/*
 * Pricing (ADR 0095): the heading, the switch, then the plans side by side — at most 22rem wide each, centered,
 * one under another on narrow screens. The cards are Pricing plans (their look and the raised recommended one).
 */
.sv-pricing {
	display: grid;
	gap: var(--sv-space-md);
}

/*
 * As many plans side by side as fit at 15rem or more (three plans don't drop to two and one below them while 22rem
 * each wouldn't fit), each at most 22rem: the row is never wider than its plans at 22rem, centered.
 */
.sv-pricing__plans {
	--sv-plans: 4;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
	gap: var(--sv-colgap, var(--sv-space-element, var(--sv-space-md)));
	inline-size: 100%;
	max-inline-size: calc(var(--sv-plans) * 22rem + (var(--sv-plans) - 1) * var(--sv-colgap, var(--sv-space-element, var(--sv-space-md))));
	margin-inline: auto;
	align-items: stretch;
	padding-block: 0.75rem;
}

.sv-pricing__plans:has(> :last-child:nth-child(1)) {
	--sv-plans: 1;
}

.sv-pricing__plans:has(> :last-child:nth-child(2)) {
	--sv-plans: 2;
}

.sv-pricing__plans:has(> :last-child:nth-child(3)) {
	--sv-plans: 3;
}

/* The switch: two choices in a soft pill, the chosen one raised in the page's color. */
.sv-pricing__switch {
	display: inline-flex;
	justify-self: center;
	gap: 0.25rem;
	padding: 0.25rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--sv-color-text) 7%, transparent);
}

.sv-pricing__switch--start {
	justify-self: start;
}

.sv-pricing__switch--end {
	justify-self: end;
}

.sv-pricing__option {
	position: relative;
	display: inline-flex;
	gap: 0.45rem;
	align-items: center;
	padding: 0.45rem 1.1rem;
	border-radius: 999px;
	color: var(--sv-color-muted);
	font-size: var(--sv-size-small);
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.sv-pricing__option input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.sv-pricing__option:has(input:checked) {
	background: var(--sv-color-background);
	box-shadow: 0 1px 3px rgb(16 24 40 / 12%);
	color: var(--sv-color-text);
}

.sv-pricing__option:has(input:focus-visible) {
	outline: 2px solid var(--sv-focus, var(--sv-color-text));
	outline-offset: 2px;
}

.sv-pricing__save {
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--sv-color-primary) 14%, transparent);
	color: var(--sv-accent, var(--sv-color-link));
	font-size: 0.75rem;
}

/* The first price until the second choice is picked. */
.sv-pricing__price-b {
	display: none;
}

.sv-pricing:has(.sv-pricing__option--b input:checked) .sv-pricing__price-a {
	display: none;
}

.sv-pricing:has(.sv-pricing__option--b input:checked) .sv-pricing__price-b {
	display: flex;
}

/* What is included: a bulleted list whose points take the feature icon (--sv-glyph, from its sv-glyph-<name> class). */
.sv-pricing__features :is(ul, ol) {
	display: grid;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sv-pricing__features li {
	display: flex;
	gap: 0.65em;
	align-items: flex-start;
}

.sv-pricing__features li::before {
	flex: none;
	inline-size: 1.25em;
	block-size: 1.25em;
	margin-block-start: calc((1em * 1.6 * var(--sv-leading-body, 1) - 1.25em) / 2);
	background-color: var(--sv-accent, var(--sv-color-primary));
	content: "";
	-webkit-mask: var(--sv-glyph) center / contain no-repeat;
	mask: var(--sv-glyph) center / contain no-repeat;
}

.sv-pricing__features p {
	margin: 0;
}

.sv-pricing__features p + :is(p, ul, ol),
.sv-pricing__features :is(ul, ol) + p {
	margin-block-start: 0.75rem;
}

/* Text size (ADR 0187): the plans' description and what is included; names and prices keep their sizes. */
.sv-pricing--text-size-sm :is(.sv-pricing-plan__text, .sv-pricing__features) {
	font-size: var(--sv-size-small);
}

.sv-pricing--text-size-lg :is(.sv-pricing-plan__text, .sv-pricing__features) {
	font-size: var(--sv-size-large);
}

.sv-pricing--text-size-custom :is(.sv-pricing-plan__text, .sv-pricing__features) {
	font-size: var(--sv-custom-text-size);
}

/* Recommended plan taller, off (ADR 0187): the recommended plan stands level with the others, its look and shadow kept. */
@media (min-width: 768px) {
	.sv-pricing--raise-none .sv-pricing-plan:is(.sv-pricing-plan--highlight-accent, .sv-pricing-plan--highlight-outline) {
		margin-block: 0;
	}
}
