/* ============================================================
   RocketX Header — refined upmarket dark-glass, sticky
   ============================================================ */

.rx-header {
	position: sticky;
	top: 0;
	z-index: var(--rx-z-nav, 100);
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	transition: border-color var(--rx-dur-fast) var(--rx-ease-out);
}

/* Glass lives on a ::before layer, NOT on .rx-header itself.
   A backdrop-filter on .rx-header would make it the containing block for
   its own position:fixed descendants — which clamps the mobile drawer
   (.rx-nav) to the header's height instead of the viewport (truncation).
   Keeping the filter on the pseudo-element preserves the frosted look
   while letting the fixed drawer resolve against the viewport. */
.rx-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(10, 14, 31, 0.66);
	backdrop-filter: blur(18px) saturate(150%);
	-webkit-backdrop-filter: blur(18px) saturate(150%);
	transition: background var(--rx-dur-fast) var(--rx-ease-out);
}

.rx-header--scrolled { border-bottom-color: rgba(255, 255, 255, 0.1); }
.rx-header--scrolled::before { background: rgba(7, 10, 22, 0.9); }

.rx-header__inner {
	max-width: 1320px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 1.1rem clamp(1.25rem, 4vw, 4rem);
}

.rx-header__logo {
	display: inline-flex;
	margin-right: auto;
}
.rx-header__logo img {
	height: 46px;
	width: auto;
	display: block;
}

/* ---- Nav ---- */
.rx-nav {
	display: flex;
	align-items: center;
	gap: 2rem;
}

.rx-nav__list {
	display: flex;
	align-items: center;
	gap: 1.7rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rx-nav__item { position: relative; }

.rx-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.5rem 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.92rem;
	font-weight: 500;
	text-decoration: none;
	transition: color var(--rx-dur-fast) var(--rx-ease-out);
}
.rx-nav__link:hover,
.rx-nav__item--has:focus-within .rx-nav__link { color: #fff; }

.rx-nav__caret {
	width: 11px;
	height: 11px;
	opacity: 0.65;
	transition: transform var(--rx-dur-fast) var(--rx-ease-out);
}
.rx-nav__item--has:hover .rx-nav__caret,
.rx-nav__item--has:focus-within .rx-nav__caret { transform: rotate(180deg); }

/* ---- Dropdowns ---- */
.rx-nav__sub {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 210px;
	margin: 0.55rem 0 0;
	padding: 0.5rem;
	list-style: none;
	background: rgba(16, 20, 40, 0.97);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	box-shadow: var(--rx-shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--rx-dur-fast) var(--rx-ease-out),
		transform var(--rx-dur-fast) var(--rx-ease-out),
		visibility var(--rx-dur-fast);
}
.rx-nav__item--has:hover .rx-nav__sub,
.rx-nav__item--has:focus-within .rx-nav__sub {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.rx-nav__sub a {
	display: block;
	padding: 0.6rem 0.8rem;
	border-radius: 8px;
	color: rgba(255, 255, 255, 0.76);
	font-size: 0.9rem;
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--rx-dur-fast) var(--rx-ease-out),
		color var(--rx-dur-fast) var(--rx-ease-out);
}
.rx-nav__sub a:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}

/* ---- Login / Sign Up CTAs (each a dropdown: Client / IB) ---- */
.rx-header__cta {
	display: flex;
	align-items: center;
	gap: 0.7rem;
}
.rx-header__cta-group { position: relative; }
.rx-header .rx-header__cta-btn {
	padding: 0.55rem 1.1rem;
	font-size: 0.88rem;
}
.rx-nav__sub--cta { left: auto; right: 0; }

/* ------------------------------------------------------------------
   Elementor Kit hijack fix.
   `.elementor-kit-6 button` (specificity 0,1,1) fills EVERY bare <button>
   with the accent colour, 28px radius, 40px padding and Montserrat 18px —
   which repaints our own button controls (header toggle, CTA dropdowns,
   bottom bar, sheet buttons) into orange pills. Our .rx-* rules are only
   (0,1,0) and lose. Re-assert control by prefixing with an ancestor class
   so every selector below is ≥ (0,2,0) and wins regardless of load order.
   ------------------------------------------------------------------ */
.rx-header .rx-header__toggle,
.rx-header .rx-header__cta-btn,
.rx-header .rx-nav__close,
.rx-mobilebar .rx-mobilebar__btn,
.rx-sheet .rx-sheet__cancel {
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
}
.rx-header .rx-btn--primary { background: linear-gradient(135deg, var(--rx-orange) 0%, var(--rx-orange-600) 100%); border-radius: var(--rx-r-pill); }
.rx-header .rx-btn--ghost   { background: rgba(255, 255, 255, 0.04); border-radius: var(--rx-r-pill); }

