/**
 * Elevator Configurator — essentials (Phase 6, Fragment 4 of 4)
 * Location: wp-content/themes/<your-theme>/assets/css/configurator.css
 *
 * Only the bits the mechanism needs: layer stacking, active/hide states,
 * and the AJAX message colours. Everything visual (spacing, fonts, colours,
 * button chrome) stays in your existing theme CSS.
 */

/* ---- Left preview: the same-size layer stack ------------------------- */

.configurationImg {
	position: relative;
	width: 100%;
	max-width: 930px;              /* the canvas width */
	margin: 0 auto;
	/* Lock the box to the 930 × 1328 ratio so every layer lines up. */
	aspect-ratio: var(--ele-w, 930) / var(--ele-h, 1328);
	overflow: hidden;
}

/* Base image + every step layer occupy the exact same box. */
.configurationImg .ele-base,
.configurationImg .ele-layer,
.configurationImg .ele-layer img.dd {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;           /* never distort a layer */
	display: block;
}

.configurationImg .ele-base { z-index: 0; }

/* A layer with no current selection (or a hidden step) is removed. */
.configurationImg .ele-layer.ele-layer-off,
.configurationImg .ele-layer img.dd[src=""],
.configurationImg .ele-layer img.dd:not([src]) {
	display: none;
}

/* Fallback for very old browsers without aspect-ratio support. */
@supports not (aspect-ratio: 1 / 1) {
	.configurationImg {
		height: 0;
		padding-top: calc(1328 / 930 * 100%);
	}
}

/* ---- Right options: active + hidden states -------------------------- */

/* Whole step hidden by a rule / style flag. */
.cabconfigopts .ele-step.ele-hidden {
	display: none;
}

/* Single option hidden (hide_option / show_only / allowed-materials). */
.cabconfigopts .ele-step button.ele-opt.ele-opt-hidden {
	display: none;
}

/* Active option highlight (kept light so your theme can override). */
.cabconfigopts .ele-step button.ele-opt.active {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* Make the whole swatch clickable even if the click lands on the <img>. */
.cabconfigopts .ele-step button.ele-opt img {
	pointer-events: none;
	display: block;
}

/* ---- Modal AJAX message --------------------------------------------- */

.ele-form-msg {
	margin: 10px 0;
	min-height: 1.2em;
	font-size: 0.95em;
}
.ele-form-msg.ele-msg-ok    { color: #1a7f37; }
.ele-form-msg.ele-msg-error { color: #b32d2e; }

/* ---- Modal fallback (only used when Bootstrap JS is absent) ---------- */

.modal.fade.show {
	display: block;
	background: rgba(0, 0, 0, 0.5);
}
body.modal-open {
	overflow: hidden;
}

/* ---- Form security (honeypot + quick check) ------------------------- */

/* Honeypot: off-screen for people, still in the DOM for bots. */
.ele-hp {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.ele-q-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.95em;
}
.ele-q-prefix {
	font-weight: bold;
	color: #232e5e;
}
.ele-q-status {
	display: block;
	min-height: 1.2em;
	margin-top: 4px;
	font-size: 0.85em;
}
.ele-q-status.is-ok { color: #1a7f37; font-weight: bold; }

/* Send Request is locked until the quick check is answered. */
.ele-submit:disabled,
.ele-submit.is-locked {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Field the server flagged (bad answer, gibberish name, bad phone…). */
#ele-lead-form .ele-invalid {
	border-color: #b32d2e !important;
	box-shadow: 0 0 0 1px #b32d2e;
}
