/* Ex menu v2 — современное меню Pillow (полоса + мега-панель «Категории» + мобильная панель) */
:root { --ex-bg: #1159b6; --ex-z: 900; }

/* ---------- Полоса ---------- */
#ex-menu {
	position: relative;
	background: linear-gradient(180deg, #1668c9 0%, #0f56ad 100%);
	background: linear-gradient(180deg, color-mix(in srgb, var(--ex-bg) 88%, #ffffff 12%) 0%, var(--ex-bg) 100%);
	color: #fff;
	z-index: var(--ex-z);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .10) inset;
}
#ex-menu.ex-menu--sticky { position: sticky; top: 0; transition: box-shadow .2s ease; }
#ex-menu.ex-menu--sticky.is-scrolled { box-shadow: 0 10px 28px rgba(11, 40, 90, .28); }

.ex-menu__inner { width: 100%; max-width: none; margin: 0; padding: 4px 10px; }
.ex-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;          /* без overflow — иначе выпадашки обрезаются */
	align-items: center;
	justify-content: center;  /* если пунктов мало — центрируем по всей ширине экрана */
	overflow: visible;
}
.ex-menu__item { display: flex; align-items: center; }

.ex-menu__link {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 4px 2px;
	padding: 9px 16px;
	border-radius: 9px;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s ease, box-shadow .15s ease;
}
.ex-menu__link:hover,
.ex-menu__link:focus {
	background: rgba(255, 255, 255, .16);
	color: #fff;
	text-decoration: none;
}
.ex-menu__link.is-current {
	background: rgba(255, 255, 255, .20);
	box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .65);
}

/* Кнопка «Категории» — отдельный блок с иконкой */
.ex-menu__link--cats {
	background: rgba(4, 34, 78, .42);
	font-weight: 700;
	gap: 9px;
}
.ex-menu__link--cats:hover,
.ex-menu__link--cats:focus,
.ex-menu__item--cats.is-open .ex-menu__link--cats {
	background: rgba(4, 34, 78, .68);
}
.ex-menu__chev { transition: transform .18s ease; }
.ex-menu__item--cats:hover .ex-menu__chev,
.ex-menu__item--cats.is-open .ex-menu__chev { transform: rotate(180deg); }

.ex-menu__caret {
	display: flex;
	align-items: center;
	padding: 0 8px 0 0;
	margin-left: -6px;
	background: none;
	border: 0;
	color: rgba(255, 255, 255, .75);
	cursor: pointer;
}
.ex-menu__caret svg { transition: transform .18s ease; }
.ex-menu__item:hover .ex-menu__caret svg,
.ex-menu__item.is-open .ex-menu__caret svg { transform: rotate(180deg); }

/* ---------- Выпадающие панели ---------- */
.ex-menu__drop {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	width: auto;
	min-width: 0;
	max-width: none;
	padding: 20px 24px 24px;
	background: #fff;
	border-top: 1px solid #e6ebf2;
	border-bottom: 1px solid #e6ebf2;
	box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .16s ease, transform .16s ease, visibility .16s;
	z-index: calc(var(--ex-z) + 10);
	max-height: calc(100vh - 140px);
	overflow-y: auto;
}
.ex-menu__item.has-drop:hover .ex-menu__drop,
.ex-menu__item.has-drop:focus-within .ex-menu__drop,
.ex-menu__item.is-open .ex-menu__drop {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.ex-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
	justify-content: center;
}
.ex-tile {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e6ebf2;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: #1e293b;
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ex-tile:hover,
.ex-tile:focus {
	border-color: var(--ex-bg);
	box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
	transform: translateY(-2px);
	text-decoration: none;
}
.ex-tile__frame {
	display: block;
	aspect-ratio: 3 / 2;
	background: #f1f5f9;
	overflow: hidden;
}
.ex-tile__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .25s ease;
}
.ex-tile:hover .ex-tile__frame img { transform: scale(1.05); }
.ex-tile__title {
	padding: 10px 10px 12px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}

