/* Ways to pay: rows, cards or detailed. Colours and shapes come from the design tokens only. */

.ways-to-pay {
	padding-block: clamp(2.5rem, 6vw, 4rem);
}

.ways-to-pay__title {
	margin: 0 0 1.25rem;
	font-family: var(--fh);
	font-size: clamp(1.6rem, 3.5vw, 2.2rem);
	line-height: 1.15;
	color: var(--ink);
}

.ways-to-pay__intro {
	max-width: 68ch;
	margin: -0.25rem 0 1.75rem;
	color: var(--ink);
}

.ways-to-pay__intro p {
	margin: 0 0 0.75rem;
}

.ways-to-pay__list {
	display: grid;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 720px) {
	.ways-to-pay__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ways-to-pay__item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	background: var(--surface);
	border-radius: var(--card-r);
}

/*
 * Logo box: a fixed size per style, so the card never jumps when the image loads. The image fills the
 * box and scales down inside it (object-fit: contain), so a wide logo and a square one both fit whole,
 * never spilling over the text. Each style below only changes the box's width and height.
 */
.ways-to-pay__logo {
	flex: 0 0 auto;
	display: block;
	width: 4.5rem;
	height: 3rem;
}

.ways-to-pay__logo-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
	object-position: center;
}

.ways-to-pay__text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
	overflow-wrap: anywhere; /* a long word never pushes out of the card */
}

.ways-to-pay__name {
	font-weight: 700;
	line-height: 1.25;
	color: var(--ink);
}

.ways-to-pay__desc,
.ways-to-pay__note {
	font-size: 0.95rem;
	color: var(--muted);
}

.ways-to-pay__extra {
	margin: 1rem 0 0;
	color: var(--ink);
}

.ways-to-pay__extra p {
	margin: 0 0 0.5rem;
}

.ways-to-pay__call {
	margin: 1.25rem 0 0;
	color: var(--ink);
}

/* ---------- Rows, look C: hairline rows, no card ---------- */

body.look-c .ways-to-pay--rows .ways-to-pay__item {
	padding-inline: 0;
	background: none;
	border-radius: 0;
	border-bottom: 1px solid var(--line);
}

body.look-c .ways-to-pay--rows .ways-to-pay__list {
	gap: 0;
}

/* ---------- Cards ---------- */

/*
 * Side by side (720px and wider), every card in the block is the same height: each row takes the height
 * of the tallest card in the whole block (grid-auto-rows: 1fr), so long text grows all the cards
 * together. Stacked one per row on a phone, each card keeps its own height.
 */
.ways-to-pay--cards .ways-to-pay__list {
	gap: 1rem;
}

@media (min-width: 720px) {
	.ways-to-pay--cards .ways-to-pay__list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
}

@media (min-width: 1000px) {
	.ways-to-pay--cols-3 .ways-to-pay__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.ways-to-pay--cols-4 .ways-to-pay__list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.875rem; }
}

/* Rounded and square boxes, logo on the left: logo box, then the text, centred on the card's height. */
.ways-to-pay--cards .ways-to-pay__item {
	gap: 1.25rem;
	min-height: 6rem;
	padding: 1.25rem 1.5rem;
}

.ways-to-pay--cards .ways-to-pay__logo {
	width: 7.5rem;
	height: 3.5rem;
}

.ways-to-pay--shape-rounded .ways-to-pay__item { border-radius: var(--card-r); }
.ways-to-pay--shape-square .ways-to-pay__item { border-radius: 0; }

/* Rounded and square boxes, logo on top: logo box centred above the text, everything centred. */
.ways-to-pay--logo-top:is(.ways-to-pay--shape-rounded, .ways-to-pay--shape-square) .ways-to-pay__item {
	flex-direction: column;
	justify-content: flex-start;
	gap: 1rem;
	padding: 1.75rem 1.5rem;
	text-align: center;
}

.ways-to-pay--logo-top:is(.ways-to-pay--shape-rounded, .ways-to-pay--shape-square) .ways-to-pay__logo {
	width: min(100%, 10rem);
	height: 4.5rem;
}

.ways-to-pay--logo-top:is(.ways-to-pay--shape-rounded, .ways-to-pay--shape-square) .ways-to-pay__text {
	align-items: center;
}

/* No logo: the name sits in the middle of the card instead of at the top. */
.ways-to-pay--logo-top:is(.ways-to-pay--shape-rounded, .ways-to-pay--shape-square) .ways-to-pay__item--no-logo {
	justify-content: center;
}

/* Pill: logo on the left, then the name and short description, left-aligned. Grows taller with long text. */
.ways-to-pay--shape-pill .ways-to-pay__item {
	gap: 1.25rem;
	min-height: 5.5rem;
	padding: 1rem 2.25rem 1rem 1.5rem;
	border-radius: 999px;
}

.ways-to-pay--shape-pill .ways-to-pay__logo {
	width: 6.5rem;
	height: 3rem;
}

