/*--------------------------------------------------------------
# Book a Call — Seat Change
# One seat, before and after the call: 36E to 2A on a split-flap
# board, a backrest that reclines into a bed, and three rows that
# go from economy, middle and cash to business, window and points.
--------------------------------------------------------------*/

/* ── Section ──
   Bottom padding only: .bac-compare above supplies the gap over this, and
   .bac-next below carries no top padding, so this section's bottom padding
   is the white gap above the closing box. A light section between those two
   dark ones on purpose. */
.bac-seat {
	/* The theme loads no monospace font; the same system stack the other
	   Book a Call sections use. */
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
	--spring: cubic-bezier(0.34, 1.56, 0.64, 1);

	background: var(--tpp-white);
	padding: 0 0 100px;
}

.bac-seat__container {
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
}

.bac-seat__heading {
	text-align: center;
	font-family: var(--tpp-font-heading);
	font-size: clamp(1.9rem, 4vw + 0.5rem, 3rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--tpp-black);
	margin: 0 0 32px;
}


/* ── Before / after toggle ──
   Two classes on the button rules: style.css styles every <button> at one
   class plus an element. */
.bac-seat__toggle {
	display: flex;
	width: max-content;
	max-width: 100%;
	margin: 0 auto;
	padding: 5px;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-off-white);
	box-shadow: inset 0 0 0 1px var(--tpp-border-light);
}

.bac-seat .bac-seat__toggle button {
	margin: 0;
	padding: 10px 20px;
	border: 0;
	border-radius: var(--tpp-radius-pill);
	background: transparent;
	color: var(--tpp-text-light);
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease;
}

.bac-seat .bac-seat__toggle button[aria-pressed="true"] {
	background: var(--tpp-black);
	color: var(--tpp-white);
}

.bac-seat .bac-seat__toggle button:focus-visible {
	outline: 2px solid var(--tpp-black);
	outline-offset: 2px;
}


/* ──────────────────────────────────────────────
   The card
   ────────────────────────────────────────────── */

.bac-seat__card {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 48px;
	align-items: center;
	max-width: 920px;
	margin: 28px auto 0;
	padding: 44px 48px;
	border: 1px solid var(--tpp-border-light);
	border-radius: 28px;
	background: var(--tpp-off-white);
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* .is-visible comes from the page's shared observer in js/book-a-call-hero.js */
.bac-seat.is-visible .bac-seat__card {
	opacity: 1;
	transform: translateY(0);
}


/* ── The seat ──
   The backrest and legrest turn about their hinges, set in viewBox units. */
.bac-seat__art {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.bac-seat__fill {
	fill: var(--tpp-white);
	stroke: var(--tpp-black);
	stroke-width: 3;
	stroke-linejoin: round;
}

.bac-seat__line {
	fill: none;
	stroke: var(--tpp-black);
	stroke-width: 3;
	stroke-linecap: round;
}

.bac-seat__pillow {
	fill: var(--tpp-accent);
	stroke: var(--tpp-black);
	stroke-width: 3;
}

.bac-seat__glass {
	fill: #E6EFF4;
}

.bac-seat__back {
	transform-box: view-box;
	transform-origin: 124px 108px;
	transform: rotate(-14deg);
	transition: transform 1.1s var(--spring);
}

.bac-seat__leg {
	transform-box: view-box;
	transform-origin: 222px 110px;
	transform: rotate(-6deg);
	transition: transform 1.1s var(--spring) 0.1s;
}

/* A middle seat has no window */
.bac-seat__window {
	opacity: 0;
	transition: opacity 0.6s ease 0.3s;
}

.bac-seat.is-after .bac-seat__back,
.bac-seat.is-after .bac-seat__leg {
	transform: rotate(-90deg);
}

.bac-seat.is-after .bac-seat__window {
	opacity: 1;
}


/* ── Seat number and rows ── */
.bac-seat__label {
	font-family: var(--mono);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--tpp-text-light);
}

.bac-seat__tiles {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}

/* A split-flap tile: darker top half, a seam through the middle */
.bac-seat__tile {
	position: relative;
	display: grid;
	place-items: center;
	width: 72px;
	height: 92px;
	border-radius: 12px;
	background: linear-gradient(180deg, #282828 0 50%, var(--tpp-black) 50% 100%);
	color: var(--tpp-white);
	font-family: var(--mono);
	font-size: 3rem;
	font-weight: 700;
	line-height: 1;
	perspective: 300px;
	box-shadow: 0 14px 24px -16px rgba(0, 0, 0, 0.6);
	transition: color 0.4s ease 0.3s;
}

.bac-seat__tile::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 2px;
	margin-top: -1px;
	background: rgba(0, 0, 0, 0.55);
}

.bac-seat__tile span {
	display: block;
}

.bac-seat__tile span.is-out {
	animation: bac-seat-flap-out 0.16s ease-in forwards;
}

.bac-seat__tile span.is-in {
	animation: bac-seat-flap-in 0.22s ease-out;
}

@keyframes bac-seat-flap-out {
	to {
		transform: rotateX(90deg);
		opacity: 0.4;
	}
}

@keyframes bac-seat-flap-in {
	from {
		transform: rotateX(-90deg);
		opacity: 0.4;
	}
}

.bac-seat.is-after .bac-seat__tile {
	color: var(--tpp-accent);
}

.bac-seat__rows {
	margin: 26px 0 0;
}

.bac-seat__rows div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-top: 1px solid var(--tpp-border);
}

