/* biome-ignore-all lint/style/noDescendingSpecificity: components in reading order, wider screens after the phone rules */
/* biome-ignore-all lint/suspicious/noDuplicateProperties: a plain colour stands before every color-mix(), for a browser that has none (Safari before 16.2) */
/* The choice screen of the checkout: what is bought as one compact card, the coin as tiles
   and its network as rows, and the pay step. Calm and flat, lists and rows, one main button:
   the look of paying in the bot. On a phone the pay step is one button in a bar that keeps
   to the bottom of the screen; on a laptop it is the summary card beside the choices. It
   extends static/site.css, checkout.css and purchase.css. */

/* ---------- the page ---------- */
.acct__col[data-view="catalog"][data-picker="closed"] {
	max-width: 980px;
}
.acct__col[data-view="catalog"] .kicker {
	display: none;
}
.acct__col[data-view="catalog"] .acct__head .h2 {
	font: 700 26px / 30px var(--ff-d);
	letter-spacing: -0.02em;
}
/* The choices take the height of the screen, so the bar that follows them stands at its
   bottom; while the page is longer than the screen the bar keeps to the bottom of it, and
   it leaves with the choices when the footer comes. */
.purchase-layout {
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: 1fr auto;
	gap: 16px;
	min-height: calc(100vh - 250px);
}
.catalog {
	display: grid;
	align-content: start;
	gap: 16px;
}
.catalog > * {
	min-width: 0;
}
.catalog > .open-order {
	margin: 0;
}
.buy {
	display: contents;
}

/* ---------- what is bought ---------- */
.chosen {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--s1);
}
.chosen__what {
	min-width: 0;
}
.chosen__t {
	font: 700 19px / 24px var(--ff-d);
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}
.chosen__s {
	color: var(--dim);
	font-size: 13px;
	line-height: 18px;
}
#chosen-line:not(:empty)::after {
	content: " · ";
	white-space: pre;
}
.chosen__s .text-button {
	display: inline;
	min-height: 0;
	padding: 7px 0;
	color: var(--text);
	font-size: 13px;
	line-height: 18px;
}
.chosen__p {
	flex: none;
	margin-left: auto;
	font: 700 26px / 1 var(--ff-d);
	letter-spacing: -0.02em;
}

/* ---------- the coin, then its network ---------- */
.pay-choice {
	display: grid;
	gap: 16px;
}
.pick__h {
	margin: 2px 4px 8px;
	color: var(--dim);
	font: 600 13px / 18px var(--ff-b);
	letter-spacing: 0.02em;
}
.coin-rows + .pick__h,
.coin-tiles + .pick__h {
	margin-top: 18px;
}
.coin-tiles {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 8px;
}
.coins .coin-tile {
	position: relative;
	display: grid;
	margin: 0;
	justify-items: center;
	align-content: start;
	gap: 7px;
	min-width: 0;
	min-height: 86px;
	padding: 12px 2px 10px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--s1);
	color: var(--muted);
	font: 600 12.5px / 16px var(--ff-b);
	text-align: center;
	cursor: pointer;
}
.coin-tile__n {
	max-width: 100%;
	overflow-wrap: anywhere;
}
/* the narrowest phones: five tiles in a row, and each name still on one line */
@media (max-width: 359px) {
	.coin-tiles {
		gap: 6px;
	}
	.coins .coin-tile {
		padding-inline: 1px;
		font-size: 11.5px;
	}
}
.coins .coin-tile.is-on {
	border-color: var(--violet);
	background: var(--s3);
	box-shadow: inset 0 0 0 1px var(--violet);
	color: var(--text);
}
.coin-tile__dots {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--s3);
	color: var(--muted);
}
.coin-tile.is-on .coin-tile__dots {
	background: var(--s2);
}
.coin-tile__why {
	color: var(--dim);
	font: 400 11px / 14px var(--ff-b);
}
/* (order.css, which comes later, has the small mark of the order card) */
.coins .coin-mark--l {
	width: 36px;
	height: 36px;
	padding: 6px;
}
.coin-rows {
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--s1);
}
#coin-others {
	margin-top: 8px;
}
.coins .coin-row {
	position: relative;
	display: flex;
	margin: 0;
	color: var(--text);
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding: 8px 16px;
	border-top: 1px solid var(--line);
	font: 600 16px / 20px var(--ff-b);
	cursor: pointer;
}
.coin-row:first-child {
	border-top: 0;
}
.coin-row__n {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
}
.coin-row__dim {
	color: var(--dim);
}
.coin-row small {
	display: block;
	color: var(--dim);
	font: 400 13px / 17px var(--ff-b);
}
.coin-row__radio {
	flex: none;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 2px var(--line-2);
}
.coin-row__radio .ico {
	width: 14px;
	height: 14px;
	stroke-width: 2.6;
}
.coin-row.is-on .coin-row__radio {
	background: var(--violet);
	box-shadow: none;
	color: var(--ink);
}
/* a pair that cannot take this purchase: closed, with the reason in its own words */
.coins .coin-tile.is-locked,
.coins .coin-row.is-locked {
	color: var(--dim);
	cursor: default;
}
.is-locked .coin-mark {
	opacity: 0.45;
}
.coin-row.is-locked .coin-row__radio {
	background: none;
	box-shadow: none;
	color: var(--dim);
}
.coin-row.is-locked .coin-row__radio .ico {
	width: 18px;
	height: 18px;
	stroke-width: 1.8;
}
/* the radio inside a tile or a row has the keyboard: its ring is drawn around the whole */
.pick__ring {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
}
.sr:focus-visible + .pick__ring {
	outline: 2px solid var(--cyan);
	outline-offset: 3px;
}

