/*
 * E-gift vouchers: the /gift-card/ page (inc/eGiftPage.php, behaviour in assets/js/eGift.js).
 *
 * Hand-written: NOT part of the SCSS build, like searchBox.css. Every class starts eg-. The page is Bootstrap; this
 * only adds the segmented Shop / Raceway choice, the amount buttons, the live gift card tile and the done state.
 * Dark #222 and brand red #CC0000 as the gift card email uses.
 */

.eg-page {
	max-width: 1120px;
}

.eg-step-title {
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 .85rem;
}

.eg-err {
	color: #b00020;
	font-size: .875rem;
	margin-top: .3rem;
}

.eg-err:empty {
	display: none;
}

/* Shop / Raceway */
.eg-seg {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .5rem;
}

.eg-seg-opt {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: .2rem;
	padding: .85rem .85rem;
	border: 1px solid #ced4da;
	border-radius: .5rem;
	cursor: pointer;
	background: #fff;
	height: 100%;
	transition: border-color .15s, box-shadow .15s;
}

/* The logo above each choice: our normal logo for the shop, the Raceway badge for the track. One box for both
   (the wide logo fills its width, the badge its height), so the logos and the words under them line up. */
.eg-seg-logo {
	flex: 0 0 auto;
	width: 150px;
	max-width: 100%;
	height: 44px;
	object-fit: contain;
	margin-bottom: .45rem;
}

.eg-seg-text {
	display: flex;
	flex-direction: column;
	gap: .2rem;
	min-width: 0;
}

/* A choice with no logo (send it to me / to someone else): words ranged left. */
.eg-seg-opt--plain {
	align-items: flex-start;
	text-align: left;
}

.eg-seg-name {
	font-weight: 600;
	color: #222;
}

.eg-seg-note {
	font-size: .82rem;
	color: #6c757d;
	line-height: 1.3;
}

.btn-check:checked + .eg-seg-opt {
	border-color: #222;
	box-shadow: inset 0 0 0 1px #222;
}

/* Nothing chosen where a choice is needed. */
.btn-check.is-invalid + .eg-seg-opt {
	border-color: #dc3545;
}

.btn-check:focus-visible + .eg-seg-opt {
	outline: 3px solid rgba(204, 0, 0, .35);
	outline-offset: 2px;
}

/* Amount buttons */
.eg-amts {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: .5rem;
}

.eg-amt {
	border: 1px solid #ced4da;
	background: #fff;
	color: #222;
	font-weight: 600;
	font-size: 1.05rem;
	padding: .6rem 0;
	border-radius: .5rem;
}

.eg-amt:hover {
	border-color: #222;
	color: #222;
}

.btn-check:checked + .eg-amt {
	background: #222;
	border-color: #222;
	color: #fff;
}

.btn-check:focus-visible + .eg-amt {
	outline: 3px solid rgba(204, 0, 0, .35);
	outline-offset: 2px;
}

.eg-other {
	max-width: 220px;
}

/* The side column: tile, payment */
@media (min-width: 992px) {
	/* Sticks BELOW the site's own sticky header, not under it: the page's script measures the header and sets
	   `top` (placeSide() in eGift.js); 7.5rem is the stand-in until it has. When the column is taller than the
	   window the script sticks it by its bottom edge instead, so the Pay button stays on screen. */
	.eg-side {
		position: sticky;
		top: 7.5rem;
	}
}

.eg-card {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	padding: 1.25rem 1.35rem 1.35rem;
	color: #fff;
	background: #222;
	background-image: linear-gradient(135deg, #2b2b2b 0%, #1a1a1a 100%);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	min-height: 190px;
}

/* The logo in the card's corner: our round W for a shop card, the Raceway badge for a Raceway one. */
.eg-card::after {
	content: "";
	position: absolute;
	right: 1.1rem;
	top: 1.1rem;
	width: 72px;
	height: 72px;
	background: url(../img/logos/logo_round_144.webp) center / contain no-repeat;
}

.eg-card--raceway::after {
	width: 92px;
	height: 68px;
	background-image: url(https://imgr2.wheelspinmodels.co.uk/assets/logos/racewayLogo_165w.webp);
}

.eg-card-top {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
}

.eg-card-brand {
	font-weight: 700;
	letter-spacing: .02em;
}

.eg-card-kind {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: rgba(255, 255, 255, .65);
}

.eg-card-amount {
	position: relative;
	z-index: 1;
	font-size: 2.6rem;
	font-weight: 700;
	line-height: 1.1;
	margin: .9rem 0 .7rem;
}

.eg-card-lines {
	position: relative;
	z-index: 1;
	font-size: .95rem;
}

.eg-card-lines > div {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.eg-card-lbl {
	display: inline-block;
	min-width: 3.2em;
	color: rgba(255, 255, 255, .6);
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .08em;
}

.eg-card-msg {
	position: relative;
	z-index: 1;
	margin-top: .75rem;
	padding-top: .65rem;
	border-top: 1px solid rgba(255, 255, 255, .18);
	font-size: .9rem;
	font-style: italic;
	white-space: pre-line;
	overflow-wrap: anywhere;
	max-height: 8.5em;
	overflow: hidden;
}

.eg-total {
	font-size: 1.35rem;
	font-weight: 700;
}

.eg-payment {
	min-height: 60px;
}

/* How it works */
.eg-how {
	max-width: 760px;
}

.eg-how-list {
	padding-left: 1.2rem;
	margin-bottom: .75rem;
}

.eg-how-list li {
	margin-bottom: .3rem;
}

/* Done */
.eg-done {
	max-width: 680px;
	margin: 0 auto;
}

.eg-done:focus {
	outline: none;
}

.eg-done-tick {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #222;
	color: #fff;
	font-size: 1.5rem;
	line-height: 48px;
	text-align: center;
	margin-bottom: 1rem;
}

.eg-done-list {
	padding-left: 1.1rem;
	margin: 0;
}

.eg-done-list li {
	margin-bottom: .4rem;
	overflow-wrap: anywhere;
}

/* A phone */
@media (max-width: 575.98px) {
	.eg-seg {
		grid-template-columns: 1fr;
	}

	.eg-amts {
		grid-template-columns: repeat(2, 1fr);
	}

	.eg-card-amount {
		font-size: 2.2rem;
	}

	.eg-other {
		max-width: none;
	}
}
