/* One priced item. The name and price lead, the action label sits beside them,
   and points and fine print run the full width beneath. The whole item is the
   link or button, so hovering anywhere fills the label. */
.price {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0 var(--s-sm);
	width: 100%;
	padding: var(--s-xs);
	border-radius: var(--s-xs);
	font: inherit;
	color: var(--c-fg-md);
	text-align: left;
	text-decoration: none;
	transition: background-color var(--a-sm);

	> * {
		grid-column: 1 / -1;
	}

	/* Name, price, compare and unit price, on one line where they fit. */
	> span:first-child {
		grid-column: 1;
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 0 var(--s-xs);

		/* The name leads in near-black; the price follows in blue, a touch
		   larger, so colour carries it rather than weight of ink. */
		> strong {
			color: var(--c-fg-dk);
		}

		> em {
			font-family: var(--f-l);
			font-size: 1.15rem;
			font-weight: bold;
			color: var(--c-blue-dk);

			> s {
				margin-right: var(--s);
				font-size: 0.75em;
				font-weight: normal;
				color: var(--c-fg-md);
			}
		}

		> small {
			width: 100%;
		}
	}

	/* Points. */
	> span:not(:first-child, .btw-btn) {
		display: flex;
		flex-direction: column;
		gap: var(--s);
		margin-top: var(--s);

		/* Balanced, so a long point doesn't leave one word on its last line. */
		> span {
			position: relative;
			padding-left: var(--s-sm);
			text-wrap: balance;

			&:before {
				content: "✓";
				position: absolute;
				left: 0;
				color: var(--c-blue-dk);
				font-weight: bold;
			}
		}
	}

	> small {
		margin-top: var(--s);
		font-style: italic;
		text-wrap: balance;
	}

	/* The action label: drawn as a button, but the item is what's clicked. The
	   outline is drawn outside it; keep that inside the item. */
	> .btw-btn {
		grid-column: 2;
		grid-row: 1;
		margin-right: calc(var(--s) * 0.5);
	}

	/* Not on sale yet: still readable, clearly not clickable, and the label
	   says when it will be. */
	&.mod-locked {
		> :not(em) {
			opacity: 0.5;
		}

		> em {
			grid-column: 2;
			grid-row: 1;
			color: var(--c-blue-dk);
			font-weight: bold;
			white-space: nowrap;
		}
	}

	&:is(a, button) {
		cursor: pointer;

		&:hover,
		&:focus-visible {
			background-color: var(--c-bg-md);
			text-decoration: none;

			> .btw-btn {
				color: var(--c-white) !important;

				&:before {
					transform-origin: left;
					transform: scaleX(1);
				}
			}
		}

		&:focus-visible {
			outline: 2px solid var(--c-blue-dk);
		}
	}
}
