/**
 * WaterTech Configurator — front-end styles.
 * Scoped under .watertech-configurator. Colors/fonts inherit Elementor globals
 * where available and fall back to the BLU|BOX palette.
 */

.watertech-configurator {
	--wtc-bg: var(--e-global-color-primary, #0D1B2A);
	--wtc-panel: #1E3148;
	--wtc-panel-2: #162436;
	--wtc-accent: var(--e-global-color-accent, #00A8E8);
	--wtc-accent-dk: #0087BF;
	--wtc-steel: #8FA8BC;
	--wtc-steel-lt: #C8D4DC;
	--wtc-text-light: #FFFFFF;
	--wtc-on-accent: #0D1B2A;
	--wtc-heading-font: var(--e-global-typography-accent-font-family, "Barlow Condensed", sans-serif);
	--wtc-body-font: var(--e-global-typography-primary-font-family, "Inter", system-ui, sans-serif);
	--wtc-ratio: 4 / 3;

	background: var(--wtc-bg);
	padding: 64px 32px;
	box-sizing: border-box;
}

.watertech-configurator *,
.watertech-configurator *::before,
.watertech-configurator *::after {
	box-sizing: border-box;
}

.watertech-configurator .wtc-inner {
	max-width: 1200px;
	margin: 0 auto;
}

/* Header */
.wtc-eyebrow {
	font-family: var(--wtc-heading-font);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wtc-accent);
	margin: 0 0 12px;
}
.wtc-title {
	font-family: var(--wtc-heading-font);
	font-size: 44px;
	font-weight: 800;
	line-height: 1.05;
	color: var(--wtc-text-light);
	margin: 0 0 16px;
}
.wtc-rule {
	display: block;
	height: 2px;
	width: 80px;
	background: linear-gradient(90deg, var(--wtc-accent), transparent);
	margin: 0 0 20px;
}
.wtc-lead {
	font-family: var(--wtc-body-font);
	font-size: 17px;
	line-height: 1.7;
	color: var(--wtc-steel-lt);
	max-width: 640px;
	margin: 0;
}

/* Grid.
   minmax(0,1fr) — NOT bare 1fr — so tracks can shrink below content
   min-width. Themes that set white-space:nowrap on buttons otherwise blow
   the track out past the viewport on mobile (the CTA's single-line width
   becomes the track minimum). */
.wtc-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 56px;
	align-items: start;
	margin-top: 44px;
}
.wtc-controls,
.wtc-output {
	min-width: 0;
	max-width: 100%;
}

/* Controls */
.wtc-group + .wtc-group {
	margin-top: 24px;
}
.wtc-group-label {
	font-family: var(--wtc-heading-font);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wtc-steel);
	margin: 0 0 10px;
}
.wtc-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.wtc-btn {
	font-family: var(--wtc-heading-font);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	padding: 8px 16px;
	border: 1px solid var(--wtc-panel);
	background: var(--wtc-panel);
	color: var(--wtc-steel-lt);
	cursor: pointer;
	transition: all 0.15s ease;
	user-select: none;
	white-space: normal; /* themes often force nowrap on buttons */
}
.wtc-btn:hover {
	border-color: var(--wtc-steel);
	color: var(--wtc-text-light);
}
.wtc-btn:focus-visible {
	outline: 2px solid var(--wtc-accent);
	outline-offset: 2px;
}
.wtc-btn.is-active {
	background: var(--wtc-accent);
	border-color: var(--wtc-accent);
	color: var(--wtc-on-accent);
	font-weight: 700;
}

/* Slider-style group (e.g. System Size) */
.wtc-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	margin: 14px 0 6px;
	border-radius: 3px;
	background: var(--wtc-panel);
	outline: none;
	cursor: pointer;
}
.wtc-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--wtc-accent);
	border: 3px solid var(--wtc-bg);
	box-shadow: 0 0 0 1px var(--wtc-accent);
	cursor: pointer;
}
.wtc-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--wtc-accent);
	border: 3px solid var(--wtc-bg);
	cursor: pointer;
}
.wtc-slider:focus-visible {
	box-shadow: 0 0 0 2px var(--wtc-accent);
}
.wtc-slider-readout {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 4px;
}
.wtc-slider-flow {
	font-family: var(--wtc-heading-font);
	font-size: 24px;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: var(--wtc-accent);
}
.wtc-slider-model {
	font-family: var(--wtc-heading-font);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wtc-steel-lt);
}
.wtc-slider-model::before {
	content: "\2192 ";
	color: var(--wtc-steel);
}

/* Output column */
.wtc-output {
	position: sticky;
	top: 80px;
}

/* Visual stage */
.wtc-stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--wtc-ratio);
	background: var(--wtc-panel-2);
	border: 1px solid var(--wtc-panel);
	border-top: 3px solid var(--wtc-accent);
	margin-bottom: 16px;
	overflow: hidden;
}
.wtc-layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

