/*--------------------------------------------------------------
# Book a Call — Carry-on Sizer
# Which call fits your questions. An off-white panel: the questions
# as toggle chips on the left, and on the right the size-check frame
# from the gate, where an orange suitcase grows into the smallest tier
# that fits. Each tier is a call length.
--------------------------------------------------------------*/

/* ── Section ──
   Bottom padding only, like the rest of the white run below the cards:
   .bac-options above supplies the gap over this. The steps match
   .bac-prep's below, so the rhythm holds at every width. */
.bac-sizer {
	/* The theme loads no monospace font; the same system stack .faq-signs
	   and .bac-captain 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-sizer__container {
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
}

/* Same size and weight as "How long do you need?" right above it */
.bac-sizer__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 48px;
}


/* ──────────────────────────────────────────────
   The panel
   ────────────────────────────────────────────── */

.bac-sizer__panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 430px);
	gap: 56px;
	align-items: center;
	max-width: 1080px;
	margin: 0 auto;
	padding: 44px;
	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-sizer.is-visible .bac-sizer__panel {
	opacity: 1;
	transform: translateY(0);
}

.bac-sizer__ask {
	font-family: var(--mono);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--tpp-text-light);
}


/* ── The question chips ──
   Two classes on every rule: style.css gives every <button> a grey border,
   padding and its own hover and focus border colours, all at one class plus
   an element, which a single class would lose to. */
.bac-sizer__items {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.bac-sizer .bac-sizer__item {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 9px 10px 9px 9px;
	border: 1px solid var(--tpp-border);
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-white);
	color: var(--tpp-black);
	font-family: var(--tpp-font-body);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	transition:
		background 0.25s ease,
		color 0.25s ease,
		border-color 0.25s ease,
		transform 0.25s var(--spring);
}

.bac-sizer .bac-sizer__item:hover {
	border-color: var(--tpp-black);
}

.bac-sizer .bac-sizer__item:active {
	transform: scale(0.97);
}

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

.bac-sizer .bac-sizer__item[aria-pressed="true"] {
	border-color: var(--tpp-black);
	background: var(--tpp-black);
	color: var(--tpp-white);
}

/* The round tick box: a plus until the question is packed */
.bac-sizer__box {
	display: grid;
	flex: none;
	place-items: center;
	width: 24px;
	height: 24px;
	border: 1.5px solid var(--tpp-border);
	border-radius: 50%;
	color: var(--tpp-text-light);
	transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.bac-sizer__box svg {
	width: 12px;
	height: 12px;
}

.bac-sizer__check,
.bac-sizer__item[aria-pressed="true"] .bac-sizer__plus {
	display: none;
}

.bac-sizer__item[aria-pressed="true"] .bac-sizer__check {
	display: block;
}

.bac-sizer__item[aria-pressed="true"] .bac-sizer__box {
	border-color: var(--tpp-accent);
	background: var(--tpp-accent);
	color: var(--tpp-black);
}

/* S, M, L or XL: how much room the question takes */
.bac-sizer__size {
	flex: none;
	padding: 2px 7px;
	border-radius: 5px;
	background: var(--tpp-border-light);
	color: var(--tpp-text-light);
	font-family: var(--mono);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	transition: background 0.25s ease, color 0.25s ease;
}

.bac-sizer__item[aria-pressed="true"] .bac-sizer__size {
	background: rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.75);
}


/* ── The result line and its button ── */
.bac-sizer__result {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 22px;
	margin-top: 30px;
	padding-top: 24px;
	border-top: 1px dashed var(--tpp-border);
}

.bac-sizer__readout {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 4px 22px;
	margin: 0;
}

.bac-sizer__verdict,
.bac-sizer__price {
	font-family: var(--tpp-font-heading);
	font-size: 1.3125rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.bac-sizer__verdict {
	color: var(--tpp-black);
}

.bac-sizer__bag-name {
	display: block;
	margin-bottom: 2px;
	font-family: var(--mono);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tpp-text-light);
}

.bac-sizer__price {
	color: var(--tpp-text-light);
}

/* Link colours restated for every state: style.css sets :visited, :hover,
   :focus and :active to color: inherit. */
.bac-sizer__cta,
.bac-sizer__cta:visited,
.bac-sizer__cta:hover,
.bac-sizer__cta:focus,
.bac-sizer__cta:active,
.bac-sizer__back,
.bac-sizer__back:visited,
.bac-sizer__back:hover,
.bac-sizer__back:focus,
.bac-sizer__back:active {
	color: var(--tpp-black);
}

.bac-sizer__cta,
.bac-sizer__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	padding: 14px 26px;
	border: 1px solid var(--tpp-accent);
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-accent);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.bac-sizer__cta:hover,
.bac-sizer__cta:focus-visible {
	border-color: var(--tpp-accent-dark);
	background: var(--tpp-accent-dark);
}

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

/* With nothing packed: an outline button back up to the four cards */
.bac-sizer__back {
	border-color: var(--tpp-black);
	background: transparent;
}

.bac-sizer__back:hover,
.bac-sizer__back:focus-visible {
	background: var(--tpp-black);
	color: var(--tpp-white);
}

/* That length has no booking link yet (Customizer → Book a Call Page) */
.bac-sizer__cta--pending,
.bac-sizer__cta--pending:hover {
	border-style: dashed;
	border-color: var(--tpp-border);
	background: transparent;
	color: var(--tpp-text-light);
	cursor: default;
}

/* style.css's [hidden] rule loses to the display above at the same weight */
.bac-sizer__cta[hidden],
.bac-sizer__back[hidden] {
	display: none;
}


/* ──────────────────────────────────────────────
   The size-check frame
   ────────────────────────────────────────────── */

.bac-sizer__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 0.92;
}