/* Мега-панель «Категории» — во всю ширину контейнера */
.ex-menu__drop--mega {
	min-width: 0;
	max-width: none;
	width: min(1170px, calc(100vw - 32px));
	padding: 16px 20px 20px;
	border-radius: 0 0 16px 16px;
	max-height: calc(100vh - 130px);
	overflow-y: auto;
}
.ex-mega__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
	gap: 6px 26px;
}
.ex-mega__col { padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid #eef2f7; }
.ex-mega__col:last-child { border-bottom: 0; margin-bottom: 0; }
.ex-mega__col--solo { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.ex-mega__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 12px;
	border-radius: 9px;
	color: #0d3c7d;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	transition: background .12s ease, color .12s ease;
}
.ex-mega__head::after { content: "→"; opacity: 0; transition: opacity .12s ease; color: var(--ex-bg); }
.ex-mega__head:hover,
.ex-mega__head:focus { background: #eef4fd; color: var(--ex-bg); text-decoration: none; }
.ex-mega__head:hover::after,
.ex-mega__head:focus::after { opacity: 1; }
.ex-mega__head--plain { color: #64748b; font-weight: 600; cursor: default; }
.ex-mega__head--plain::after { content: none; }

/* плитки без подпунктов ( solo ) */
.ex-mega__col--solo .ex-mega__head {
	background: #f7fafd;
	border: 1px solid #e7eef6;
	font-size: 15px;
}
.ex-mega__col--solo .ex-mega__head:hover { background: #eef4fd; }

.ex-mega__sub { list-style: none; margin: 4px 0 0; padding: 0; }
.ex-mega__sub a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 7px 12px 7px 14px;
	border-radius: 8px;
	color: #334155;
	font-size: 14px;
	text-decoration: none;
	transition: background .12s ease, color .12s ease, padding-left .12s ease;
}
.ex-mega__sub a::after { content: "→"; opacity: 0; margin-left: 10px; transition: opacity .12s ease; color: var(--ex-bg); }
.ex-mega__sub a:hover,
.ex-mega__sub a:focus { background: #f1f5f9; color: var(--ex-bg); text-decoration: none; padding-left: 18px; }
.ex-mega__sub a:hover::after,
.ex-mega__sub a:focus::after { opacity: 1; }

/* Планшет: полоса переносится (без горизонтального скролла — он обрезал панели) */
@media (max-width: 991px) {
	.ex-menu__link { padding: 8px 13px; font-size: 14.5px; }
	.ex-tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
}

/* Телефоны (<768): полоса скрыта, работает выдвижная панель */
@media (max-width: 767px) {
	#ex-menu { display: none; }
}

/* ---------- Оверлей и мобильная панель ---------- */
.ex-menu-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, .45);
	opacity: 0;
	transition: opacity .25s ease;
	z-index: 1150;
}
.ex-menu-overlay.is-open { opacity: 1; }
body.ex-menu-lock { overflow: hidden; }

.ex-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(88vw, 370px);
	background: #fff;
	transform: translateX(-100%);
	transition: transform .26s cubic-bezier(.4, 0, .2, 1);
	z-index: 1200;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: env(safe-area-inset-bottom, 0);
}
.ex-drawer.is-open { transform: translateX(0); }
.ex-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	background: linear-gradient(180deg, #1668c9, #0f56ad);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 2;
}
.ex-drawer__title { font-size: 17px; font-weight: 700; }
.ex-drawer__close {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .14);
	border: 0;
	border-radius: 10px;
	color: #fff;
	cursor: pointer;
}
.ex-drawer__close:hover { background: rgba(255, 255, 255, .26); }
.ex-drawer__list { list-style: none; margin: 0; padding: 4px 0; flex: 1 0 auto; }
.ex-drawer__list > li { border-bottom: 1px solid #eef2f7; }
.ex-drawer__group-title {
	padding: 15px 18px 7px !important;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .10em;
	text-transform: uppercase;
	color: #94a3b8;
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7 !important;
}
.ex-drawer__row { display: flex; align-items: stretch; }
.ex-drawer__row > a,
.ex-drawer__label {
	flex: 1;
	padding: 14px 18px;
	color: #1e293b;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}
.ex-drawer__label { color: #64748b; font-weight: 700; }
.ex-drawer__row > a:hover { color: var(--ex-bg); }
.ex-drawer__row > a.is-current { color: var(--ex-bg); background: #f1f6fd; }
.ex-drawer__toggle {
	width: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	border-left: 1px solid #eef2f7;
	color: #64748b;
	cursor: pointer;
}
.ex-drawer__toggle svg { transition: transform .18s ease; }
.ex-drawer__list li.is-open .ex-drawer__toggle svg { transform: rotate(180deg); }
.ex-drawer__sub { list-style: none; margin: 0; padding: 0 0 8px; background: #f8fafc; display: none; }
.ex-drawer__list li.is-open .ex-drawer__sub { display: block; }
.ex-drawer__sub a {
	display: block;
	padding: 11px 18px 11px 30px;
	color: #475569;
	font-size: 15px;
	text-decoration: none;
	border-bottom: 1px solid #eef2f7;
}
.ex-drawer__sub a:hover { color: var(--ex-bg); background: #fff; }
.ex-drawer__sub a.is-current { color: var(--ex-bg); font-weight: 600; background: #fff; }
.ex-drawer__lang { display: flex; gap: 10px; padding: 14px 18px 20px; border-top: 1px solid #eef2f7; }
.ex-drawer__lang-pill {
	flex: 1;
	padding: 11px 0;
	border: 1px solid #dbe3ec;
	border-radius: 10px;
	background: #fff;
	color: #475569;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .04em;
	cursor: pointer;
}
.ex-drawer__lang-pill.is-active { background: var(--ex-bg); border-color: var(--ex-bg); color: #fff; }

/* ---------- Скрытие темного меню при активном Ex menu ---------- */
body.ex-menu-active #menu-mobile-ns,
body.ex-menu-active .page-no-scroll-bg { display: none !important; }
body.ex-menu-active .container .sw-80 { width: 100%; }
