/* Activated only on portal pages with the shared page title. */
html.logicfab-sticky-scroll {
	scroll-padding-top: calc(var(--portal-sticky-height, 0px) + 1rem);
}

body.logicfab-sticky-shell > .navbar {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--designer-surface, #fff);
	box-shadow: 0 1px 0 rgba(17, 24, 39, .08);
}

body.logicfab-sticky-shell .designer-page-header {
	position: sticky;
	top: var(--portal-nav-height, 0px);
	z-index: 30;
	padding: .65rem 0;
	background: var(--designer-surface, #fff);
	box-shadow: 0 1px 0 rgba(17, 24, 39, .1);
}

/* Preserve each page's existing sidebar layout and mobile breakpoints. */
body.logicfab-sticky-shell .designer-sidebar,
body.logicfab-sticky-shell .templates-sidebar,
body.logicfab-sticky-shell .order-sidebar,
body.logicfab-sticky-shell .quote-sidebar,
body.logicfab-sticky-shell .approvals-sidebar {
	top: calc(var(--portal-sticky-height, 0px) + 1rem);
}

/* Only Orders has sticky filters. My Templates uses relative positioning;
 * adding a top offset there would move its filters over the table. */
body.logicfab-sticky-shell .orders-main .filters-shell {
	top: calc(var(--portal-sticky-height, 0px) + 1rem);
}

@media (max-width: 991.98px) {
	body.logicfab-sticky-shell > .navbar .navbar-collapse {
		max-height: calc(100vh - 5rem);
		max-height: calc(100dvh - 5rem);
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}

@media (max-width: 640px), (max-height: 480px) {
	body.logicfab-sticky-shell .designer-page-header {
		padding: .45rem 0;
	}
	body.logicfab-sticky-shell .designer-page-title {
		font-size: 1.2rem;
	}
}

@media print {
	html.logicfab-sticky-scroll { scroll-padding-top: 0; }
	body.logicfab-sticky-shell > .navbar,
	body.logicfab-sticky-shell .designer-page-header {
		position: static;
		box-shadow: none;
	}
}
