/*
 * MEZ MagNiko Configurator
 *
 * Dark, using the same palette the ROI calculator defines on its own shell, so
 * the two tools look like siblings rather than two different products.
 *
 * Everything that touches a `button`, an `a` or an `h1`-`h6` is scoped under
 * `.mezmk` so it reaches 0,2,0 and outranks the Elementor kit's 0,1,1 rules
 * without a single !important. The kit also sets `white-space: nowrap` on
 * buttons, `color:#fff` on button hover, and its own size/weight plus 2.5px of
 * tracking on headings - so those are restated here, never left to inherit.
 *
 * Mobile-first; the summary becomes a sticky rail from 1025px up.
 */

.mezmk {
	--mezmk-bg: #101412;
	--mezmk-surface: #151a17;
	--mezmk-surface-strong: #1b221d;
	--mezmk-surface-soft: #202922;
	--mezmk-field: #121713;
	--mezmk-border: rgba(255, 255, 255, 0.08);
	--mezmk-border-strong: rgba(105, 178, 26, 0.26);
	--mezmk-accent: #69b21a;
	--mezmk-accent-strong: #1f7e08;
	--mezmk-accent-darker: #145c05;
	--mezmk-accent-bright: #b6ef74;
	--mezmk-ink: #111a12;
	--mezmk-text: #f3f6f2;
	--mezmk-muted: #bec8bf;
	--mezmk-soft: #94a094;
	--mezmk-radius: 18px;
	--mezmk-radius-sm: 14px;

	box-sizing: border-box;
	color: var(--mezmk-text);
	font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.55;
}

.mezmk *,
.mezmk *::before,
.mezmk *::after {
	box-sizing: inherit;
}

.mezmk__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	align-items: start;
}

@media (min-width: 1025px) {
	.mezmk__layout {
		grid-template-columns: minmax(0, 1fr) 24rem;
		gap: 1.75rem;
	}

	.mezmk__summary {
		position: sticky;
		top: 1.5rem;
	}
}

/* ---------------------------------------------------------------- steps */

.mezmk-step {
	background: var(--mezmk-surface);
	border: 1px solid var(--mezmk-border);
	border-radius: var(--mezmk-radius);
	padding: 1.1rem;
	margin: 0 0 0.9rem;
}

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

.mezmk .mezmk-step__title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.25rem;
	color: var(--mezmk-text);
	font-family: "Eurostille", "Montserrat", system-ui, sans-serif;
	/* Restated: the kit's h2 rule is 40px/600 with its own tracking. Eurostille
	   is a tight, squarish face and reads cramped at these sizes, so the
	   tracking is opened up and forced past anything the kit or a custom CSS
	   panel sets later. */
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.085em !important;
	line-height: 1.35;
}

.mezmk .mezmk-step__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1.8rem;
	height: 1.8rem;
	border-radius: 50%;
	background: var(--mezmk-accent-strong);
	color: #fff;
	font-size: 0.92rem;
	font-weight: 700;
	letter-spacing: 0;
}

.mezmk .mezmk-step__hint {
	margin: 0 0 0.9rem;
	color: var(--mezmk-soft);
	font-size: 0.88rem;
	letter-spacing: 0;
}

/* -------------------------------------------------------------- choices */

.mezmk-choice-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
	gap: 0.6rem;
}

.mezmk-choice-grid--wide {
	grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}

.mezmk .mezmk-choice {
	/* The kit sets white-space:nowrap on buttons, which made these descriptions
	   run out of the card and collide with the next one. */
	white-space: normal;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
	min-height: 44px;
	padding: 0.7rem 0.55rem;
	border: 1px solid var(--mezmk-border);
	border-radius: var(--mezmk-radius-sm);
	background: var(--mezmk-surface-strong);
	color: var(--mezmk-text);
	font-family: inherit;
	font-size: 0.85rem;
	letter-spacing: 0;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.mezmk .mezmk-choice:hover,
.mezmk .mezmk-choice:focus {
	border-color: var(--mezmk-accent);
	background: var(--mezmk-surface-soft);
	/* The kit's button:hover also sets colour:#fff - restate ours so the label
	   never disappears against the hover background. */
	color: var(--mezmk-text);
}

.mezmk .mezmk-choice:hover .mezmk-choice__label,
.mezmk .mezmk-choice:focus .mezmk-choice__label {
	color: var(--mezmk-text);
}

.mezmk .mezmk-choice:hover .mezmk-choice__sub,
.mezmk .mezmk-choice:focus .mezmk-choice__sub {
	color: var(--mezmk-muted);
}

.mezmk .mezmk-choice:focus-visible {
	outline: 2px solid var(--mezmk-accent);
	outline-offset: 2px;
}

.mezmk .mezmk-choice[aria-checked="true"] {
	border-color: var(--mezmk-accent);
	background: rgba(105, 178, 26, 0.16);
	box-shadow: inset 0 0 0 1px var(--mezmk-accent);
}

.mezmk .mezmk-choice[disabled] {
	opacity: 0.35;
	cursor: not-allowed;
}

.mezmk-choice__img {
	width: 100%;
	max-width: 5.5rem;
	height: 3.6rem;
	object-fit: contain;
	border-radius: 8px;
}

.mezmk-choice__label {
	color: var(--mezmk-text);
	font-weight: 600;
	line-height: 1.3;
}

.mezmk-choice__sub {
	color: var(--mezmk-soft);
	font-size: 0.75rem;
	line-height: 1.35;
}

/* ----------------------------------------------------------------- legs */

.mezmk-legs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
	gap: 0.7rem;
}

