/**
 * Стили: боковое меню (сайдбар)
 *
 * @package medexpress-by-fin-code
 */

.me-sidebar {
	position: fixed;
	left: 0;
	top: 0;
	width: var(--sidebar-width);
	height: 100vh;
	background: var(--menu-background-color);
	z-index: 1000;
	overflow-y: auto;
	padding: 32px 0;
	display: flex;
	flex-direction: column;
}

.me-sidebar>* {
	padding-left: var(--sidebar-side-padding);
	padding-right: var(--sidebar-side-padding);
}

.me-sidebar-nav {
	flex: 1;
}

.me-sidebar .me-btn {
	padding-left: 8px;
	padding-right: 8px;
}

.me-sidebar__logo-wrapper {
	align-self: flex-start;
}

.me-sidebar__logo {
	display: flex;
	margin-bottom: 7px;
}

/* menu list */

.me-sidebar__menu-lists {
	display: flex;
	flex-direction: column;
	padding: 0;
}

.me-sidebar__menu-list {
	list-style: none;
	padding: 24px 0;
	margin: 0;
	position: relative;
	border-bottom: 1px solid var(--gray-border-color);
}

.me-sidebar__menu-item {
	padding: 9px var(--sidebar-side-padding);
}

.me-sidebar__menu-item:hover {
	background: #eff2f8;
	color: var(--primary-color);
}

.me-sidebar__menu-item--has-submenu::after {
	position: absolute;
	right: var(--sidebar-side-padding);
	top: 50%;
	transform: translateY(-50%);
	content: '';
	width: 6.5px;
	height: 100%;
	background-image: url('data:image/svg+xml;utf8,<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.847656 0.848633L4.84766 4.84863L0.847656 8.84863" stroke="black" stroke-width="1.2" stroke-linecap="square" /></svg>');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
}

.me-sidebar__menu-link {
	display: flex;
	color: var(--font-color);
	text-decoration: none;
	font-weight: 400;
	font-size: 16px;
}

.me-sidebar__menu-link:hover {
	text-decoration: none;
}

/* submenu */

.me-sidebar__submenu-list {
	position: fixed;
	top: 0;
	bottom: 0;
	left: var(--sidebar-width);
	width: 450px;
	background-color: #e3e8f3;
	margin: 0;
	padding: 40px;
	display: flex;
	flex-direction: column;
	gap: 11px;
	transition: opacity 0.4s ease, visibility 0.4s ease;
	opacity: 0;
	visibility: hidden;
}

.me-sidebar__menu-item--has-submenu {
	position: relative;
}

.me-sidebar__submenu-list:hover,
.me-sidebar__menu-item--has-submenu:hover .me-sidebar__submenu-list {
	opacity: 1 !important;
	visibility: visible !important;
}

/* footer */

.me-sidebar__menu-footer {
	padding-top: 28px;
	padding-bottom: 28px;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

/* toggle */

.me-sidebar__overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 999;
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* ============================================
   Мобильный хедер и полноэкранное меню
   ============================================ */

.me-mobile-header {
	display: none;
	align-items: center;
	flex-wrap: wrap;
	justify-content: space-between;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1002;
	height: var(--mobile-header-height);
	padding: 0 var(--mobile-header-side-padding);
	background: var(--menu-background-color);
}

.me-mobile-header {
	display: none;
}

.me-mobile-header>* {
	flex-shrink: 0;
}

.me-mobile-header__logo {
	display: flex;
}

.me-mobile-header__logo img {
	height: 36px;
	width: auto;
}

.me-mobile-header__actions {
	display: flex;
	align-items: center;
	gap: 0;
}

.me-mobile-header__icon img {
	display: flex;
	width: 32px;
	height: 32px;
}

.me-mobile-header__divider {
	width: 1px;
	height: 32px;
	background: var(--gray-border-color);
	flex-shrink: 0;
	margin: 0 16px;
}

.me-mobile-header__burger {
	border: none;
	padding: 0;
	cursor: pointer;
	background: none;
}

.me-mobile-header__close-icon {
	display: none !important;
}

.me-sidebar__toggle.is-open .me-mobile-header__burger-icon {
	display: none;
}

.me-sidebar__toggle.is-open .me-mobile-header__close-icon {
	display: block !important;
}

@media (max-width: 768px) {
	.me-mobile-header {
		display: flex;
	}

	.me-mobile-header--menu-open .me-mobile-header__actions > a,
	.me-mobile-header--menu-open .me-mobile-header__divider {
		display: none;
	}

	/* Полноэкранное меню: по умолчанию скрыто слева */
	.me-sidebar {
		top: var(--mobile-header-height);
		left: -100%;
		width: 100%;
		max-width: 100%;
		height: calc(100vh - var(--mobile-header-height));
		background: #fff;
		padding-top: 0;
		transition: none;
		border-top: solid 1px #D6DDEF;
	}

	.me-sidebar:not(.is-open) {
		left: -100%;
	}

	.me-sidebar.is-open {
		left: 0;
		z-index: 1003;
	}

	.me-sidebar__logo img {
		height: 32px;
		width: auto;
	}

	.me-sidebar__menu-item {
		padding: 12.5px var(--mobile-header-side-padding);
	}

	.me-sidebar__menu-link {
		font-size: 18px;
	}

	.me-sidebar__menu-list {
		padding: 20px 0;
	}

	.me-sidebar__menu-list:last-of-type {
		border-bottom: none;
	}

	.me-sidebar__menu-footer {
		padding: 24px var(--mobile-header-side-padding) 0px;
		flex-grow: 1;
		display: flex;
		justify-content: flex-end;
	}

	.me-sidebar__menu-footer__call-ambulance {
		align-self: center;
		text-align: center;
	}

	.me-sidebar__menu-footer__call-ambulance>div:first-child {
		font-size: 16px !important;
	}

	.me-sidebar__menu-item--has-submenu::after {
		background-image: url('data:image/svg+xml;utf8,<svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.27246 0.424805L6.27246 5.4248L6.69727 5.84863L6.27246 6.27246L1.27246 11.2725L0.848633 11.6973L0 10.8486L0.424805 10.4248L5.00098 5.84863L0.424805 1.27246L0 0.848633L0.848633 0L1.27246 0.424805Z" fill="black" /></svg>');
		right: 30px;
		width: 7px;
		height: 12px;
	}

	.me-sidebar__submenu-list {
		top: var(--mobile-header-height);
		z-index: 10;
		left: var(--mobile-submenu-left-padding);
		background-color: #fff;
		width: calc(100% - var(--mobile-submenu-left-padding));
	}

	.me-sidebar__submenu-list::after {
		position: absolute;
		top: 0;
		bottom: 0;
		right: 100%;
		width: 100%;
		background-color: rgb(142 158 195 / 20%);
		box-shadow: inset -80px 0px 30px -60px rgb(57 66 88 / 10%);
		z-index: -1;
		content: '';
	}
}