/* ---- Mobile toggle (hidden on desktop) ---- */
.rx-header__toggle { display: none; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
	.rx-header .rx-header__toggle {
		display: flex;
		flex-direction: column;
		gap: 5px;
		align-items: center;
		justify-content: center;
		width: 42px;
		height: 42px;
		padding: 0;
		background: rgba(255, 255, 255, 0.06);
		border: 1px solid rgba(255, 255, 255, 0.12);
		border-radius: 10px;
		cursor: pointer;
	}
	.rx-header__toggle span {
		width: 20px;
		height: 2px;
		border-radius: 2px;
		background: #fff;
		transition: transform var(--rx-dur-fast) var(--rx-ease-out),
			opacity var(--rx-dur-fast) var(--rx-ease-out);
	}
	.rx-header__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.rx-header__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
	.rx-header__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

	.rx-nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: auto;
		width: min(330px, 86vw);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 5.5rem 1.5rem 2rem;
		background: rgba(9, 12, 26, 0.98);
		backdrop-filter: blur(20px);
		-webkit-backdrop-filter: blur(20px);
		border-left: 1px solid rgba(255, 255, 255, 0.08);
		box-shadow: var(--rx-shadow-lg);
		transform: translateX(100%);
		transition: transform var(--rx-dur-base) var(--rx-ease-out);
		overflow-y: auto;
	}
	.rx-nav--open { transform: translateX(0); }

	.rx-nav__list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
	.rx-nav__item { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
	.rx-nav__link { padding: 0.95rem 0; justify-content: space-between; font-size: 1rem; }

	.rx-nav__sub {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		min-width: 0;
		margin: 0 0 0.6rem;
		padding: 0 0 0 0.9rem;
		background: transparent;
		border: none;
		box-shadow: none;
		backdrop-filter: none;
	}
	.rx-nav__sub a { padding: 0.55rem 0; }

	body.rx-nav-open { overflow: hidden; }
}

/* ============================================================
   Mobile drawer chrome + app-style bottom bar
   (elements hidden by default; revealed ≤980px)
   ============================================================ */
.rx-nav__close,
.rx-nav-scrim,
.rx-mobilebar,
.rx-sheet { display: none; }