.mezmk-leg {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.mezmk-leg__label {
	color: var(--mezmk-muted);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0;
}

.mezmk .mezmk-leg__input {
	min-height: 44px;
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--mezmk-border-strong);
	border-radius: 10px;
	/* The Elementor kit forces `background:#fff` on inputs at a specificity we
	   would have to keep fighting. The field is therefore light on purpose, with
	   dark text - which also makes the editable area obvious on a dark page. */
	background: #ffffff;
	color: var(--mezmk-ink);
	font-family: inherit;
	font-size: 1rem;
}

.mezmk .mezmk-leg__input::placeholder {
	color: #5a665c;
	opacity: 1;
}

.mezmk .mezmk-leg__input:focus-visible {
	outline: 2px solid var(--mezmk-accent);
	outline-offset: 1px;
}

/* ----------------------------------------------------------- luminaires */

.mezmk-lums {
	display: grid;
	gap: 0.45rem;
}

.mezmk-lum {
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.7rem;
	padding: 0.45rem;
	border: 1px solid var(--mezmk-border);
	border-radius: 12px;
	background: var(--mezmk-surface-strong);
}

.mezmk-lum__img {
	width: 2.75rem;
	height: 2.75rem;
	object-fit: contain;
	border-radius: 6px;
}

.mezmk-lum__name {
	color: var(--mezmk-text);
	font-size: 0.87rem;
	font-weight: 600;
	line-height: 1.3;
}

.mezmk-lum__meta {
	color: var(--mezmk-soft);
	font-size: 0.75rem;
}

