/**
 * Mechsys Waitlist: form in the buy box, the status page and the list in My Account.
 *
 * ACSS 4 tokens only (checked against the staging inventory, 21.11.2026).
 * Buttons use the ACSS classes (btn--primary, btn--secondary btn--outline) in the markup.
 * Root font size is 62.5 %: 1.6rem = 16px.
 */

/* ── Form (product page, state "nicht vorrätig") ── */

.mechsys-waitlist {
	display: grid;
	gap: calc(var(--space-xs) * 0.75);
	inline-size: 100%;
	min-inline-size: 0;
}

.mechsys-waitlist[hidden],
.mechsys-waitlist [hidden] {
	display: none;
}

.mechsys-waitlist__form {
	display: grid;
	gap: calc(var(--space-xs) * 0.6);
	margin: 0;
}

/* Heading of the box, also the label of the field. */
.mechsys-waitlist__label {
	display: block;
	margin: 0 0 calc(var(--space-xs) * 0.2);
	font-family: var(--heading-font-family);
	font-size: calc(var(--text-m) * 0.9);
	font-weight: 700;
	line-height: 1.3;
	color: var(--text-dark);
}

/* Field and button stacked at full width, same height as "In den Warenkorb". */
.mechsys-waitlist__row {
	display: grid;
	gap: calc(var(--space-xs) * 0.6);
	min-inline-size: 0;
}

.mechsys-waitlist__input {
	inline-size: 100%;
	min-inline-size: 0;
	min-block-size: 5.6rem;
	margin: 0;
	padding: 0 calc(var(--space-xs) * 1.2);
	border: 1px solid var(--neutral-semi-light);
	border-radius: var(--radius);
	background: var(--white);
	color: var(--text-dark);
	font-family: var(--text-font-family);
	/* 16px minimum: iOS zooms into smaller fields on focus. */
	font-size: max(1.6rem, var(--text-m));
	line-height: 1.2;
	transition: border-color var(--transition);
}

.mechsys-waitlist__input:hover {
	border-color: var(--neutral);
}

.mechsys-waitlist__input:focus-visible {
	border-color: var(--neutral);
	outline: 2px solid var(--focus-color);
	outline-offset: 2px;
}

.mechsys-waitlist__input::placeholder {
	color: var(--neutral-semi-dark);
	opacity: 1;
}

/* Filled steel (btn--secondary): the only action in the box, red stays with buying.
   Width and padding via the ACSS button variables: automatic.css loads after this file and its
   [class*="btn--"] rule sets inline-size and padding from them. */
.mechsys-waitlist__button {
	--btn-min-width: 0;
	--btn-width: 100%;
	--btn-padding-block: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: calc(var(--space-xs) * 0.6);
	min-block-size: 5.6rem;
	margin: 0;
	cursor: pointer;
}

.mechsys-waitlist__icon {
	flex: none;
	inline-size: 2rem;
	block-size: 2rem;
}

.mechsys-waitlist__button[disabled] {
	cursor: progress;
	opacity: 0.7;
}

/* Promise right at the button. */
.mechsys-waitlist__assure {
	margin: calc(var(--space-xs) * 0.2) 0 0;
	font-size: var(--text-xs);
	line-height: 1.4;
	color: var(--neutral-semi-dark);
}

/* What happens next: a timeline under a rule from edge to edge of the buy box (--pdp-buy-pad comes from the
   product page, elsewhere the rule spans the form). Markers as tall as one text line, so number and first line align. */
.mechsys-waitlist__steps {
	--mechsys-wl-step: calc(var(--text-s) * 1.45);
	display: grid;
	gap: calc(var(--space-xs) * 0.9);
	margin: calc(var(--space-s) * 0.5) calc(var(--pdp-buy-pad, 0px) * -1) 0;
	padding: calc(var(--space-s) * 1.1) var(--pdp-buy-pad, 0px) 0;
	border-block-start: 1px solid var(--neutral-light);
	list-style: none;
	counter-reset: mechsys-wl-step;
}

.mechsys-waitlist__steps > li {
	position: relative;
	display: grid;
	grid-template-columns: var(--mechsys-wl-step) minmax(0, 1fr);
	column-gap: calc(var(--space-xs) * 0.9);
	margin: 0;
	padding: 0;
	font-size: var(--text-s);
	line-height: 1.45;
	color: var(--neutral-dark);
	counter-increment: mechsys-wl-step;
}

