/* Mobile shortcut to the existing map-panel close action. */
#scheme-mobile-map-action {
	display: none;
}

@media only screen and (max-width: 767px) {
	#scheme-mobile-map-action:not([hidden]) {
		position: fixed;
		z-index: 10;
		left: var(--scheme-action-left, 50%);
		bottom: calc(12px + var(--scheme-keyboard-inset, 0px) + var(--scheme-safe-bottom, env(safe-area-inset-bottom, 0px)));
		transform: translateX(-50%);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		min-width: 232px;
		max-width: calc(100% - 32px);
		min-height: 48px;
		box-sizing: border-box;
		padding: 12px 18px;
		border: 0;
		border-radius: 12px;
		background: #00999a;
		color: #fff;
		font-family: Montserrat, Arial, sans-serif;
		font-size: 15px;
		font-weight: 600;
		line-height: 24px;
		text-align: center;
		white-space: nowrap;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		box-shadow: 0 6px 20px rgba(0, 99, 100, 0.28);
		animation: scheme-map-action-in 180ms ease-out;
	}

	#scheme-mobile-map-action svg {
		flex: 0 0 22px;
	}

	#scheme-mobile-map-action:hover,
	#scheme-mobile-map-action:active {
		background: #007a7a;
		color: #fff;
	}

	#scheme-mobile-map-action:focus-visible {
		outline: 3px solid #005e5f;
		outline-offset: 3px;
	}

	.navigation-baltija.has-mobile-map-action .bx_sitemap_ul {
		box-sizing: border-box;
		padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
		scroll-padding-bottom: 80px;
	}
}

@keyframes scheme-map-action-in {
	from {
		opacity: 0;
		transform: translate(-50%, 8px);
	}
	to {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	#scheme-mobile-map-action:not([hidden]) {
		animation: none;
	}
}

/* Fit the open panel to the visible area above the on-screen keyboard. */
@media only screen and (max-width: 767px) {
	html body .navigation-baltija.active[data-scheme-viewport] {
		position: fixed;
		top: var(--scheme-panel-top);
		bottom: auto;
		height: var(--scheme-panel-height);
		max-height: var(--scheme-panel-height);
		overflow: hidden;
	}

	html body .navigation-baltija.active[data-scheme-viewport] > .catalog-block {
		display: flex;
		flex-direction: column;
		height: 100%;
		max-width: none;
		box-sizing: border-box;
		padding-bottom: 8px;
		border-radius: 10px;
		background: #595471;
	}

	html body .navigation-baltija.active[data-scheme-viewport].has-mobile-map-action > .catalog-block {
		padding-bottom: calc(72px + var(--scheme-safe-bottom, env(safe-area-inset-bottom, 0px)));
	}

	.navigation-baltija.active[data-scheme-viewport] .catalog-block-mobile,
	.navigation-baltija.active[data-scheme-viewport] .search-block-baltija {
		flex: 0 0 auto;
	}

	html body .navigation-baltija.active[data-scheme-viewport] .search-block-baltija {
		padding: 8px;
		margin-bottom: 14px;
	}

	.navigation-baltija.active[data-scheme-viewport] .catalog-block > .js-main-tree,
	.navigation-baltija.active[data-scheme-viewport] .catalog-block > .js-scheme-result {
		flex: 1 1 0%;
		min-height: 0;
		margin: 0 8px;
		overflow: hidden;
	}

	.navigation-baltija.active[data-scheme-viewport] .js-main-tree .bx_sitemap,
	.navigation-baltija.active[data-scheme-viewport] .js-scheme-result .bx_sitemap {
		height: 100%;
		max-height: 100%;
		min-height: 0;
		padding-top: 0;
		padding-bottom: 0;
	}

	html body .navigation-baltija.active[data-scheme-viewport] .bx_sitemap > ul.bx_sitemap_ul {
		height: 100%;
		max-height: 100%;
		box-sizing: border-box;
		margin-top: 0;
		margin-bottom: 0;
		padding-bottom: 16px;
		scroll-padding-bottom: 16px;
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}