@media (max-width: 980px) {

	/* Account actions live in the bottom bar on mobile — drop the in-drawer CTA. */
	.rx-header__cta { display: none !important; }

	/* Give the drawer room for the close button and breathing space. */
	.rx-nav { padding-top: 4.75rem; z-index: var(--rx-z-nav, 100); }

	/* ---- Drawer close (✕) ----
	   Ancestor-prefixed (.rx-header, 0,2,0) so it beats the Elementor Kit's
	   `.elementor-kit-6 button` (0,1,1) — a bare `.rx-nav__close` (0,1,0) loses
	   and the button renders as an orange 28px-radius pill. */
	.rx-header .rx-nav__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 1.15rem;
		right: 1.15rem;
		width: 40px;
		height: 40px;
		padding: 0;
		color: #fff;
		background: rgba(255, 255, 255, 0.06);
		border: 1px solid rgba(255, 255, 255, 0.12);
		border-radius: 10px;
		cursor: pointer;
	}
	.rx-header .rx-nav__close svg { width: 20px; height: 20px; }
	.rx-header .rx-nav__close:hover { background: rgba(255, 255, 255, 0.12); }

	/* ---- Drawer backdrop ---- */
	.rx-nav-scrim {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 95; /* under the drawer/header (100), over content + bottom bar */
		background: rgba(5, 8, 18, 0.55);
		backdrop-filter: blur(2px);
		-webkit-backdrop-filter: blur(2px);
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--rx-dur-fast) var(--rx-ease-out), visibility var(--rx-dur-fast);
	}
	.rx-nav-scrim.is-open { opacity: 1; visibility: visible; }

	/* While the drawer is open, lift the whole overlay above the page's
	   compliance bar (z-index 9999). The drawer lives inside .rx-header, so
	   raising the header's stacking context carries the drawer with it; the
	   scrim sits just below the drawer and just above the compliance bar. */
	body.rx-nav-open .rx-header { z-index: 10001; }
	body.rx-nav-open .rx-nav-scrim { z-index: 10000; }

	/* ---- App-style bottom bar: two flush, full-width rectangles ---- */
	.rx-mobilebar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		padding: 0;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		background: rgba(9, 12, 26, 0.92);
		backdrop-filter: blur(18px) saturate(150%);
		-webkit-backdrop-filter: blur(18px) saturate(150%);
		border-top: 1px solid rgba(255, 255, 255, 0.09);
		box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
		transition: transform var(--rx-dur-base) var(--rx-ease-out);
	}
	/* Slide the bar away while the full-screen drawer is open. */
	body.rx-nav-open .rx-mobilebar { transform: translateY(120%); }

	.rx-mobilebar .rx-mobilebar__btn {
		flex: 1 1 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.55rem;
		padding: 1.15rem 1rem;
		border: 0;
		border-radius: 0;
		font-size: 1rem;
		font-weight: 600;
		line-height: 1;
		letter-spacing: 0.01em;
		text-decoration: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}
	.rx-mobilebar__ic { width: 20px; height: 20px; flex: none; }
	/* Left rectangle — Log in (neutral fill, hairline divider from Sign up). */
	.rx-mobilebar .rx-mobilebar__btn--login {
		color: #fff;
		background: rgba(255, 255, 255, 0.05);
		border-right: 1px solid rgba(255, 255, 255, 0.12);
	}
	.rx-mobilebar .rx-mobilebar__btn--login:active { background: rgba(255, 255, 255, 0.11); }
	/* Right rectangle — Sign up (brand fill). */
	.rx-mobilebar .rx-mobilebar__btn--signup {
		color: #fff;
		background: linear-gradient(135deg, var(--rx-orange) 0%, var(--rx-orange-600) 100%);
	}
	.rx-mobilebar .rx-mobilebar__btn--signup:active { filter: brightness(0.94); }

	/* Keep page content clear of the fixed bar (incl. iOS safe area). */
	body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
	body.rx-sheet-open { overflow: hidden; }

	/* ---- Bottom sheet (Client / IB chooser) ---- */
	.rx-sheet {
		display: block;
		position: fixed;
		inset: 0;
		z-index: var(--rx-z-modal, 1000);
		visibility: hidden;
	}
	.rx-sheet.is-open { visibility: visible; }

	.rx-sheet__backdrop {
		position: absolute;
		inset: 0;
		background: rgba(5, 8, 18, 0.6);
		opacity: 0;
		transition: opacity var(--rx-dur-fast) var(--rx-ease-out);
	}
	.rx-sheet.is-open .rx-sheet__backdrop { opacity: 1; }

	.rx-sheet__panel {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		padding: 0.75rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
		background: rgba(14, 18, 36, 0.98);
		backdrop-filter: blur(22px);
		-webkit-backdrop-filter: blur(22px);
		border-top: 1px solid rgba(255, 255, 255, 0.1);
		border-radius: 22px 22px 0 0;
		box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.5);
		transform: translateY(100%);
		transition: transform var(--rx-dur-base) var(--rx-ease-out);
	}
	.rx-sheet.is-open .rx-sheet__panel { transform: translateY(0); }

	.rx-sheet__grip {
		display: block;
		width: 40px;
		height: 4px;
		margin: 0.2rem auto 0.9rem;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.22);
	}
	.rx-sheet__title {
		margin: 0 0 0.9rem;
		padding: 0 0.2rem;
		font-size: 1.05rem;
		font-weight: 600;
		color: #fff;
	}
	.rx-sheet__options { display: flex; flex-direction: column; gap: 0.6rem; }

	.rx-sheet__opt {
		display: flex;
		flex-direction: column;
		gap: 0.15rem;
		position: relative;
		padding: 0.95rem 2.6rem 0.95rem 1.1rem;
		border-radius: 14px;
		background: rgba(255, 255, 255, 0.05);
		border: 1px solid rgba(255, 255, 255, 0.1);
		text-decoration: none;
	}
	.rx-sheet__opt:active { background: rgba(255, 255, 255, 0.1); }
	.rx-sheet__opt-label { color: #fff; font-size: 1rem; font-weight: 600; }
	.rx-sheet__opt-sub { color: rgba(255, 255, 255, 0.55); font-size: 0.82rem; }
	.rx-sheet__opt-arrow {
		position: absolute;
		right: 1rem;
		top: 50%;
		transform: translateY(-50%);
		width: 18px;
		height: 18px;
		color: rgba(255, 255, 255, 0.5);
	}

	.rx-sheet .rx-sheet__cancel {
		width: 100%;
		margin-top: 0.9rem;
		padding: 0.9rem;
		border-radius: 14px;
		background: rgba(255, 255, 255, 0.04);
		border: 1px solid rgba(255, 255, 255, 0.1);
		color: rgba(255, 255, 255, 0.8);
		font-size: 0.95rem;
		font-weight: 600;
		cursor: pointer;
	}
	.rx-sheet .rx-sheet__cancel:active { background: rgba(255, 255, 255, 0.09); }
}
