/**
 * Mobile Menu - Стилизованная версия
 * В соответствии со стилистикой темы Blog Content
 */

/* Скрыть иконки подменю на десктопе */
@media (min-width: 992px) {
	.main-navigation .submenu-toggle {
		display: none !important;
	}
}

@media (max-width: 991px) {
	
	/* Кнопка гамбургера */
	.menu-toggle {
		display: flex !important;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 5px;
		width: 44px;
		height: 44px;
		background: #007bff;
		border: none;
		border-radius: 4px;
		cursor: pointer;
		position: relative;
		z-index: 99999;
		transition: all 0.3s ease;
		box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
		padding: 0;
	}
	
	.menu-toggle:hover {
		background: #0056b3;
		box-shadow: 0 4px 12px rgba(0, 123, 255, 0.35);
		transform: translateY(-1px);
	}
	
	.menu-toggle:active {
		transform: translateY(0);
		box-shadow: 0 1px 4px rgba(0, 123, 255, 0.2);
	}

	.menu-toggle span {
		display: block;
		width: 24px;
		height: 3px;
		background: #fff;
		margin: 0;
		transition: all 0.3s ease;
		border-radius: 2px;
	}

	.menu-toggle.open span:nth-child(1) {
		transform: translateY(8px) rotate(45deg);
	}

	.menu-toggle.open span:nth-child(2) {
		opacity: 0;
		transform: translateX(-10px);
	}

	.menu-toggle.open span:nth-child(3) {
		transform: translateY(-8px) rotate(-45deg);
	}

	/* Скрыть меню по умолчанию */
	.main-navigation ul {
		display: none;
		position: absolute;
		top: calc(100% + 10px);
		left: 0;
		width: 100%;
		background: #fff;
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
		border-radius: 4px;
		padding: 8px 0;
		margin: 0;
		list-style: none;
		z-index: 9999;
		animation: slideDown 0.3s ease;
	}
	
	@keyframes slideDown {
		from {
			opacity: 0;
			transform: translateY(-10px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	/* Показать меню когда открыто */
	.main-navigation.toggled ul {
		display: block !important;
	}

	/* Пункты с подменю - относительное позиционирование */
	.main-navigation .menu-item-has-children {
		position: relative !important;
	}

	/* Пункты меню */
	.main-navigation li {
		display: block !important;
		width: 100%;
		margin: 0;
		padding: 0;
		list-style: none;
		border-bottom: 1px solid #f0f0f0;
	}

	.main-navigation li:last-child {
		border-bottom: none;
	}

	/* Ссылки меню */
	.main-navigation a {
		display: block !important;
		padding: 16px 20px !important;
		color: #333 !important;
		text-decoration: none !important;
		background: transparent !important;
		border: none !important;
		font-size: 0.938rem !important;
		font-weight: 600 !important;
		font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
		letter-spacing: 0.02em !important;
		text-transform: none !important;
		position: relative !important;
		width: 100% !important;
		box-sizing: border-box !important;
		cursor: pointer !important;
		user-select: none !important;
		-webkit-tap-highlight-color: transparent !important;
		transition: all 0.3s ease !important;
	}

	.main-navigation a:hover,
	.main-navigation a:active,
	.main-navigation a:focus {
		background: #f8f9fa !important;
		color: #007bff !important;
		padding-left: 28px !important;
	}
	
	/* Активный пункт меню */
	.main-navigation .current-menu-item > a,
	.main-navigation .current_page_item > a {
		color: #007bff !important;
		background: #e7f3ff !important;
		font-weight: 700 !important;
	}
	
	/* Улучшаем кликабельность */
	.main-navigation li a {
		pointer-events: auto !important;
		touch-action: manipulation !important;
	}
	
	/* Для элементов с подменю - добавляем отступ справа под кнопку */
	.main-navigation .menu-item-has-children > a {
		padding-right: 56px !important;
	}
	
	.main-navigation .menu-item-has-children > a:hover {
		padding-right: 56px !important;
	}

	/* Подменю - скрыто по умолчанию */
	.main-navigation .sub-menu {
		display: none !important;
		position: static !important;
		background: #f8f9fa !important;
		box-shadow: none !important;
		padding: 4px 0 !important;
		margin: 0 !important;
		width: 100% !important;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
		border-left: 3px solid #007bff !important;
	}

	/* Подменю - открыто */
	.main-navigation .menu-item-has-children.open > .sub-menu,
	.main-navigation .sub-menu.open {
		display: block !important;
		max-height: 1000px !important;
		overflow: visible !important;
	}

	.main-navigation .sub-menu a {
		padding: 12px 20px 12px 36px !important;
		font-size: 0.875rem !important;
		font-weight: 500 !important;
		background: #f8f9fa !important;
		letter-spacing: normal !important;
		text-transform: none !important;
	}

	.main-navigation .sub-menu a:hover {
		background: #e8e8e8 !important;
		padding-left: 44px !important;
		color: #007bff !important;
	}
	
	/* Кнопка-индикатор для подменю (кликабельная кнопка справа) */
	.main-navigation .submenu-toggle {
		position: absolute;
		right: 0;
		top: 0;
		width: 56px;
		height: 100%;
		cursor: pointer;
		z-index: 10;
		display: flex !important;
		align-items: center;
		justify-content: center;
		background: transparent;
		border-left: 1px solid #e0e0e0;
		transition: all 0.2s ease;
	}
	
	.main-navigation .submenu-toggle:hover {
		background: #f8f9fa;
		border-left-color: #007bff;
	}
	
	.main-navigation .submenu-toggle:active {
		background: #e7f3ff;
	}
	
	.main-navigation .submenu-toggle i {
		font-size: 13px;
		color: #007bff;
		transition: transform 0.3s ease;
		pointer-events: none;
	}
	
	.main-navigation .menu-item-has-children.open > a .submenu-toggle {
		background: #e7f3ff;
	}
	
	.main-navigation .menu-item-has-children.open > a .submenu-toggle i {
		transform: rotate(180deg);
		color: #0056b3;
	}

	/* Убрать все desktop стили */
	.main-navigation ul ul {
		opacity: 1 !important;
		visibility: visible !important;
		transform: none !important;
		left: auto !important;
		top: auto !important;
		min-width: auto !important;
	}
	
	/* Убрать desktop индикатор подменю */
	.main-navigation .menu-item-has-children > a::before {
		display: none !important;
	}

	/* Плавная анимация для иконок */
	@keyframes fadeIn {
		from {
			opacity: 0;
		}
		to {
			opacity: 1;
		}
	}
	
	.main-navigation .submenu-toggle {
		animation: fadeIn 0.3s ease;
	}

}