/* Model display */
.wtc-display {
	background: var(--wtc-panel);
	border: 1px solid var(--wtc-panel);
	border-top: 3px solid var(--wtc-accent);
	padding: 32px;
}
.wtc-model-label {
	font-family: var(--wtc-heading-font);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wtc-steel);
	margin: 0 0 12px;
}
.wtc-model-string {
	font-family: var(--wtc-heading-font);
	font-size: 28px;
	font-weight: 800;
	color: var(--wtc-accent);
	letter-spacing: 0.06em;
	margin: 0 0 24px;
	overflow-wrap: anywhere; /* prefers breaking at hyphens, mid-token only if unavoidable */
	line-height: 1.3;
	text-transform: uppercase;
}
.wtc-summary {
	border-top: 1px solid var(--wtc-bg);
	padding-top: 20px;
}
.wtc-summary-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.wtc-summary-label {
	font-family: var(--wtc-heading-font);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wtc-steel);
}
.wtc-summary-val {
	font-family: var(--wtc-body-font);
	font-size: 13px;
	color: var(--wtc-text-light);
	font-weight: 500;
	text-align: right;
}
.wtc-cta {
	margin-top: 24px;
	width: 100%;
	background: var(--wtc-accent);
	color: var(--wtc-on-accent);
	font-family: var(--wtc-heading-font);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 14px;
	border: none;
	cursor: pointer;
	transition: background 0.2s ease;
	white-space: normal; /* must wrap on narrow screens (theme may force nowrap) */
}
.wtc-cta:hover {
	background: var(--wtc-accent-dk);
	color: #fff;
}
.wtc-cta:focus-visible {
	outline: 2px solid var(--wtc-text-light);
	outline-offset: 2px;
}

/* Modal */
.wtc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 5vh 16px;
	overflow-y: auto;
}
.wtc-modal[hidden] {
	display: none;
}
.wtc-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(13, 27, 42, 0.78);
}
.wtc-modal-box {
	position: relative;
	z-index: 1;
	background: #fff;
	color: #1a2b3c;
	width: 100%;
	max-width: 640px;
	padding: 32px;
	border-top: 4px solid var(--wtc-accent);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.wtc-modal-x {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: #556677;
	cursor: pointer;
}
.wtc-modal-x:hover {
	color: #0d1b2a;
}
.wtc-modal-empty {
	color: #556677;
	margin: 0;
}

/* ──────────────────────────────────────────────────────────────
   Appearance themes. The default (.wtc-theme-dark) uses the base
   navy vars above. Light and Transparent override surfaces/text so
   the configurator blends into the page. The cyan accent is kept.
   ────────────────────────────────────────────────────────────── */

/* Transparent / inherit — blends into whatever section it sits in. */
.watertech-configurator.wtc-theme-transparent {
	background: transparent;
	padding: 0;
	--wtc-panel: color-mix(in srgb, currentColor 6%, transparent);
	--wtc-panel-2: color-mix(in srgb, currentColor 4%, transparent);
	--wtc-steel: color-mix(in srgb, currentColor 62%, transparent);
	--wtc-steel-lt: color-mix(in srgb, currentColor 86%, transparent);
	--wtc-text-light: currentColor;
}
.wtc-theme-transparent .wtc-display,
.wtc-theme-transparent .wtc-stage {
	background: transparent;
	border-color: color-mix(in srgb, currentColor 14%, transparent);
}
.wtc-theme-transparent .wtc-btn {
	background: transparent;
	border-color: color-mix(in srgb, currentColor 28%, transparent);
	color: inherit;
}
.wtc-theme-transparent .wtc-summary {
	border-top-color: color-mix(in srgb, currentColor 14%, transparent);
}
.wtc-theme-transparent .wtc-summary-row {
	border-bottom-color: color-mix(in srgb, currentColor 10%, transparent);
}
.wtc-theme-transparent .wtc-slider {
	background: color-mix(in srgb, currentColor 16%, transparent);
}

/* Light surfaces — white panels on the page background. */
.watertech-configurator.wtc-theme-light {
	background: transparent;
	padding: 0;
	--wtc-panel: #ffffff;
	--wtc-panel-2: #f4f7fa;
	--wtc-steel: #5a6b7b;
	--wtc-steel-lt: #33414f;
	--wtc-text-light: #1a2b3c;
}
.wtc-theme-light .wtc-display,
.wtc-theme-light .wtc-stage {
	background: var(--wtc-panel);
	border-color: #e3e9ef;
}
.wtc-theme-light .wtc-btn {
	background: #fff;
	border-color: #d3dbe3;
	color: #33414f;
}
.wtc-theme-light .wtc-summary {
	border-top-color: #e3e9ef;
}
.wtc-theme-light .wtc-summary-row {
	border-bottom-color: #eef2f6;
}
.wtc-theme-light .wtc-slider {
	background: #e3e9ef;
}

/* Fallbacks for browsers without color-mix() — keep readable surfaces. */
@supports not (color: color-mix(in srgb, red 50%, transparent)) {
	.wtc-theme-transparent .wtc-display,
	.wtc-theme-transparent .wtc-stage {
		border-color: rgba(128, 128, 128, 0.25);
	}
	.wtc-theme-transparent .wtc-btn {
		border-color: rgba(128, 128, 128, 0.4);
	}
	.wtc-theme-transparent .wtc-slider {
		background: rgba(128, 128, 128, 0.2);
	}
	.wtc-theme-transparent .wtc-group-label,
	.wtc-theme-transparent .wtc-summary-label {
		opacity: 0.7;
	}
}

/* Responsive */
@media (max-width: 860px) {
	.wtc-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}
	.wtc-output {
		position: static;
	}
	.wtc-title {
		font-size: 34px;
	}
}

@media (max-width: 600px) {
	.watertech-configurator.wtc-theme-dark {
		padding: 48px 20px;
	}
	.wtc-title {
		font-size: 30px;
	}
	.wtc-display {
		padding: 20px 16px;
	}
	.wtc-model-string {
		font-size: 22px;
	}
	.wtc-summary-row {
		gap: 12px;
	}
	.wtc-slider-flow {
		font-size: 21px;
	}
	.wtc-cta {
		font-size: 13px;
		padding: 13px 10px;
	}
}
