/**
 * Checkout styles, from the Figma "Checkout" frame (7147:5117).
 *
 * Layers on figma-home.css, figma-listing.css (hero/breadcrumb) and
 * figma-cart-page.css (summary panel, shipping radios, trust marks).
 *
 * Several rules are qualified with .fsx-page because figma-home.css resets
 * `.fsx-page p { margin: 0 }` above a lone class.
 */

/* Layout (7147:5291) — 916 form / 380 summary, 24 gutter -------------------- */

.fsx-checkout {
	padding: 40px 0 60px;
}

/* Proportional rather than the frame's fixed 916/380, which would overflow a
   1240 shell exactly as the product and cart grids did. */
.fsx-checkout__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
	gap: clamp(24px, 2.5%, 32px);
	align-items: start;
}

/* Form --------------------------------------------------------------------- */

.fsx-cform__section {
	background: #fff;
	border: 1px solid var(--g200);
	border-radius: 14px;
	padding: 24px;
	margin-bottom: 16px;
}

.fsx-cform__section--signin {
	background: var(--g50);
}

.fsx-cform__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.fsx-page .fsx-cform__title {
	margin: 0 0 16px;
	font-family: "Clash Display", "Public Sans", sans-serif;
	font-weight: 600;
	font-size: 18px;
	line-height: 28px;
	color: var(--ink);
}

.fsx-cform__head .fsx-cform__title {
	margin: 0;
}

.fsx-cform__title a {
	color: var(--p500);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.fsx-tag {
	padding: 4px 10px;
	border: 1px solid var(--g300);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	color: var(--g600);
	white-space: nowrap;
}

.fsx-cform__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.fsx-cform__row--three {
	grid-template-columns: 2fr 1fr 1fr;
}

.fsx-cform__row--signin {
	grid-template-columns: 1fr 1fr auto;
	align-items: end;
}

.fsx-cform__nested {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px dashed var(--g300);
}

.fsx-cform__nested[hidden] {
	display: none;
}

/* Fields */

.fsx-field {
	display: block;
	margin-bottom: 16px;
}

.fsx-cform__row .fsx-field {
	margin-bottom: 0;
}

.fsx-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--g700);
}

.fsx-field input,
.fsx-field select {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--g300);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 15px;
	color: var(--g800);
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.fsx-field select {
	appearance: none;
	-webkit-appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--g600) 50%), linear-gradient(135deg, var(--g600) 50%, transparent 50%);
	background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.fsx-field input:focus,
.fsx-field select:focus {
	outline: none;
	border-color: var(--p500);
	box-shadow: 0 0 0 3px rgba(65, 36, 128, 0.12);
}

.fsx-page .fsx-field__hint {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	line-height: 16px;
	color: var(--g500);
}

/* Invalid state is set on submit, cleared as soon as the field is edited. */
.fsx-field.is-invalid input,
.fsx-field.is-invalid select {
	border-color: #c02626;
	box-shadow: 0 0 0 3px rgba(192, 38, 38, 0.1);
}

.fsx-check--inline {
	padding: 6px 0;
}

.fsx-check--inline.is-invalid .fsx-check__box {
	border-color: #c02626;
}

/* Shipping choices (7152:4302) */

.fsx-shipchoice {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 8px;
}

.fsx-shiprow {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--g300);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease;
}

.fsx-shiprow:hover {
	border-color: var(--p300, #806caa);
}

.fsx-shiprow input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.fsx-shiprow:has(input:checked) {
	border-color: var(--p500);
	background: var(--p50);
}

.fsx-shiprow__text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fsx-shiprow__name {
	font-size: 15px;
	font-weight: 500;
	color: var(--g800);
}

.fsx-shiprow__sub {
	font-size: 13px;
	color: var(--g500);
}

.fsx-shiprow__cost {
	flex-shrink: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--g800);
}

/* Add-ons (7152:10214) */

