/* Horizontal menu for phpbb 3.3
----------------------------------------*/
.menu-navbar {
	margin: 10px auto;
	margin-right: 15px;
    margin-left: 15px;
}

/*
 * prosilver forum_fn.js вставляет li.responsive-menu (гамбургер) в некоторые .linklist.
 * Подключение этого файла = горизонтальное меню включено — дубликат в крошках не нужен.
 * Специфичность body#phpbb выше обычных правил responsive.
 */
body#phpbb #nav-breadcrumbs > li.responsive-menu,
body#phpbb #nav-breadcrumbs li.responsive-menu {
	display: none !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	position: absolute !important;
	clip: rect(0, 0, 0, 0) !important;
	pointer-events: none !important;
	border: 0 !important;
}

.menubar, .menubar ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.menubar {
	border-radius: 5px;
	
}

.menubar li {
	float: left;
	list-style: none;
	position: relative;
}

.menubar a,
.menubar .horizontalmenu-item-text {
	font: bold 11px Arial, Helvetica;
	float: left;
	padding: 12px 10px;
	text-decoration: none;
	text-transform: uppercase;
}

.horizontalmenu-item-icon {
	width: 14px;
	height: 14px;
	display: inline-block;
	vertical-align: middle;
	margin-right: 6px;
	margin-top: -1px;
}

.menubar a > i.icon,
.menubar .horizontalmenu-item-text > i.icon {
	display: inline-block;
	vertical-align: middle;
	margin-right: 6px;
	margin-top: -1px;
}

.menubar .horizontalmenu-item-text {
	display: block;
	cursor: pointer;
}

.menubar li > ul {
	background: #fdfdfd;
	border-radius: 3px;
	margin: 20px 0 0 0;
	left: 0;
	top: 39px;
	opacity: 0;
	visibility: hidden;
	position: absolute;
	z-index: 9999;
	-webkit-transition: all .2s ease-in-out;
	-moz-transition: all .2s ease-in-out;
	transition: all .2s ease-in-out;
}

.menubar li:hover > ul {
	opacity: 1;
	visibility: visible;
	margin: 0;
}

.menubar ul li > ul {
	top: 0;
	left: 150px;
	margin: 0 0 0 20px;
	box-shadow: -1px 0 0 rgba(255,255,255,.3);
}

.menubar ul li {
	float: none;
	display: block;
	border: 0;
	padding: 1px 0 0 0;
}

.menubar ul li:last-child {
	box-shadow: none;
}

.menubar ul a {
	padding: 10px;
	width: auto;
	min-width: min-content;
	display: block;
	white-space: nowrap;
	float: none;
	text-transform: none;
}

.menubar ul li:first-child > a {
	border-radius: 3px 3px 0 0;
}

.menubar ul li:first-child > a:after {
	content: '';
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-bottom: 6px solid #fdfdfd;
	left: 7px;
	position: absolute;
	top: -6px;
}

.menubar ul ul li:first-child a:after {
	border-color: transparent #3b3b3b transparent transparent;
	border-style: solid;
	border-width: 6px 6px 6px 0;
	left: -6px;
	margin-top: -6px;
	top: 50%;
}

.menubar ul li:first-child a:hover:after {
	border-bottom-color: #f3f3f3;
}

.menubar ul ul li:first-child a:hover:after {
	border-right-color: #f3f3f3;
	border-bottom-color: transparent;
}

.menubar ul li:last-child > a {
	border-radius: 0 0 3px 3px;
}

/* Responsive menu
----------------------------------------*/
.menubar .dropdown .dropdown-contents {
	box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
	left: 0 !important;
	max-height: none;
	max-width: none !important;
	overflow: visible;
}

.menubar .dropdown li {
	padding: 0;
}

.menubar .dropdown a {
	width: auto;
}

.menubar .dropdown > ul > li:first-child > a:after {
	border-bottom: 0;
}

.menubar .dropdown li > ul {
	background: none;
	border-radius: 0;
	border-width: 0px 0 0 0;
	box-shadow: none;
	left: initial;
	margin: 0;
	position: relative;
	opacity: 1;
	visibility: visible;
}

