/**
 * Современные стили главного меню сайта
 * Версия: 2.0
 */

/* ============================================
   ОСНОВНОЕ МЕНЮ (ДЕСКТОП)
   ============================================ */

/* Контейнер навигации */
.nav-menu {
	display: flex;
	align-items: center;
}

/* Список меню */
.head-menu,
.menu-list {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Пункт меню */
.head-menu > li,
.menu-list > .menu-item {
	position: relative;
}

/* Ссылка меню */
.head-menu > li > a,
.menu-item > a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	color: white;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border-radius: 10px;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	position: relative;
	overflow: hidden;
}

/* Hover эффект - мягкое свечение */
.head-menu > li > a:hover,
.menu-item > a:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: translateY(-1px);
}

/* Ripple эффект при hover */
.head-menu > li > a::before,
.menu-item > a::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	transition: width 0.4s ease, height 0.4s ease;
}

.head-menu > li > a:hover::before,
.menu-item > a:hover::before {
	width: 200px;
	height: 200px;
}

/* Активный пункт */
.head-menu > li.active > a,
.menu-item.active > a {
	background: white;
	color: var(--dark-blue, #07224F);
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transform: translateY(-1px);
}

/* Иконка в меню */
.head-menu > li > a i,
.menu-item > a i {
	font-size: 13px;
	opacity: 0.9;
}

/* ============================================
   ВЫПАДАЮЩЕЕ ПОДМЕНЮ
   ============================================ */

/* Контейнер подменю */
.menu-item.has-children {
	position: relative;
}

/* Индикатор стрелки */
.menu-item.has-children > a::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 6px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform 0.25s ease;
	opacity: 0.7;
}

.menu-item.has-children:hover > a::after {
	transform: rotate(180deg);
	opacity: 1;
}

/* Выпадающий список */
.menu-item.has-children > ul {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 220px;
	background: white;
	border-radius: 12px;
	box-shadow: 
		0 10px 40px rgba(0, 0, 0, 0.15),
		0 0 0 1px rgba(0, 0, 0, 0.05);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 1000;
	list-style: none;
}

