/**
 * Sticky Sub-nav widget — structural styles.
 *
 * Stickiness is handled by Elementor's Motion Effects on the container, not here.
 *
 * Colours, typography, spacing and the design defaults are output per-instance by
 * the Elementor Style controls. This file only carries layout, positioning,
 * transitions, focus states and behaviour-driven rules (progress bar, responsive
 * label hide, horizontal pill scroll).
 *
 * Independent of the theme's Vite build — edit this file directly, no compile step.
 */

/**
 * Make the bar span the full container width even when Elementor sizes the widget
 * as a shrink-to-fit flex item (otherwise the full-bleed background/border clamps to
 * the inner max-width). The container itself must be Content Width = Full for this to
 * reach the viewport edges.
 */
.elementor-widget-app_sticky_subnav {
	width: 100%;
}

.elementor-widget-app_sticky_subnav .elementor-widget-container {
	width: 100%;
}

.app-subnav {
	position: relative;
	width: 100%;
	--app-subnav-progress-from: #00e8bb;
	--app-subnav-progress-to: #2a4184;
}

.app-subnav__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	width: 100%;
	margin-inline: auto;
	box-sizing: border-box;
}

.app-subnav__label {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Middle region — pill row. Scrolls horizontally rather than wrapping. */
.app-subnav__nav {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	justify-content: center;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.app-subnav__nav::-webkit-scrollbar {
	display: none;
}

.app-subnav__menu {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.app-subnav__item {
	flex: 0 0 auto;
	margin: 0;
}

.app-subnav__pill {
	display: inline-block;
	white-space: nowrap;
	text-decoration: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: color 0.16s ease, background-color 0.16s ease;
}

.app-subnav__cta {
	flex: 0 0 auto;
	display: inline-block;
	white-space: nowrap;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

/* Keyboard focus — visible ring on links and the button. */
.app-subnav__pill:focus-visible,
.app-subnav__cta:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Scroll-progress indicator along the bottom edge. */
.app-subnav__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: transparent;
	pointer-events: none;
}

.app-subnav__progress-bar {
	display: block;
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, var(--app-subnav-progress-from), var(--app-subnav-progress-to));
}

/**
 * Mobile sticky footer — holds the CTA button on small screens. Hidden by default
 * (desktop and until scrolled past the hero). The script moves this element to
 * <body> so a transformed sticky ancestor can't trap its position:fixed, then
 * mirrors the bar's background/blur and the button's styling onto it (those can't
 * reach it via the widget-scoped controls once it's out of the wrapper). Layout,
 * the top border and the reveal animation live here.
 */
.app-subnav__footer {
	display: none;
}

/* Responsive label hide — driven by the Style control's prefix_class. */
@media (max-width: 1024px) {
	.app-subnav--hide-label-tablet .app-subnav__label {
		display: none;
	}
}

@media (max-width: 767px) {
	.app-subnav--hide-label-mobile .app-subnav__label {
		display: none;
	}

	/* Give the pill row the full width so it can scroll from the start. */
	.app-subnav__nav {
		justify-content: flex-start;
	}

	/* When the mobile footer is active, drop the button from the bar itself. */
	.app-subnav--mobile-footer .app-subnav__inner .app-subnav__cta {
		display: none;
	}

	/*
	 * "Hide button at its target" — mobile only. Fades the in-bar button out once its
	 * target section is reached (via visibility, so the bar doesn't reflow). On desktop
	 * the button never hides. When the mobile footer is on, the footer button is instead
	 * hidden via the footer's is-visible state.
	 */
	.app-subnav--cta-hidden .app-subnav__inner .app-subnav__cta {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}

	/* Footer lives at <body> level (moved by the script), so target it directly. */
	.app-subnav__footer {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 12px 20px;
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid rgba(13, 19, 41, 0.09);
		transform: translateY(110%);
		opacity: 0;
		pointer-events: none;
		transition: transform 0.28s ease, opacity 0.28s ease;
	}

	.app-subnav__footer.is-visible {
		transform: none;
		opacity: 1;
		pointer-events: auto;
	}

	.app-subnav__footer .app-subnav__cta {
		display: block;
		width: 100%;
		max-width: 420px;
		text-align: center;
	}
}