.fsx-addons {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.fsx-addon {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--g300);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease;
}

.fsx-addon:hover {
	border-color: var(--p300, #806caa);
}

.fsx-addon:has(input:checked) {
	border-color: var(--p500);
	background: var(--p50);
}

.fsx-addon input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.fsx-addon__media {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	border-radius: 8px;
	background: #efeeee;
	overflow: hidden;
	display: grid;
	place-items: center;
}

.fsx-addon__media img {
	width: 100%;
	height: 100%;
	/* Grid item: min-height:auto pins this to the image's intrinsic
	   height, which defeats height:100% and makes contain overflow. */
	min-height: 0;
	min-width: 0;
	/* Portrait vial shots: cover would crop the strength band off
	   the bottom, so letterbox them instead. */
	object-fit: contain;
}

.fsx-addon__text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fsx-addon__name {
	font-size: 15px;
	font-weight: 500;
	color: var(--g800);
}

.fsx-addon__meta,
.fsx-addon__desc {
	font-size: 13px;
	color: var(--g500);
}

.fsx-addon__price {
	flex-shrink: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--g800);
	white-space: nowrap;
}

.fsx-addon__price s {
	color: var(--g500);
	font-weight: 400;
	margin-right: 4px;
}

/* Payment methods (7147:7292) */

.fsx-paymethods {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}

.fsx-paymethod {
	position: relative;
	cursor: pointer;
}

.fsx-paymethod input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.fsx-paymethod__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px;
	border: 1px solid var(--g300);
	border-radius: 10px;
	transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.fsx-paymethod:hover .fsx-paymethod__body {
	border-color: var(--p300, #806caa);
}

.fsx-paymethod input:checked + .fsx-paymethod__body {
	border-color: var(--p500);
	background: var(--p50);
	box-shadow: 0 0 0 1px var(--p500);
}

.fsx-paymethod input:focus-visible + .fsx-paymethod__body {
	outline: 2px solid var(--p500);
	outline-offset: 2px;
}

.fsx-paymethod__name {
	font-size: 15px;
	font-weight: 600;
	color: var(--g800);
}

.fsx-paymethod__sub {
	font-size: 12px;
	color: var(--g500);
}

.fsx-cardfields[hidden] {
	display: none;
}

.fsx-page .fsx-paynote {
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: 8px;
	background: var(--p50);
	font-size: 13px;
	line-height: 19px;
	color: var(--p500);
}

.fsx-paynote[hidden] {
	display: none;
}

/* Submit */

.fsx-page .fsx-cform__submit {
	width: 100%;
	height: 52px;
	margin-top: 8px;
	font-family: inherit;
	font-size: 16px;
	cursor: pointer;
}

.fsx-page .fsx-cform__errors {
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 8px;
	background: rgba(192, 38, 38, 0.08);
	font-size: 14px;
	line-height: 20px;
	color: #c02626;
}

.fsx-cform__errors[hidden] {
	display: none;
}

.fsx-cform__errors.is-ok {
	background: rgba(23, 163, 74, 0.1);
	color: #17a34a;
}

.fsx-page .fsx-cform__secure {
	margin-top: 14px;
	font-size: 13px;
	color: var(--g500);
	text-align: center;
}

/* Summary sidebar (7157:2039) ---------------------------------------------- */

.fsx-summary--checkout .fsx-summary__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.fsx-summary__count {
	font-size: 13px;
	color: var(--g500);
}

.fsx-colist {
	margin: 0 0 18px;
	padding: 0 0 18px;
	list-style: none;
	border-bottom: 1px solid var(--g200);
}

.fsx-coline {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
}

.fsx-coline__media {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: #efeeee;
	overflow: hidden;
	display: grid;
	place-items: center;
}

.fsx-coline__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.fsx-coline__text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fsx-coline__name {
	font-size: 14px;
	font-weight: 500;
	line-height: 19px;
	color: var(--g800);
}

.fsx-coline__qty {
	font-size: 12px;
	color: var(--g500);
}

.fsx-coline__price {
	flex-shrink: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--g800);
	white-space: nowrap;
}