.mezmk-qty {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.mezmk .mezmk-qty__btn {
	width: 44px;
	height: 44px;
	border: 1px solid var(--mezmk-border);
	border-radius: 10px;
	background: var(--mezmk-field);
	color: var(--mezmk-text);
	font-family: inherit;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.mezmk .mezmk-qty__btn:hover,
.mezmk .mezmk-qty__btn:focus {
	border-color: var(--mezmk-accent);
	background: var(--mezmk-surface-soft);
	color: var(--mezmk-accent-bright);
}

.mezmk .mezmk-qty__btn:focus-visible {
	outline: 2px solid var(--mezmk-accent);
	outline-offset: 2px;
}

.mezmk .mezmk-qty__input {
	width: 3.25rem;
	min-height: 44px;
	padding: 0.25rem;
	border: 1px solid var(--mezmk-border-strong);
	border-radius: 10px;
	/* Same as the leg inputs: light field, dark text. */
	background: #ffffff;
	color: var(--mezmk-ink);
	font-family: inherit;
	font-size: 1rem;
	text-align: center;
}

.mezmk .mezmk-qty__input:focus-visible {
	outline: 2px solid var(--mezmk-accent);
	outline-offset: 1px;
}

/* ------------------------------------------------- driver recommendation */

.mezmk-driver {
	display: grid;
	gap: 0.8rem;
}

.mezmk-driver__headline {
	padding: 0.85rem 1rem;
	border: 1px solid var(--mezmk-border-strong);
	border-radius: 12px;
	background: rgba(105, 178, 26, 0.1);
}

.mezmk-driver__pick {
	margin: 0 0 0.2rem;
	color: var(--mezmk-text);
	font-size: 1.02rem;
	font-weight: 700;
	letter-spacing: 0.06em !important;
	line-height: 1.35;
}

.mezmk-driver__why {
	margin: 0;
	color: var(--mezmk-muted);
	font-size: 0.82rem;
	line-height: 1.5;
}

.mezmk-driver__controls {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
	gap: 0.8rem;
	align-items: end;
}

.mezmk-driver__field > span {
	display: block;
	margin-bottom: 0.35rem;
	color: var(--mezmk-muted);
	font-size: 0.85rem;
	font-weight: 600;
}

.mezmk-caps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.mezmk .mezmk-cap {
	min-height: 44px;
	padding: 0.5rem 0.9rem;
	border: 1px solid var(--mezmk-border);
	border-radius: 10px;
	background: var(--mezmk-field);
	color: var(--mezmk-text);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0;
	white-space: nowrap;
	cursor: pointer;
}

.mezmk .mezmk-cap:hover,
.mezmk .mezmk-cap:focus {
	border-color: var(--mezmk-accent);
	background: var(--mezmk-surface-soft);
	color: var(--mezmk-text);
}

.mezmk .mezmk-cap[aria-pressed="true"] {
	border-color: var(--mezmk-accent);
	background: rgba(105, 178, 26, 0.18);
	box-shadow: inset 0 0 0 1px var(--mezmk-accent);
	color: var(--mezmk-text);
}

.mezmk .mezmk-driver__auto {
	justify-self: start;
	min-height: 44px;
	padding: 0 0.4rem;
	border: 0;
	background: none;
	color: var(--mezmk-soft);
	font-family: inherit;
	font-size: 0.82rem;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.mezmk .mezmk-driver__auto:hover {
	background: none;
	color: var(--mezmk-text);
}

/* -------------------------------------------------------------- summary */

.mezmk-summary__inner {
	border: 1px solid var(--mezmk-border);
	border-radius: var(--mezmk-radius);
	background: var(--mezmk-surface);
	padding: 1.1rem;
}

.mezmk .mezmk-summary__title,
.mezmk .mezmk-bom__title {
	margin: 0 0 0.7rem;
	color: var(--mezmk-text);
	font-family: "Eurostille", "Montserrat", system-ui, sans-serif;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.085em !important;
	line-height: 1.35;
}

.mezmk .mezmk-bom__title {
	margin-top: 1.1rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--mezmk-border);
}

.mezmk-stats {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.3rem 1rem;
	margin: 0;
	font-size: 0.88rem;
}

.mezmk-stats dt {
	color: var(--mezmk-soft);
}

.mezmk-stats dd {
	margin: 0;
	color: var(--mezmk-text);
	font-weight: 600;
	text-align: right;
}

.mezmk-stats dd.is-warn {
	color: #ff9d76;
}

.mezmk-bom {
	font-size: 0.85rem;
}

.mezmk-bom__group {
	margin: 0 0 0.7rem;
}

.mezmk .mezmk-bom__group h4 {
	margin: 0 0 0.3rem;
	color: var(--mezmk-soft);
	font-family: "Montserrat", system-ui, sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.mezmk-bom__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
	padding: 0.3rem 0;
	border-bottom: 1px dashed var(--mezmk-border);
	color: var(--mezmk-text);
}

.mezmk-bom__row:last-child {
	border-bottom: 0;
}

.mezmk-bom__sku {
	display: block;
	color: var(--mezmk-soft);
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

.mezmk-bom__qty {
	color: var(--mezmk-text);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.mezmk-empty {
	margin: 0;
	color: var(--mezmk-soft);
	font-size: 0.88rem;
}

/* ---------------------------------------------------------------- notes */

.mezmk-notes:empty {
	display: none;
}

.mezmk-note {
	margin: 0.5rem 0 0;
	padding: 0.6rem 0.75rem;
	border-left: 3px solid var(--mezmk-accent);
	border-radius: 8px;
	background: rgba(105, 178, 26, 0.1);
	color: var(--mezmk-muted);
	font-size: 0.82rem;
	line-height: 1.45;
}

.mezmk-note--warn {
	border-left-color: #d1751f;
	background: rgba(209, 117, 31, 0.14);
	color: #ffcda8;
}

/* -------------------------------------------------------------- actions */

.mezmk-actions {
	display: grid;
	gap: 0.5rem;
	margin-top: 1.1rem;
}

.mezmk .mezmk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0.6rem 1rem;
	border: 1px solid transparent;
	border-radius: 10px;
	font-family: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mezmk .mezmk-btn:focus-visible {
	outline: 2px solid var(--mezmk-accent);
	outline-offset: 2px;
}

.mezmk .mezmk-btn--primary {
	/* White on #69B21A is 2.63:1; on the brand secondary it is 5.19:1. */
	background: var(--mezmk-accent-strong);
	color: #fff;
}

.mezmk .mezmk-btn--primary:hover {
	background: var(--mezmk-accent-darker);
	color: #fff;
}

.mezmk .mezmk-btn--ghost {
	border-color: var(--mezmk-border-strong);
	background: rgba(105, 178, 26, 0.1);
	color: var(--mezmk-accent-bright);
}

.mezmk .mezmk-btn--ghost:hover {
	border-color: var(--mezmk-accent);
	background: rgba(105, 178, 26, 0.18);
	color: #d3ffa4;
}

.mezmk .mezmk-btn--reset {
	min-height: 44px;
	border-color: transparent;
	background: none;
	color: var(--mezmk-soft);
	font-size: 0.85rem;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mezmk .mezmk-btn--reset:hover {
	background: none;
	color: var(--mezmk-text);
}

.mezmk .mezmk-btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

.mezmk-help {
	margin: 0.8rem 0 0;
	color: var(--mezmk-soft);
	font-size: 0.82rem;
	text-align: center;
}

.mezmk .mezmk-help a {
	/* A phone number on a phone must be a real tap target, not a 16px line. */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 0.4rem;
	color: var(--mezmk-accent-bright);
	font-weight: 600;
	white-space: nowrap;
}

.mezmk-error {
	padding: 1rem;
	border: 1px solid rgba(255, 120, 120, 0.4);
	border-radius: 10px;
	background: rgba(120, 30, 30, 0.2);
	color: #ffd5d5;
}

@media (prefers-reduced-motion: reduce) {
	.mezmk * {
		transition: none !important;
	}
}

/* ----------------------------------------------------------------- areas */

.mezmk-step--areas {
	border-color: var(--mezmk-border-strong);
}

.mezmk-areas {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0.9rem;
}

.mezmk .mezmk-area {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.1rem;
	min-height: 44px;
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--mezmk-border);
	border-radius: 999px;
	background: var(--mezmk-surface-strong);
	color: var(--mezmk-text);
	font-family: inherit;
	font-size: 0.85rem;
	letter-spacing: 0;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.mezmk .mezmk-area:hover,
.mezmk .mezmk-area:focus {
	border-color: var(--mezmk-accent);
	background: var(--mezmk-surface-soft);
	color: var(--mezmk-text);
}

.mezmk .mezmk-area:focus-visible {
	outline: 2px solid var(--mezmk-accent);
	outline-offset: 2px;
}

.mezmk .mezmk-area.is-active {
	border-color: var(--mezmk-accent);
	background: rgba(105, 178, 26, 0.16);
	box-shadow: inset 0 0 0 1px var(--mezmk-accent);
}

.mezmk-area__name {
	font-weight: 600;
	line-height: 1.2;
}

.mezmk-area__meta {
	color: var(--mezmk-soft);
	font-size: 0.7rem;
	line-height: 1.2;
}

.mezmk .mezmk-area--add {
	border-style: dashed;
	background: none;
	color: var(--mezmk-accent-bright);
	justify-content: center;
	font-weight: 600;
}

.mezmk-areas__edit {
	display: grid;
	gap: 0.7rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--mezmk-border);
}

.mezmk-areas__field > span {
	display: block;
	margin-bottom: 0.35rem;
	color: var(--mezmk-muted);
	font-size: 0.85rem;
	font-weight: 600;
}

.mezmk .mezmk-areas__input {
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--mezmk-border-strong);
	border-radius: 10px;
	/* Light field, dark text - same reasoning as the other inputs. */
	background: #ffffff;
	color: var(--mezmk-ink);
	font-family: inherit;
	font-size: 1rem;
}

.mezmk .mezmk-areas__input::placeholder {
	color: #5a665c;
	opacity: 1;
}

.mezmk .mezmk-areas__input:focus-visible {
	outline: 2px solid var(--mezmk-accent);
	outline-offset: 1px;
}

.mezmk-areas__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.mezmk .mezmk-areas__btn {
	min-height: 44px;
	padding: 0.5rem 0.9rem;
	border: 1px solid var(--mezmk-border);
	border-radius: 10px;
	background: var(--mezmk-field);
	color: var(--mezmk-text);
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0;
	cursor: pointer;
}

.mezmk .mezmk-areas__btn:hover:not([disabled]),
.mezmk .mezmk-areas__btn:focus:not([disabled]) {
	border-color: var(--mezmk-accent);
	background: var(--mezmk-surface-soft);
	color: var(--mezmk-text);
}

.mezmk .mezmk-areas__btn--danger:hover:not([disabled]) {
	border-color: #d1751f;
	color: #ffcda8;
}

.mezmk .mezmk-areas__btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ------------------------------------------------ bill grouped by area */

.mezmk-bom__area {
	padding-bottom: 0.6rem;
	margin-bottom: 0.6rem;
	border-bottom: 1px solid var(--mezmk-border);
}

.mezmk-bom__area:last-child {
	border-bottom: 0;
	margin-bottom: 0;
}

.mezmk-bom__area--total {
	margin-top: 0.3rem;
	padding: 0.8rem;
	border: 1px solid var(--mezmk-border-strong);
	border-radius: 12px;
	background: rgba(105, 178, 26, 0.08);
}

.mezmk-bom__area-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}

.mezmk .mezmk-bom__area-name {
	margin: 0;
	color: var(--mezmk-accent-bright);
	font-family: "Montserrat", system-ui, sans-serif;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: none;
}

.mezmk-bom__area-meta {
	color: var(--mezmk-soft);
	font-size: 0.72rem;
}
