/**
 * Staged checkout.
 *
 * Uses the theme's Forest Assay tokens from main.css. Two radii only: 6px for
 * interactive elements, 12px for containers. Green is rationed to the active
 * step, the primary action and validated state.
 */

/* ------------------------------------------------------------- progress */

.nsl-checkout__progress {
	margin: 0 0 32px;
}

.nsl-stepbar {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.nsl-stepbar__item {
	margin: 0;
	padding: 0;
}

.nsl-stepbar__button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 14px 14px;
	border: 0;
	border-top: 3px solid var(--nsl-border);
	border-radius: 0;
	background: none;
	color: var(--nsl-muted);
	font-family: var(--nsl-body);
	text-align: left;
	cursor: default;
	transition: border-color .2s ease, color .2s ease;
}

.nsl-stepbar__item.is-done .nsl-stepbar__button {
	border-top-color: var(--nsl-accent-soft);
	color: var(--nsl-copy);
	cursor: pointer;
}

.nsl-stepbar__item.is-current .nsl-stepbar__button {
	border-top-color: var(--nsl-accent);
	color: var(--nsl-ink);
}

.nsl-stepbar__marker {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border: 1px solid var(--nsl-border-dark);
	border-radius: 9999px;
	font-family: var(--nsl-mono);
	font-size: .78rem;
	line-height: 1;
}

.nsl-stepbar__item.is-current .nsl-stepbar__marker {
	border-color: var(--nsl-accent);
	background: var(--nsl-accent);
	color: #fff;
}

.nsl-stepbar__item.is-done .nsl-stepbar__marker {
	border-color: var(--nsl-accent);
	background: var(--nsl-accent-soft);
	color: var(--nsl-accent-dark);
}

.nsl-stepbar__text {
	display: flex;
	min-width: 0;
	flex-direction: column;
}

.nsl-stepbar__text strong {
	font-family: var(--nsl-heading);
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.15;
}

.nsl-stepbar__text small {
	overflow: hidden;
	color: var(--nsl-muted);
	font-size: .78rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 600px) {
	.nsl-stepbar__text small {
		display: none;
	}

	.nsl-stepbar__button {
		gap: 8px;
		padding: 10px 8px 12px;
	}

	.nsl-stepbar__text strong {
		font-size: .82rem;
	}
}

/* ---------------------------------------------------------------- panels */

.nsl-step[hidden] {
	display: none;
}

.nsl-step__title {
	margin: 0 0 6px;
	font-family: var(--nsl-heading);
	font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem);
	font-weight: 700;
	line-height: 1.1;
}

.nsl-step__title:focus {
	outline: none;
}

.nsl-step__lede {
	max-width: 62ch;
	margin: 0 0 28px;
	color: var(--nsl-copy);
}

.nsl-fieldset-title {
	margin: 28px 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--nsl-border);
	font-family: var(--nsl-heading);
	font-size: 1.05rem;
	font-weight: 700;
}

.nsl-step__contact .nsl-fieldset-title {
	margin-top: 0;
}

/* --------------------------------------------------------------- billing */

.nsl-billing-same {
	margin: 0 0 24px;
	padding: 16px 18px;
	border: 1px solid var(--nsl-border);
	border-radius: 12px;
	background: var(--nsl-surface);
}

.nsl-billing-same label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-weight: 500;
	cursor: pointer;
}

.nsl-billing-same input {
	margin: 2px 0 0;
	accent-color: var(--nsl-accent);
}

.nsl-billing-same__hint {
	margin: 6px 0 0 28px;
	color: var(--nsl-muted);
	font-size: .85rem;
}

/* ------------------------------------------------------------------- nav */

.nsl-step__nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--nsl-border);
}

.nsl-step__continue {
	padding: 13px 30px;
	border: 0;
	border-radius: 6px;
	background: var(--nsl-accent);
	color: #fff;
	font-family: var(--nsl-body);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s ease;
}

.nsl-step__continue:hover,
.nsl-step__continue:focus-visible {
	background: var(--nsl-accent-dark);
}

.nsl-step__back {
	order: -1;
	padding: 13px 22px;
	border: 1px solid var(--nsl-accent);
	border-radius: 6px;
	background: transparent;
	color: var(--nsl-accent-dark);
	font-family: var(--nsl-body);
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
}

.nsl-step__back:hover,
.nsl-step__back:focus-visible {
	background: var(--nsl-accent-soft);
}

/* ---------------------------------------------------------------- recaps */

.nsl-recap {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--nsl-border);
}

.nsl-recap:first-child {
	border-top: 1px solid var(--nsl-border);
}

.nsl-recap__label {
	display: block;
	color: var(--nsl-muted);
	font-size: .78rem;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.nsl-recap__value {
	display: block;
	margin-top: 3px;
	color: var(--nsl-ink);
}

.nsl-recap__edit {
	flex: 0 0 auto;
	padding: 4px 2px;
	border: 0;
	border-bottom: 1px solid currentColor;
	background: none;
	color: var(--nsl-accent-dark);
	font-family: var(--nsl-body);
	font-size: .88rem;
	cursor: pointer;
}

[data-nsl-summary]:not(:empty) {
	margin-bottom: 32px;
}

/* ------------------------------------------------------------ validation */

.form-row.nsl-invalid input,
.form-row.nsl-invalid select,
.form-row.nsl-invalid textarea,
.form-row.nsl-invalid .select2-selection {
	border-color: var(--nsl-danger) !important;
}

.nsl-field-error {
	display: block;
	margin-top: 5px;
	color: var(--nsl-danger);
	font-size: .84rem;
}

/* ----------------------------------------------------------- suggestions */

#shipping_address_1_field,
#billing_address_1_field {
	position: relative;
}

.nsl-suggest {
	position: absolute;
	z-index: 30;
	top: 100%;
	right: 0;
	left: 0;
	max-height: 260px;
	margin: 4px 0 0;
	overflow-y: auto;
	padding: 4px;
	border: 1px solid var(--nsl-border-dark);
	border-radius: 6px;
	background: var(--nsl-surface);
	box-shadow: var(--nsl-shadow-sm);
	list-style: none;
}

.nsl-suggest[hidden] {
	display: none;
}

.nsl-suggest__item {
	padding: 9px 11px;
	border-radius: 6px;
	color: var(--nsl-ink);
	font-size: .93rem;
	cursor: pointer;
}

.nsl-suggest__item:hover,
.nsl-suggest__item:focus {
	background: var(--nsl-accent-soft);
	outline: none;
}

/* -------------------------------------------------------------- payments */

.nsl-payment-note {
	margin: 12px 0 0;
	padding: 10px 14px;
	border-left: 2px solid var(--nsl-marker);
	color: var(--nsl-copy);
	font-size: .88rem;
}

.woocommerce-checkout #payment ul.payment_methods li {
	padding: 4px 0;
}

.woocommerce-checkout #payment ul.payment_methods label {
	font-weight: 600;
}

/* The stock template shows this as a question; the staged flow answers it. */
.nsl-shipping-fields #ship-to-different-address-checkbox {
	display: none;
}

/* ------------------------------------------------- accepted payment marks */

.nsl-marks {
	margin: 18px 0 0;
}

.nsl-marks__heading {
	margin: 0 0 10px;
	color: var(--nsl-muted);
	font-size: .76rem;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.nsl-marks__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nsl-marks__item {
	margin: 0;
	padding: 0;
	line-height: 0;
}

.nsl-marks__art svg {
	display: block;
	width: 46px;
	height: auto;
}

@media (max-width: 480px) {
	.nsl-marks__art svg {
		width: 40px;
	}
}