.bac-sizer__plate {
	position: absolute;
	z-index: 3;
	top: 0;
	left: 50%;
	padding: 7px 16px;
	border-radius: 10px;
	background: var(--tpp-black);
	color: var(--tpp-accent);
	font-family: var(--mono);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	white-space: nowrap;
	transform: translateX(-50%);
}

.bac-sizer__cage {
	position: absolute;
	inset: 14px 0 0;
	border: 10px solid var(--tpp-black);
	border-radius: 18px;
	background: var(--tpp-white);
	box-shadow: 0 22px 40px -28px rgba(0, 0, 0, 0.5);
}

.bac-sizer__ruler {
	position: absolute;
	left: 10px;
	top: 34px;
	bottom: 10px;
	width: 9px;
	background: repeating-linear-gradient(to top, var(--tpp-black) 0 1px, transparent 1px 10px);
	opacity: 0.22;
}

.bac-sizer__inner {
	position: absolute;
	inset: 64px 22px 20px 32px;
}

/* The four outlines, anchored bottom-left, each labelled at its top-right */
.bac-sizer__tier {
	position: absolute;
	left: 0;
	bottom: 0;
	width: var(--w);
	height: var(--h);
	border: 1.5px dashed rgba(26, 26, 26, 0.2);
	border-radius: 12px;
	transition: border-color 0.3s ease, background-color 0.3s ease;
}

.bac-sizer__tier-label {
	position: absolute;
	right: 0;
	bottom: 100%;
	margin-bottom: 4px;
	font-family: var(--mono);
	font-size: 0.5625rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: right;
	white-space: nowrap;
	color: rgba(26, 26, 26, 0.38);
	transition: color 0.3s ease;
}

.bac-sizer__tier-label b {
	display: block;
	font-size: 0.6875rem;
}

.bac-sizer__tier.is-fit {
	border-style: solid;
	border-color: var(--tpp-black);
	background: rgba(255, 153, 0, 0.1);
}

.bac-sizer__tier.is-fit .bac-sizer__tier-label {
	color: var(--tpp-black);
}

/* The suitcase. Its size follows --bw / --bh on the frame, which the script
   sets to the fitting tier's; the overshoot is the bag dropping into place. */
.bac-sizer__bag {
	position: absolute;
	z-index: 2;
	left: 10px;
	bottom: 12px;
	width: calc(var(--bw, 0%) - 20px);
	height: calc(var(--bh, 0%) - 34px);
	border-radius: 14px;
	background: var(--tpp-accent);
	box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.07), inset 0 0 0 2px rgba(26, 26, 26, 0.14);
	transition:
		width 0.7s var(--spring),
		height 0.7s var(--spring),
		opacity 0.3s ease;
}

.bac-sizer__bag[data-empty] {
	opacity: 0;
}

.bac-sizer__ribs {
	position: absolute;
	inset: 16%;
	border-radius: 8px;
	background: repeating-linear-gradient(90deg, rgba(26, 26, 26, 0.14) 0 3px, transparent 3px 18px);
}

.bac-sizer__handle {
	position: absolute;
	bottom: 100%;
	left: 50%;
	width: 40%;
	max-width: 72px;
	height: 16px;
	border: 4px solid var(--tpp-black);
	border-bottom: 0;
	border-radius: 10px 10px 0 0;
	transform: translateX(-50%);
}

.bac-sizer__wheel {
	position: absolute;
	bottom: -8px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--tpp-black);
	box-shadow: inset 0 0 0 4px #3A3A3A;
}

.bac-sizer__wheel--l {
	left: 14%;
}

.bac-sizer__wheel--r {
	right: 14%;
}

/* The luggage tag, with the length on it */
.bac-sizer__tag {
	position: absolute;
	top: 12px;
	right: -14px;
	padding: 6px 9px 6px 16px;
	border-radius: 5px;
	background: var(--tpp-black);
	color: var(--tpp-accent);
	font-family: var(--mono);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
	transform: rotate(6deg);
}

.bac-sizer__tag::before {
	content: '';
	position: absolute;
	left: 6px;
	top: 50%;
	width: 5px;
	height: 5px;
	margin-top: -2.5px;
	border-radius: 50%;
	background: var(--tpp-white);
}


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

@media (prefers-reduced-motion: reduce) {
	.bac-sizer__panel,
	.bac-sizer .bac-sizer__item,
	.bac-sizer__box,
	.bac-sizer__size,
	.bac-sizer__tier,
	.bac-sizer__tier-label,
	.bac-sizer__bag,
	.bac-sizer__cta,
	.bac-sizer__back {
		transition: none;
	}

	.bac-sizer .bac-sizer__item:active {
		transform: none;
	}
}


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

/* Tablet (≤991px) — the frame drops under the questions */
@media screen and (max-width: 991px) {
	.bac-sizer {
		padding: 0 0 80px;
	}

	.bac-sizer__panel {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.bac-sizer__frame-wrap {
		width: 100%;
		max-width: 430px;
		margin: 0 auto;
	}
}

/* Mobile (≤767px) */
@media screen and (max-width: 767px) {
	.bac-sizer {
		padding: 0 0 72px;
	}

	.bac-sizer__heading {
		margin-bottom: 32px;
	}

	.bac-sizer__panel {
		padding: 24px;
		border-radius: 24px;
	}

	.bac-sizer .bac-sizer__item {
		font-size: 0.875rem;
	}

	.bac-sizer__cta,
	.bac-sizer__back {
		width: 100%;
		margin-left: 0;
	}
}

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

	.bac-sizer__panel {
		padding: 20px 18px;
	}

	.bac-sizer__tier-label {
		font-size: 0.5rem;
	}

	.bac-sizer__tier-label b {
		font-size: 0.625rem;
	}
}