.menubar .dropdown li:hover > ul {
	margin: 0;
}

.menubar .dropdown li > ul li {
	box-shadow: none;
}

.menubar .dropdown li > ul a {
	padding-left: 10px;
}

.menubar .dropdown li > ul ul a {
	padding-left: 25px;
}

.menubar .dropdown > ul > li > ul li a:after {
	display: none;
}

.menubar .dropdown > ul > li > ul li a:before {
	content: "\2014";
	margin-right: 7px;
	opacity: .2;
}

#menubar #horizontalmenu-tabs {
	margin: 0;
}

#menubar #horizontalmenu-tabs .dropdown {
	top: 27px;
	left: 0;
	margin: 0 !important;
}

#horizontalmenu-tabs .menubar .tab {
	border: none;
	box-shadow: none;
	float: right;
	font-size: 1.1em;
	line-height: 2.2em;
	position: static;
}

#horizontalmenu-tabs .menubar .dropdown li {
	margin: 0;
	text-align: left;
}

#horizontalmenu-tabs .menubar .tab > a {
	background: transparent;
	border-radius: 0;
	border-width: 0;
	box-shadow: none;
	float: none;
	line-height: 20px;
	margin: 5px 15px 5px 10px;
	padding: 3px 0;
}

.responsive-tab .responsive-tab-link:before {
	left: 0;
}

/* Hide responsive "tab" button on desktop */
@media only screen and (min-width: 701px) {
	#horizontalmenu-tabs .responsive-tab {
		display: none !important;
	}
}