/* Показываем подменю при hover */
.menu-item.has-children:hover > ul {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Пункт подменю */
.menu-item.has-children > ul > li {
	padding: 0;
}

/* Ссылка подменю */
.menu-item.has-children > ul > li > a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	color: var(--dark-blue, #07224F);
	font-size: 14px;
	font-weight: 400;
	text-decoration: none;
	transition: all 0.2s ease;
	position: relative;
}

/* Hover для подменю */
.menu-item.has-children > ul > li > a:hover {
	background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
	color: var(--blue, #2258aa);
	padding-left: 20px;
}

/* Активный пункт подменю */
.menu-item.has-children > ul > li.active > a {
	background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, transparent 100%);
	color: var(--blue, #2258aa);
	font-weight: 500;
}

/* Индикатор активного пункта подменю */
.menu-item.has-children > ul > li.active > a::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 60%;
	background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
	border-radius: 0 2px 2px 0;
}

/* ============================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================ */

/* Кнопка бургер */
.burger-menu {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.burger-menu:hover {
	background: rgba(255, 255, 255, 0.2);
}

.burger-menu span {
	display: block;
	width: 100%;
	height: 2px;
	background: white;
	border-radius: 2px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform-origin: center;
}

/* Анимация бургера в крестик */
.burger-menu.active span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.burger-menu.active span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Мобильное меню - скрыто по умолчанию */
@media (max-width: 991px) {
	.burger-menu {
		display: flex;
	}
	
	.nav-menu {
		position: fixed;
		top: 0;
		left: -100%;
		width: 85%;
		max-width: 320px;
		height: 100vh;
		background: linear-gradient(180deg, var(--blue, #2258aa) 0%, var(--dark-blue, #07224F) 100%);
		padding: 0;
		overflow-y: auto;
		transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		z-index: 999;
		box-shadow: 5px 0 30px rgba(0, 0, 0, 0.3);
	}
	
	.nav-menu.active {
		left: 0;
	}
	
	/* Оверлей при открытом меню */
	.nav-menu.active::after {
		content: '';
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: -1;
		opacity: 0;
		animation: fadeIn 0.3s ease forwards;
	}
	
	@keyframes fadeIn {
		to { opacity: 1; }
	}
	
	/* Контейнер списка */
	.head-menu,
	.menu-list {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
		padding: 70px 16px 24px;
	}
	
	/* Пункты меню */
	.head-menu > li,
	.menu-item {
		width: 100%;
		opacity: 0;
		transform: translateX(-20px);
	}
	
	.nav-menu.active .head-menu > li,
	.nav-menu.active .menu-item {
		animation: slideIn 0.4s ease forwards;
	}
	
	.nav-menu.active .head-menu > li:nth-child(1),
	.nav-menu.active .menu-item:nth-child(1) { animation-delay: 0.1s; }
	.nav-menu.active .head-menu > li:nth-child(2),
	.nav-menu.active .menu-item:nth-child(2) { animation-delay: 0.15s; }
	.nav-menu.active .head-menu > li:nth-child(3),
	.nav-menu.active .menu-item:nth-child(3) { animation-delay: 0.2s; }
	.nav-menu.active .head-menu > li:nth-child(4),
	.nav-menu.active .menu-item:nth-child(4) { animation-delay: 0.25s; }
	.nav-menu.active .head-menu > li:nth-child(5),
	.nav-menu.active .menu-item:nth-child(5) { animation-delay: 0.3s; }
	.nav-menu.active .head-menu > li:nth-child(6),
	.nav-menu.active .menu-item:nth-child(6) { animation-delay: 0.35s; }
	
	@keyframes slideIn {
		to {
			opacity: 1;
			transform: translateX(0);
		}
	}
	
	/* Ссылки в мобильном меню - единый стиль для всех */
	.head-menu > li > a,
	.menu-item > a,
	.head-menu .mobile-only a {
		display: flex;
		align-items: center;
		padding: 16px 18px;
		font-size: 16px;
		border-radius: 12px;
		background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
		border: 1px solid rgba(255, 255, 255, 0.2);
		transition: all 0.3s ease;
	}
	
	.head-menu > li > a:hover,
	.menu-item > a:hover,
	.head-menu .mobile-only a:hover {
		background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
		border-color: rgba(255, 255, 255, 0.3);
	}
	
	/* Активный пункт в мобильном */
	.head-menu > li.active > a,
	.menu-item.active > a {
		background: white;
		color: var(--dark-blue, #07224F);
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
		border-color: transparent;
	}
	
	/* Иконки в меню */
	.head-menu > li > a i,
	.menu-item > a i,
	.head-menu .mobile-only a i {
		font-size: 18px;
		width: 24px;
		text-align: center;
		margin-right: 6px;
		color: #ffd700;
	}
	
	/* Подменю в мобильном */
	.menu-item.has-children > ul {
		position: static;
		background: rgba(0, 0, 0, 0.15);
		border-radius: 12px;
		box-shadow: none;
		padding: 8px;
		margin: 6px 0 0 0;
		opacity: 1;
		visibility: visible;
		transform: none;
		display: none;
		border: 1px solid rgba(255, 255, 255, 0.05);
	}
	
	.menu-item.has-children.open > ul {
		display: block;
	}
	
	.menu-item.has-children > ul > li > a {
		padding: 14px 16px;
		color: rgba(255, 255, 255, 0.9);
		font-size: 15px;
		border-radius: 8px;
	}
	
	.menu-item.has-children > ul > li > a:hover {
		background: rgba(255, 255, 255, 0.1);
		color: white;
		padding-left: 20px;
	}
	
	.menu-item.has-children > ul > li.active > a {
		background: rgba(255, 255, 255, 0.2);
		color: white;
	}
	
	/* Стрелка в мобильном */
	.menu-item.has-children > a::after {
		margin-left: auto;
		transition: transform 0.3s ease;
	}
	
	.menu-item.has-children.open > a::after {
		transform: rotate(180deg);
	}
	
	/* Разделитель перед мобильными ссылками */
	.mobile-only {
		margin-top: 8px;
		padding-top: 8px;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
	}
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ
   ============================================ */

/* Элементы только для мобильных */
.mobile-only {
	display: none;
}

@media (max-width: 991px) {
	.mobile-only {
		display: block;
	}
}
	
/* Разделитель в меню */
.menu-divider {
	height: 1px;
	background: rgba(255, 255, 255, 0.1);
	margin: 8px 0;
}

@media (min-width: 992px) {
	.menu-divider {
		display: none;
	}
}

/* Закрыть меню (крестик) */
.menu-close {
	display: none;
	position: absolute;
	top: 20px;
	right: 16px;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.menu-close:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: scale(1.05);
}

.menu-close::before,
.menu-close::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 22px;
	height: 2px;
	background: white;
	border-radius: 2px;
}

.menu-close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.menu-close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 991px) {
	.menu-close {
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

/* ============================================
   АНИМАЦИИ И ЭФФЕКТЫ
   ============================================ */

/* Пульсация для важных пунктов */
@keyframes pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
	50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.menu-highlight {
	animation: pulse 2s infinite;
}

/* Подчёркивание при hover (опционально) */
.menu-underline > li > a::after {
	content: '';
	position: absolute;
	bottom: 8px;
	left: 16px;
	right: 16px;
	height: 2px;
	background: currentColor;
	transform: scaleX(0);
	transition: transform 0.3s ease;
}

.menu-underline > li > a:hover::after {
	transform: scaleX(1);
}

/* ============================================
   ТЕМНАЯ ТЕМА (опционально)
   ============================================ */

.menu-dark .head-menu > li > a,
.menu-dark .menu-item > a {
	color: var(--gray-700, #484f56);
}

.menu-dark .head-menu > li > a:hover,
.menu-dark .menu-item > a:hover {
	background: rgba(0, 0, 0, 0.05);
}

.menu-dark .head-menu > li.active > a,
.menu-dark .menu-item.active > a {
	background: var(--blue, #2258aa);
	color: white;
}

/* ============================================
   ПЕЧАТЬ
   ============================================ */

@media print {
	.nav-menu {
		display: none;
	}
	
	.burger-menu {
		display: none;
	}
}