.bac-seat__rows dt {
	font-size: 0.875rem;
	color: var(--tpp-text-light);
}

.bac-seat__rows dd {
	margin: 0;
	font-family: var(--tpp-font-heading);
	font-weight: 700;
	color: var(--tpp-black);
	transition: opacity 0.25s ease;
}

.bac-seat__rows dd.is-fading {
	opacity: 0;
}

/* While js/book-a-call-seat.js rewinds the card to "before" at load, nothing
   animates: the change should only play once, when it's in view. */
.bac-seat.is-rewinding .bac-seat__back,
.bac-seat.is-rewinding .bac-seat__leg,
.bac-seat.is-rewinding .bac-seat__window,
.bac-seat.is-rewinding .bac-seat__tile {
	transition: none;
}


/* ── CTA ──
   Colour restated for every link state: style.css sets :visited, :hover,
   :focus and :active to color: inherit. */
.bac-seat__actions {
	display: flex;
	justify-content: center;
	margin-top: 28px;
}

.bac-seat__cta,
.bac-seat__cta:visited,
.bac-seat__cta:hover,
.bac-seat__cta:focus,
.bac-seat__cta:active {
	color: var(--tpp-white);
}

.bac-seat__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 15px 30px;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-black);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.25s ease;
}

.bac-seat__cta:hover,
.bac-seat__cta:focus-visible {
	background: var(--tpp-dark);
}

.bac-seat__cta:focus-visible {
	outline: 2px solid var(--tpp-black);
	outline-offset: 3px;
}


/* ──────────────────────────────────────────────
   Reduced motion
   ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.bac-seat__card,
	.bac-seat__back,
	.bac-seat__leg,
	.bac-seat__window,
	.bac-seat__tile,
	.bac-seat__rows dd,
	.bac-seat .bac-seat__toggle button,
	.bac-seat__cta {
		transition: none;
	}

	.bac-seat__tile span.is-out,
	.bac-seat__tile span.is-in {
		animation: none;
	}
}


/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */

/* Tablet (≤991px) */
@media screen and (max-width: 991px) {
	.bac-seat {
		padding: 0 0 80px;
	}

	.bac-seat__card {
		gap: 32px;
		padding: 36px;
	}
}

/* Mobile (≤767px) — the seat on top, the board under it */
@media screen and (max-width: 767px) {
	.bac-seat {
		padding: 0 0 72px;
	}

	.bac-seat__heading {
		margin-bottom: 24px;
	}

	.bac-seat__card {
		grid-template-columns: 1fr;
		padding: 28px 24px;
		border-radius: 24px;
	}

	.bac-seat__tile {
		width: 60px;
		height: 78px;
		font-size: 2.5rem;
	}
}

/* Small mobile (≤480px) */
@media screen and (max-width: 480px) {
	.bac-seat {
		padding: 0 0 56px;
	}

	.bac-seat .bac-seat__toggle button {
		padding: 10px 14px;
		font-size: 0.8125rem;
	}

	.bac-seat__tile {
		width: 52px;
		height: 68px;
		font-size: 2.125rem;
	}
}

/* Tap targets at least 44px tall on phones (Owen's request). */
@media screen and (max-width: 767px) {
	.bac-seat .bac-seat__toggle button {
		min-height: 44px;
	}
}