@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) {
	#menubar.menu-navbar {
		height: 36px;
	}

	#menubar.menu-navbar #horizontalmenu-tabs {
		height: 36px;
	}

	#horizontalmenu-tabs {
		position: relative;
	}

	/*
	 * Одна видимая кнопка: flex по верху справа. Сбрасываем float у .menubar a — иначе
	 * ссылка «плывёт» и тянет блок вниз.
	 */
	#horizontalmenu-tabs .menubar {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: flex-start;
		align-items: center;
		align-content: center;
		width: 100%;
		height: 36px;
		min-height: 36px;
		overflow: visible;
	}

	#horizontalmenu-tabs .menubar::after {
		content: none;
	}

	#horizontalmenu-tabs .menubar > li {
		float: none !important;
	}

	#horizontalmenu-tabs .menubar > li:not(.responsive-tab):not(.hm-mobile-pinned) {
		display: none !important;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab {
		display: flex !important;
		flex-direction: column;
		flex: 0 0 auto;
		align-items: flex-end;
		align-self: center;
		float: none !important;
		margin: 0 5px 0 0 !important; /* right padding from edge */
		margin-left: auto !important; /* гамбургер справа, Портал/Форум слева рядом */
		position: static; /* dropdown будет относительно #horizontalmenu-tabs */
		z-index: 10050;
	}

	/* Пункты, закреплённые в верхней полосе (Портал/Форум) */
	#horizontalmenu-tabs .menubar > li.hm-mobile-pinned {
		display: flex !important;
		flex: 0 0 auto;
		align-items: center;
		order: 0;
	}

	#horizontalmenu-tabs .menubar > li.hm-mobile-pinned > a,
	#horizontalmenu-tabs .menubar > li.hm-mobile-pinned > .horizontalmenu-item-text {
		float: none !important;
		display: flex !important;
		align-items: center;
		height: 36px;
		min-height: 36px;
		line-height: 36px;
		padding: 0 10px !important;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab {
		order: 10;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab > a.responsive-tab-link {
		float: none !important;
		display: flex !important;
		align-items: center;
		justify-content: center;
		height: 36px;
		min-height: 36px;
		line-height: 36px;
		margin: 0 !important; /* override .tabs/.tab defaults */
		padding: 0 6px !important;
		width: 28px;
		flex: 0 0 auto;
		position: relative;
		top: -4px;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents {
		display: none;
		position: absolute;
		top: 36px;
		right: 0;
		left: 0;
		width: auto;
		max-width: 100%;
		z-index: 10051;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab.dropdown-visible .dropdown-contents {
		display: block;
	}

	/* Mobile dropdown: allow wrapping long titles */
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents a,
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .horizontalmenu-item-text {
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: break-word;
		color: aliceblue;
	}

	/* Мобильный дропдаун: аккордеон для пунктов с подменю */
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .hm-accordion-row {
		display: flex;
		flex-direction: row;
		align-items: stretch;
		width: 100%;
		min-height: 36px;
		cursor: pointer;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .hm-accordion-row .hm-accordion-link {
		flex: 1 1 auto;
		min-width: 0;
		float: none !important;
		display: flex !important;
		align-items: center;
		padding: 10px 8px 10px 10px !important;
		text-align: left;
		text-decoration: none;
		box-sizing: border-box;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .hm-accordion-toggle {
		-webkit-appearance: none;
		appearance: none;
		flex: 0 0 36px;
		width: 36px;
		min-width: 36px;
		margin: 0;
		padding: 0;
		border: 0;
		background: transparent;
		color: aliceblue;
		cursor: pointer;
		display: flex !important;
		align-items: center;
		justify-content: center;
		align-self: stretch;
		box-sizing: border-box;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .hm-accordion-toggle::after {
		content: '\203A';
		font-size: 1.35em;
		line-height: 1;
		display: block;
		transform: rotate(0deg);
		transition: transform 0.2s ease;
		opacity: 0.85;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .hm-dd-has-children.hm-dd-open .hm-accordion-toggle::after {
		transform: rotate(90deg);
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .hm-dd-has-children > .hm-accordion-panel {
		max-height: 0;
		overflow: hidden;
		visibility: hidden;
		margin: 0;
		padding: 0;
		border: 0;
		transition: max-height 0.35s ease, visibility 0.35s ease;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents .hm-dd-has-children.hm-dd-open > .hm-accordion-panel {
		max-height: 100vh;
		visibility: visible;
	}

	/*
	 * Мобильный дропдаун: у .menubar a задан float:left — родительский пункт и <ul> подпунктов
	 * оказываются в одной строке (подменю обтекает float). Сбрасываем float и вкладываем колонкой.
	 */
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents > ul > li {
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents ul li > a,
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents ul li > .horizontalmenu-item-text {
		float: none !important;
		display: block;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents > ul > li > ul {
		clear: both;
		width: 100%;
		box-sizing: border-box;
		flex: 0 0 auto;
	}

	.menu-navbar #horizontalmenu-tabs .menubar {
		border-radius: 5px;
		margin-left: -5px;
		margin-right: -5px;
		width: auto;
	}
	
	.responsive-tab .responsive-tab-link:before {
		content: '';
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		height: .125em;
		width: 14px;
		border-bottom: 0.125em solid transparent;
		border-top: 0.375em double transparent;
	}
	
	/* Mobile dropdown: remove top arrow triangle */
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents ul > li:first-child > a:after {
		content: none !important;
		display: none !important;
	}

	/* Mobile dropdown: horizontal marker before each submenu item */
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents ul ul {
		border-left: 0;
		margin-left: 0px;
		padding-left: 0;
	}

	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents ul ul > li > a:before,
	#horizontalmenu-tabs .menubar > li.responsive-tab .dropdown-contents ul ul > li > .horizontalmenu-item-text:before {
		content: '';
		display: inline-block;
		width: 12px;
		height: 2px;
		background: rgba(255, 255, 255, 0.25);
		margin: 0 8px 0 0;
		vertical-align: middle;
	}

.menubar ul ul li:first-child a:after {
	border-color: transparent #3b3b3b transparent transparent;
	border-style: solid;
	border-width: 6px 6px 6px 0;
	left: -6px;
	margin-top: -6px;
	top: 50%;
}
	
}

/* Fixed menubar
---------------------------------------- */
#menubar.fixed-nav .menubar { 
	z-index: 9; 
	position: fixed; 
	top: 0; 
	width: 100%;
	max-width: 1152px;
	margin: 0 !important;
}

#menubar.fixed-nav {
	height: 36px;
}

@media only screen and (max-width: 1220px), only screen and (max-device-width: 1220px) {
	#menubar.fixed-nav .menubar {
		left: 28px;
		right: 28px;
		width: auto;
	}
}

@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) {
	#menubar.fixed-nav .menubar {
		left: 0;
		right: 0;
	}
}

/* Colours style
---------------------------------------- */

/* Menubar-black
----------------------------------------*/
.menubar-black {
    background-color: var(--color-menu);
    background-image: -moz-linear-gradient(var(--color-menu-g), var(--color-menu));
    background-image: -webkit-linear-gradient(var(--color-menu-g), var(--color-menu));
    background-image: linear-gradient(var(--color-menu-g), var(--color-menu));
    box-shadow: 0 1px 1px var(--color-menu-gh), 0 1px 0 var(--color-menu-gh) inset;
}

.menubar-black li {
	border-right: 1px solid var(--color-menu-gbl);
	box-shadow: 1px 0 0 var(--color-menu-g);
}

.menubar-black a,
.menubar-black .horizontalmenu-item-text {
	color: aliceblue;
	text-shadow: 0 1px 0 #000;
}

.menubar-black li:hover > a {
	color: var(--main-color2);
}

.menubar-black li:hover > .horizontalmenu-item-text {
	color: var(--main-color2);
}

.menubar-black li > ul {
	background: #444;
	background: -moz-linear-gradient(#444, #666);
	background: -webkit-linear-gradient(#444, #666);
	background: linear-gradient(#444, #666);
	box-shadow: 0 -1px 0 rgba(255,255,255,.3);
}

.menubar-black ul li {
	box-shadow: 0 1px 0 #111, 0 2px 0 #666;
}

.menubar-black ul a:hover {  
	background-color: #0186ba;  
	background-image: -moz-linear-gradient(#acca24, #6f8314);  
	background-image: -webkit-linear-gradient(#acca24, #6f8314);  
	background-image: linear-gradient(#acca24, #6f8314);  
}

.menubar-black ul li:first-child a:after {
	border-bottom-color: #444;
}

.menubar-black ul li:first-child a:hover:after {
	border-bottom-color: #acca24;
}

.menubar-black ul ul li:first-child a:hover:after {
	border-right-color: #acca24;
	border-bottom-color: transparent;
}

/* Responsive menu - menubar-black */
.menubar-black .dropdown .dropdown-contents {
	background-color: #111;
	background-image: -moz-linear-gradient(#444, #111);
	background-image: -webkit-linear-gradient(#444, #111);
	background-image: linear-gradient(#444, #111);
	border-color: #111;
	box-shadow: 0 -1px 0 rgba(255,255,255,.3);
	padding: 0;
}

.menubar-black .dropdown .pointer {
	border-color: #111 transparent;
}

.menubar-black .dropdown .pointer-inner {
	border-color: #444 transparent;
}

.menubar-black .responsive-tab .responsive-tab-link:before {
	border-color: #fff;
}

.menubar-black .responsive-tab .responsive-tab-link:hover:before,
.menubar-black .responsive-tab.dropdown-visible .responsive-tab-link:before {
	border-color: #FFF;
}

.menubar-black .dropdown ul ul li:first-child a:after {
	border-left-color: #3b3b3b;
}

.menubar-black .dropdown > ul > li > ul li:first-child a:hover:after {
	border-left-color: #acca24;
}

/* Menubar-pro
----------------------------------------*/
.menubar-pro {
	background-color: #ECF1F3;
}

.menubar-pro li {
	border-right: 1px solid #D3E0EB;
}

.menubar-pro a {
	color: #28313F;
	text-shadow: 0 0 0 #ECF1F3;
}

.menubar-pro li:hover > a {
	color: #000;
}

.menubar-pro li > ul {
	background-color: #D2E0EB;
}

.menubar-pro li ul, .menubar-pro ul li > ul {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.menubar-pro ul li {
	box-shadow: 0 1px 0 #FFFFFF;
}

.menubar-pro ul li:first-child > a:after {
	border-bottom: 6px solid #D2E0EB;
}

.menubar-pro ul ul li:first-child a:after {
	border-right-color: #D2E0EB;
}

.menubar-pro ul li:first-child a:hover:after {
	border-bottom-color: #F6F4D0;
}

.menubar-pro ul ul li:first-child a:hover:after {
	border-right-color: #F6F4D0;
}

.menubar-pro .dropdown  ul ul li:first-child a:after {
	border-left-color: #D2E0EB;
}

.menubar-pro .dropdown > ul > li > ul li:first-child a:hover:after {
	border-left-color: #F6F4D0;
}

.menubar-pro ul a:hover {
	background-color: #F6F4D0;
}

/* Responsive menu - menubar-pro */
.menubar-pro .dropdown .dropdown-contents {
	background-color: #CADCEB;
	border-color: #CADCEB;
	padding: 0;
}

.menubar-pro .dropdown .pointer,
.menubar-pro .dropdown .pointer-inner {
	border-color: #CADCEB transparent;
}

.menubar-pro .responsive-tab .responsive-tab-link:before {
	border-color: #28313F;
}

.menubar-pro .responsive-tab .responsive-tab-link:hover:before {
	border-color: #000;
}

/* menubar-pro2
----------------------------------------*/
.menubar-pro2 {
	background-color: var(--main-color1);
    background-image: linear-gradient(to bottom, #2b5b84 0%, #2b5b84 2px, #0076B1 92px, #2b5b84 100%);
    background-image: -webkit-linear-gradient(top, #2b5b84 0%, #2b5b84 2px, #0076B1 92px, #2b5b84 100%);
}

.menubar-pro2 li {
	border-right: 1px solid #D3E0EB;
}

.menubar-pro2 a {
	color: #FFF;
}

.menubar-pro2 ul a {
	color: #28313F;
}

.menubar-pro2 li:hover > a {
	color: #A8D8FF;
}

.menubar-pro2 li > ul {
	background-color: #F1F8FF;
	background-image: -moz-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
	background-image: -webkit-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
	background-image: linear-gradient(to bottom, #F1F8FF 0%, #CADCEB 100%);
	border: 1px solid #B9B9B9;
}

.menubar-pro2 li ul, .menubar-pro2 ul li > ul {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.menubar-pro2 ul li {
	box-shadow: 0 1px 0 #B9B9B9, 0 2px 0 #FFFFFF;
}

.menubar-pro2 ul li:first-child > a:after {
	border-bottom: 6px solid #F1F8FF;
}

.menubar-pro2 ul ul li:first-child a:after {
	border-right-color: #F1F8FF;
}

.menubar-pro2 ul li:first-child a:hover:after {
	border-bottom-color: #CFE1F6;
}

.menubar-pro2 ul ul li:first-child a:hover:after {
	border-right-color: #CFE1F6;
}

.menubar-pro2 .dropdown  ul ul li:first-child a:after {
	border-left-color: #F1F8FF;
}

.menubar-pro2 .dropdown > ul > li > ul li:first-child a:hover:after {
	border-left-color: #CFE1F6;
}

.menubar-pro2 ul a:hover {
	background-color: #CFE1F6;
	color: #000;
}

/* Responsive menu - menubar-pro2 */
.menubar-pro2 .dropdown .dropdown-contents {
	background-color: #F1F8FF;
	background-image: -moz-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
	background-image: -webkit-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
	background-image: linear-gradient(to bottom, #F1F8FF 0%, #CADCEB 100%);
	padding: 0;
}

.menubar-pro2 .dropdown .pointer-inner {
	border-color: #F1F8FF transparent;
}

.menubar-pro2 .responsive-tab .responsive-tab-link:before {
	border-color: #FFFFFF;
}

.menubar-pro2 .responsive-tab .responsive-tab-link:hover:before,
.menubar-pro2 .responsive-tab.dropdown-visible .responsive-tab-link:before {
	border-color: #A8D8FF;
}