.mechsys-waitlist__steps > li::before {
	content: counter(mechsys-wl-step);
	display: grid;
	place-items: center;
	box-sizing: border-box;
	inline-size: var(--mechsys-wl-step);
	block-size: var(--mechsys-wl-step);
	border: 1px solid var(--secondary-light);
	border-radius: 50%;
	background: var(--white);
	color: var(--secondary-dark);
	font-family: var(--pdp-num, var(--heading-font-family));
	font-size: var(--text-xs);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

/* Hairline joining the markers. */
.mechsys-waitlist__steps > li:not(:last-child)::after {
	content: "";
	position: absolute;
	inset-inline-start: calc(var(--mechsys-wl-step) / 2 - 0.5px);
	inset-block-start: calc(var(--mechsys-wl-step) + 0.3rem);
	inset-block-end: calc(var(--space-xs) * -0.9 + 0.3rem);
	border-inline-start: 1px solid var(--secondary-light);
}

.mechsys-waitlist__result {
	padding: calc(var(--space-xs) * 0.75) var(--space-xs);
	border-inline-start: 3px solid var(--success);
	border-radius: var(--radius-s);
	background: var(--success-ultra-light);
	color: var(--text-dark);
	font-size: var(--text-s);
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.mechsys-waitlist__result--error {
	border-inline-start-color: var(--danger);
	background: var(--danger-ultra-light);
}

.mechsys-waitlist__result:focus {
	outline: none;
}

/* Honeypot: off screen, never focusable. */
.mechsys-waitlist__hp {
	position: absolute;
	inset-inline-start: -9999px;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
}

/* ── Status page (links in the mails) ── */

.mechsys-wl-page {
	padding-block: var(--section-space-m);
	padding-inline: var(--gutter);
}

.mechsys-wl-page__inner {
	display: grid;
	gap: var(--space-m);
	max-inline-size: min(100%, 64rem);
	margin-inline: auto;
}

.mechsys-wl-page__eyebrow {
	font-family: var(--heading-font-family);
	font-size: var(--text-xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--secondary);
	margin-block-end: calc(var(--space-m) * -0.6);
}

.mechsys-wl-page__title {
	margin: 0;
	font-size: var(--h2);
}

.mechsys-wl-page__notice {
	padding: calc(var(--space-xs) * 0.75) var(--space-xs);
	border-inline-start: 3px solid var(--success);
	border-radius: var(--radius-s);
	background: var(--success-ultra-light);
	font-size: var(--text-s);
}

.mechsys-wl-page__notice--error {
	border-inline-start-color: var(--danger);
	background: var(--danger-ultra-light);
}

.mechsys-wl-part {
	display: flex;
	gap: var(--space-s);
	align-items: center;
	padding: var(--space-s);
	border: 1px solid var(--base-light);
	border-radius: var(--radius);
	background: var(--white);
}

.mechsys-wl-part__media {
	flex: 0 0 9.6rem;
}

.mechsys-wl-part__media img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: 1;
	object-fit: contain;
}

.mechsys-wl-part__body {
	display: grid;
	gap: calc(var(--space-xs) * 0.3);
	min-inline-size: 0;
}

.mechsys-wl-part__name {
	font-family: var(--heading-font-family);
	font-size: var(--text-m);
	font-weight: 700;
	color: var(--text-dark);
	text-decoration-line: none;
}

.mechsys-wl-part__name:hover {
	text-decoration-line: underline;
}

.mechsys-wl-part__nr,
.mechsys-wl-part__state {
	font-size: var(--text-s);
	color: var(--neutral-dark);
}

.mechsys-wl-part__state--ok {
	color: var(--success);
	font-weight: 700;
}

.mechsys-wl-page__text {
	font-size: var(--text-m);
	overflow-wrap: anywhere;
}

.mechsys-wl-page__meta {
	font-size: var(--text-s);
	color: var(--neutral-dark);
	margin-block-start: calc(var(--space-m) * -0.5);
}

.mechsys-wl-page__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
	align-items: center;
}

.mechsys-wl-page__form {
	margin: 0;
}

.mechsys-wl-page__actions button {
	cursor: pointer;
}

/* "Von der Warteliste austragen": a plain text action, not a button. */
.mechsys-wl-page__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--link-color);
	font: inherit;
	font-size: var(--text-s);
	text-decoration-line: underline;
}

.mechsys-wl-page__link:hover {
	color: var(--primary);
}

/* ── My Account → Warteliste ──
   Orders table markup: layout, status dot and cards come from the customizer's kundenkonto.css. */

.mechsys-wl-account {
	margin: 0;
}

.mechsys-wl-account__row--waiting {
	--konto-status: var(--info);
}

.mechsys-wl-account__row--pending {
	--konto-status: var(--warning);
}

.mechsys-wl-account__row--offer {
	--konto-status: var(--success);
}

.mechsys-wl-account__row--done,
.mechsys-wl-account__row--ended {
	--konto-status: var(--neutral-semi-light);
}

.mechsys-wl-account__nr,
.mechsys-wl-account__detail {
	display: block;
	color: var(--text-dark-muted);
	font-size: var(--text-s);
	font-weight: 400;
}

/* Red: buying is the next step (colour role "red acts") */
.woocommerce-account :where(#brx-content) .woocommerce .button.mechsys-wl-account__buy {
	background-color: var(--primary);
	box-shadow: none;
	color: var(--white);
}

.woocommerce-account :where(#brx-content) .woocommerce .button.mechsys-wl-account__buy:hover {
	background-color: var(--primary-hover);
	color: var(--white);
}

/* "Austragen": a plain text action, as on the status page */
.mechsys-wl-account__end {
	min-block-size: 0;
	margin: 0;
	margin-inline-start: var(--space-xs);
	padding: 0;
	border: 0;
	background: none;
	color: var(--link-color);
	font: inherit;
	font-size: var(--text-s);
	text-decoration-line: underline;
	cursor: pointer;
}

.mechsys-wl-account__end:hover {
	background: none;
	color: var(--primary);
}

@container konto-inhalt (max-width: 899px) {
	.mechsys-wl-account__nr,
	.mechsys-wl-account__detail {
		flex-basis: 100%;
		text-align: end;
	}

	.mechsys-wl-account__end {
		margin-inline-start: auto;
	}

	/* Cards: no empty action line (beats the card rule for cells in kundenkonto.css) */
	.woocommerce-account .woocommerce-MyAccount-content table.shop_table_responsive tbody td.mechsys-wl-account__none {
		display: none;
	}
}