.fsx-summary--checkout .fsx-summary__row {
	margin-top: 10px;
}

.fsx-summary__row[hidden] {
	display: none;
}

.fsx-page .fsx-savednote {
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba(23, 163, 74, 0.1);
	font-size: 13px;
	color: #17a34a;
}

.fsx-savednote[hidden] {
	display: none;
}

.fsx-payalt {
	margin-top: 16px;
	padding: 14px;
	border: 1px dashed var(--p200);
	border-radius: 10px;
	background: var(--p50);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fsx-payalt__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	color: var(--g700);
}

.fsx-payalt__row strong {
	font-weight: 600;
	color: var(--p500);
	white-space: nowrap;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1100px) {
	.fsx-checkout__grid {
		grid-template-columns: 1fr;
	}

	.fsx-summary--checkout {
		position: static;
	}
}

@media (max-width: 640px) {
	.fsx-cform__row,
	.fsx-cform__row--three,
	.fsx-cform__row--signin,
	.fsx-paymethods {
		grid-template-columns: 1fr;
	}

	.fsx-addon__media {
		display: none;
	}
}

/* The dot's checked rule in figma-cart-page.css is scoped to .fsx-shipopt; the
   checkout's rows are .fsx-shiprow, so it never matched and the selected
   option showed an empty circle. */
.fsx-shiprow input:checked + .fsx-shipopt__dot {
	border-color: var(--p500);
}

.fsx-shiprow input:checked + .fsx-shipopt__dot::after {
	transform: scale(1);
}

.fsx-shiprow input:focus-visible + .fsx-shipopt__dot {
	outline: 2px solid var(--p500);
	outline-offset: 2px;
}

/* Hand-off state ------------------------------------------------------------
 *
 * This template no longer renders a form — it moves the basket into
 * WooCommerce's checkout and leaves. figma-checkout.js inserts .fsx-csent here
 * to narrate that. Those styles used to live only in figma-contact.css, which
 * this page never loads, so the panel drew unstyled; they are restated here for
 * the page that actually shows them.
 */

.fsx-checkout--handoff {
	padding: 56px 0 80px;
	text-align: center;
}

.fsx-csent,
.fsx-cohand {
	max-width: 560px;
	margin: 0 auto;
	padding: 32px 24px;
	border: 1px solid var(--g200);
	border-radius: 14px;
	background: #fff;
	text-align: center;
}

.fsx-csent__tick {
	display: block;
	width: 44px;
	height: 44px;
	margin: 0 auto;
	border-radius: 50%;
	background: var(--p500);
	position: relative;
}

/* A spinner rather than the contact form's tick: nothing has completed yet. */
.fsx-csent__tick::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: fsx-cohand-spin 700ms linear infinite;
}

@keyframes fsx-cohand-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.fsx-csent__tick::before {
		animation-duration: 2.4s;
	}
}

.fsx-page .fsx-csent h3,
.fsx-page .fsx-cohand h2 {
	margin: 16px 0 0;
	font-family: "Clash Display", "Public Sans", sans-serif;
	font-weight: 600;
	font-size: 22px;
	line-height: 30px;
	color: var(--ink);
}

.fsx-page .fsx-csent p,
.fsx-page .fsx-cohand p {
	margin: 8px auto 0;
	max-width: 420px;
	font-size: 15px;
	line-height: 22px;
	color: var(--g600);
}

.fsx-page .fsx-cohand .fsx-btn {
	margin-top: 20px;
}

.fsx-page .fsx-cohand__manual {
	margin-top: 20px;
	font-size: 14px;
	color: var(--g500);
}

.fsx-page .fsx-cohand__manual a {
	color: var(--p500);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
