/* Nexus Sections — back-to-top button */
.nsx-top {
	position: fixed;
	left: 22px;
	bottom: 22px;
	z-index: 9997;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--nsx-border);
	background: var(--nsx-surface);
	color: var(--nsx-heading);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease;
	box-shadow: 0 8px 22px -12px rgba(0, 0, 0, 0.4);
}
.nsx-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.nsx-top:hover { background: var(--nsx-primary); color: var(--nsx-on-primary); border-color: transparent; }

/* Dark-mode toggle button */
.nsx-theme-toggle {
	position: fixed;
	left: 22px;
	bottom: 78px;
	z-index: 9997;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--nsx-border);
	background: var(--nsx-surface);
	color: var(--nsx-heading);
	font-size: 18px;
	cursor: pointer;
	box-shadow: 0 8px 22px -12px rgba(0, 0, 0, 0.4);
}
.nsx-theme-toggle__moon { display: none; }
html[data-nsx-theme="dark"] .nsx-theme-toggle__moon { display: inline; }
html[data-nsx-theme="dark"] .nsx-theme-toggle__sun { display: none; }

/* Cookie consent bar */
.nsx-cookie {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 9996;
	max-width: 640px;
	margin-inline: auto;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	background: var(--nsx-surface);
	color: var(--nsx-text);
	border: 1px solid var(--nsx-border);
	border-radius: var(--nsx-radius);
	box-shadow: 0 18px 44px -24px rgba(0, 0, 0, 0.5);
	font-family: var(--nsx-font-body);
}
.nsx-cookie p { margin: 0; flex: 1; font-size: 0.9rem; }
/* Self-contained button styles (frontend.css isn't loaded site-wide) with
 * !important so they don't fall back to Elementor's default button color. */
.nsx-cookie .nsx-btn,
.nsx-popup .nsx-btn,
.nsx-ctabar .nsx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border: 0 !important;
	border-radius: calc(var(--nsx-radius) * 0.55);
	background: var(--nsx-primary) !important;
	color: var(--nsx-on-primary) !important;
	font-family: var(--nsx-btn-font, var(--nsx-font-body)) !important;
	font-weight: var(--nsx-btn-weight, 600);
	text-transform: var(--nsx-btn-transform, none);
	letter-spacing: var(--nsx-btn-spacing, 0);
	text-decoration: none;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.nsx-cookie .nsx-btn { flex: 0 0 auto; }

/* Sticky bottom CTA bar */
.nsx-ctabar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9995;
	background: var(--nsx-surface);
	color: var(--nsx-text);
	border-top: 1px solid var(--nsx-border);
	box-shadow: 0 -14px 40px -28px rgba(0, 0, 0, 0.5);
	font-family: var(--nsx-font-body);
}
.nsx-ctabar[hidden] { display: none; }
.nsx-ctabar__inner {
	max-width: var(--nsx-max-width, 1160px);
	margin-inline: auto;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 20px;
}
.nsx-ctabar__text { margin: 0; flex: 1; font-weight: 600; font-size: 0.98rem; }
.nsx-ctabar__btn { flex: 0 0 auto; }
.nsx-ctabar__close {
	flex: 0 0 auto;
	border: 0;
	background: transparent;
	color: var(--nsx-muted, currentColor);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
body.nsx-has-ctabar { padding-bottom: 72px; }
@media (max-width: 600px) {
	.nsx-ctabar__inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
	.nsx-ctabar__text { flex: 1 1 100%; }
	body.nsx-has-ctabar { padding-bottom: 120px; }
}

/* Newsletter popup */
.nsx-popup { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; }
.nsx-popup[hidden] { display: none; }
.nsx-popup__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.nsx-popup__panel {
	position: relative;
	background: var(--nsx-surface);
	color: var(--nsx-text);
	border-radius: var(--nsx-radius);
	padding: clamp(28px, 5vw, 44px);
	width: min(460px, 92vw);
	text-align: center;
	font-family: var(--nsx-font-body);
	box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.6);
}
.nsx-popup__panel h3 { font-family: var(--nsx-font-heading); color: var(--nsx-heading); margin: 0 0 10px; }
.nsx-popup__close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--nsx-muted); }
.nsx-popup .nsx-form__row { display: flex; gap: 10px; margin-top: 16px; }
/* !important throughout: this input renders outside .nsx-page, so Elementor's
 * form styling would otherwise override the border, fill and radius. */
.nsx-popup input[type="email"] {
	flex: 1;
	border: 1px solid var(--nsx-border) !important;
	border-radius: calc(var(--nsx-radius) * 0.5) !important;
	padding: 12px 14px !important;
	background-color: var(--nsx-bg) !important;
	background-image: none !important;
	color: var(--nsx-text) !important;
	font: inherit;
	box-shadow: none !important;
}
.nsx-form__hp { position: absolute; left: -9999px; }

@media (max-width: 560px) {
	.nsx-popup .nsx-form__row { flex-direction: column; }
}