/* ---------- signing in, at the pay step ---------- */
/* On the checkout a visitor chooses first: the block that signs in stands here, after the
   choices (paystep.js moves it), and the button of the pay step leads to it. */
.pay-signin {
	display: grid;
	gap: 16px;
}
.pay-signin > * {
	width: 100%;
	min-width: 0;
	/* as wide as the choices above it on a laptop; no wider under the open picker */
	max-width: 640px;
	scroll-margin-top: 88px;
}

/* ---------- the pay step ---------- */
.paybar {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: grid;
	gap: 10px;
	margin: 0 calc(-1 * var(--gut));
	padding: 10px var(--gut) calc(12px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--line);
	background: var(--navy);
}
/* on a phone the choices above the bar are the summary: the card of it is a laptop's */
.total__h,
.total,
.total__sum {
	display: none;
}
/* The pay button says the sum and, where no summary stands beside it, the pair after it:
   one phrase on one line where it fits. Where it does not, the pair goes to a line of its
   own under the sum (paystep.js marks the button), without the dot that joined them. */
.paybar .btn {
	flex-wrap: wrap;
	align-content: center;
	gap: 0 0.3em;
	padding: 8px 16px;
	font-size: 16px;
	line-height: 20px;
}
#purchase[data-stacked] {
	flex-direction: column;
	flex-wrap: nowrap;
}
#purchase[data-stacked] .pay__dot {
	display: none;
}
#purchase[data-stacked] .pay__pair {
	font: 500 13.5px / 18px var(--ff-b);
}
.paybar .fineprint {
	margin: 0;
}
.paybar .legal-consent {
	font-size: 12px;
	line-height: 17px;
	text-align: center;
}
/* what the server said of a refused purchase, at the button, with the way forward under it */
.refusal {
	display: grid;
	gap: 8px;
}
.refusal__note {
	display: flex;
	gap: 10px;
	padding: 8px 12px;
	border: 1px solid rgba(255, 195, 90, 0.45);
	border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
	border-radius: 16px;
	background: #2d2b47;
	background: color-mix(in srgb, var(--warn) 7%, var(--s2));
	font: 500 14px / 19px var(--ff-b);
	text-align: left;
}
.refusal__note .ico {
	margin-top: 1px;
	color: var(--warn);
}
.refusal__text strong {
	display: block;
	font: 600 14.5px / 19px var(--ff-b);
}
.refusal__text small {
	display: block;
	margin-top: 1px;
	color: var(--muted);
	font: 400 12.5px / 17px var(--ff-b);
}
.refusal .ref-line {
	padding: 0 4px;
}
/* a message of the pay step stands after the bar and is brought into view above it */
.buy > .msg {
	scroll-margin-bottom: 24px;
}

/* ---------- a laptop: the choices on the left, the summary card on the right ---------- */
@media (min-width: 1000px) {
	.acct__col[data-view="catalog"] .acct__head .h2 {
		font-size: 34px;
		line-height: 40px;
	}
	.purchase-layout {
		grid-template-columns: minmax(0, 1fr) 340px;
		grid-template-rows: auto;
		gap: 32px;
		align-items: start;
		min-height: 0;
	}
	.buy {
		position: sticky;
		top: 96px;
		display: grid;
		gap: 12px;
	}
	.chosen {
		padding: 16px 20px;
	}
	.coins .coin-tile {
		gap: 9px;
		padding: 16px 4px 14px;
		font-size: 14.5px;
	}
	.coins .coin-tile .coin-mark--l,
	.coin-tile__dots {
		width: 44px;
		height: 44px;
	}
	.paybar {
		position: static;
		gap: 0;
		margin: 0;
		padding: 20px;
		border: 1px solid var(--line);
		border-radius: 20px;
		background: var(--s1);
	}
	.total__h {
		display: block;
		margin-bottom: 6px;
		font: 700 18px / 22px var(--ff-d);
	}
	.total {
		display: block;
		margin: 0;
	}
	.total__row {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		padding: 11px 0;
		border-top: 1px solid var(--line);
		font-size: 15px;
		line-height: 20px;
	}
	.total__row dt {
		color: var(--dim);
	}
	.total__row dd {
		margin: 0;
		text-align: right;
		overflow-wrap: anywhere;
	}
	.total__sum {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		padding: 14px 0 16px;
		border-top: 1px solid var(--line);
		font: 700 30px / 1 var(--ff-d);
	}
	.total__sum span {
		color: var(--dim);
		font: 400 15px / 1 var(--ff-b);
	}
	/* the summary names the coin and the network: the button says the sum alone */
	.pay__pair {
		display: none;
	}
	.paybar .btn {
		font-size: 17px;
	}
	.paybar .refusal,
	.paybar .fineprint:not([hidden]) {
		margin-top: 12px;
	}
	.paybar .refusal {
		margin: 0 0 12px;
	}
}