.ways-to-pay--shape-pill .ways-to-pay__item--no-logo {
	justify-content: center;
	padding-inline: 2.25rem;
	text-align: center;
}

.ways-to-pay--shape-pill .ways-to-pay__item--no-logo .ways-to-pay__text {
	align-items: center;
}

/*
 * Circle: the logo box above the name, both inside the circle's padding, so they never overlap.
 * Every circle is the same size; the name is kept to three lines. Two across on a phone.
 */
.ways-to-pay--shape-circle .ways-to-pay__list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: auto;
	gap: 1rem 0.75rem;
}

@media (min-width: 720px) {
	.ways-to-pay--shape-circle .ways-to-pay__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
	.ways-to-pay--shape-circle.ways-to-pay--cols-2 .ways-to-pay__list { grid-template-columns: repeat(2, minmax(0, 15rem)); }
	.ways-to-pay--shape-circle.ways-to-pay--cols-3 .ways-to-pay__list { grid-template-columns: repeat(3, minmax(0, 15rem)); }
	.ways-to-pay--shape-circle.ways-to-pay--cols-4 .ways-to-pay__list { grid-template-columns: repeat(4, minmax(0, 15rem)); gap: 1.25rem; }
}

.ways-to-pay--shape-circle .ways-to-pay__item {
	flex-direction: column;
	justify-content: center;
	align-self: center;
	gap: 0.75rem;
	aspect-ratio: 1;
	width: min(100%, 15rem);
	min-height: 0;
	margin-inline: auto;
	padding: 16%;
	border-radius: 50%;
	text-align: center;
}

.ways-to-pay--shape-circle .ways-to-pay__logo {
	width: 100%;
	height: 2.75rem;
}

@media (min-width: 720px) {
	.ways-to-pay--shape-circle .ways-to-pay__logo { height: 3.75rem; }
}

.ways-to-pay--shape-circle .ways-to-pay__item--no-logo {
	gap: 0;
}

.ways-to-pay--shape-circle .ways-to-pay__text {
	align-items: center;
	width: 100%;
}

.ways-to-pay--shape-circle .ways-to-pay__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	font-size: 0.95rem;
	line-height: 1.2;
	text-wrap: balance;
}

/* Card colours. Default: a white card with a thin edge. */
.ways-to-pay--tone-surface .ways-to-pay__item { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.ways-to-pay--tone-shadow .ways-to-pay__item { background: var(--surface); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent), 0 6px 20px color-mix(in srgb, var(--ink) 8%, transparent); }
.ways-to-pay--tone-tint .ways-to-pay__item { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.ways-to-pay--tone-outline .ways-to-pay__item { background: transparent; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 55%, var(--surface)); }

/* ---------- Detailed: long text beside a large picture ---------- */

.ways-to-pay__details {
	display: grid;
	gap: clamp(3rem, 7vw, 5.5rem);
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.ways-to-pay__detail {
	display: grid;
	gap: 1.5rem;
	align-items: center;
}

@media (min-width: 900px) {
	.ways-to-pay__detail {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: clamp(2.5rem, 6vw, 5rem);
	}

	.ways-to-pay__detail--flip .ways-to-pay__detail-media { order: -1; }

	.ways-to-pay__detail--no-media { grid-template-columns: minmax(0, 68ch); }
}

.ways-to-pay__detail-text {
	max-width: 60ch;
	color: var(--ink);
}

.ways-to-pay__detail-name {
	margin: 0 0 0.5rem;
	font-family: var(--fh);
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	line-height: 1.2;
	color: var(--ink);
}

.ways-to-pay__detail-lead {
	margin: 0 0 1rem;
	font-weight: 600;
	color: var(--muted);
}

.ways-to-pay__body {
	line-height: 1.65;
}

.ways-to-pay__body p,
.ways-to-pay__body ul,
.ways-to-pay__body ol {
	margin: 0 0 1rem;
}

.ways-to-pay__body ul,
.ways-to-pay__body ol {
	padding-left: 1.25rem;
}

.ways-to-pay__body li {
	margin-bottom: 0.35rem;
}

.ways-to-pay__detail .ways-to-pay__note {
	margin: 0 0 1rem;
}

.ways-to-pay__more {
	margin: 1.5rem 0 0;
}

/* The picture keeps its own shape; the box only rounds its corners. */
.ways-to-pay__detail-media {
	overflow: hidden;
	border-radius: var(--card-r);
}

.ways-to-pay__picture-img {
	display: block;
	width: 100%;
	height: auto;
}

/* No picture: the logo, centred in a white box. */
.ways-to-pay__detail-media--logo {
	display: grid;
	place-items: center;
	aspect-ratio: 3 / 2;
	padding: 12%;
	background: var(--surface);
	box-shadow: 0 0 0 1px var(--line);
}

.ways-to-pay__detail-media--logo .ways-to-pay__logo-img {
	max-height: 100%;
}
