/* Два шаблона:
 * 1) .catalog-drop--primary — обычная шапка (L1 слева + сетка L2/L3 справа)
 * 2) .catalog-drop--mega — is-compact, наработки catalog-menu.html
 */

.catalog-menu--dual {
	position: relative;
	z-index: 40;
}

.catalog-drop {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .18s ease, visibility .18s;
}

.catalog-drop--mega {
	display: none;
}

header.is-compact .catalog-menu--dual {
	position: static;
}

header.is-compact .catalog-drop--primary {
	display: none !important;
}

header.is-compact .catalog-drop--mega {
	display: block;
}

/* Открытие через .is-open (JS) — надёжнее, чем один :hover с pointer-events:none */
.catalog-menu--dual.is-open .catalog-drop--primary,
.catalog-menu--dual:hover .catalog-drop--primary,
.catalog-menu--dual:focus-within .catalog-drop--primary {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

header.is-compact .catalog-menu--dual.is-open .catalog-drop--mega,
header.is-compact .catalog-menu--dual:hover .catalog-drop--mega,
header.is-compact .catalog-menu--dual:focus-within .catalog-drop--mega {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* ---------- 1) Primary: L1 + правая сетка ---------- */
.catalog-drop--primary {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 60;
	padding-top: 12px;
	background: transparent;
}

.catalog-drop__v-inner {
	display: flex;
	align-items: stretch;
	width: min(920px, calc(100vw - 32px));
	height: min(78vh, 640px);
	background: #fff;
	border: 1px solid #e5eef1;
	border-radius: 16px;
	box-shadow: 0 18px 44px rgba(16, 35, 43, .16);
	overflow: hidden;
}

.catalog-drop__nav {
	display: flex;
	flex-direction: column;
	flex: 0 0 260px;
	width: 260px;
	min-height: 0;
	background: var(--gray);
	border-right: 1px solid #eef3f5;
}

.catalog-drop__list {
	flex: 1 1 0;
	min-height: 0;
	margin: 0 !important;
	padding: 8px 0 !important;
	list-style: none !important;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
}

.catalog-drop__list > li,
.catalog-drop__grand > li,
.catalog-menu--dual ul > li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.catalog-drop__list > li:before,
.catalog-drop__list > li::before,
.catalog-drop__grand > li:before,
.catalog-drop__grand > li::before,
.catalog-menu--dual ul > li:before,
.catalog-menu--dual ul > li::before {
	content: none !important;
	display: none !important;
	margin: 0 !important;
}

.catalog-drop__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	color: var(--ink, #10232b);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	background: transparent !important;
	min-height: 0;
	border-radius: 0;
}

.catalog-drop__item:hover > .catalog-drop__link,
.catalog-drop__item.is-active > .catalog-drop__link {
	background: #fff !important;
	color: var(--blue-2, #008db0);
}

.catalog-drop__arrow {
	flex: 0 0 auto;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid #9aa8b0;
	border-bottom: 1.5px solid #9aa8b0;
	transform: rotate(-45deg);
	opacity: .7;
}

.catalog-drop__all {
	flex: 0 0 auto;
	display: block;
	margin: 8px 10px 10px;
	padding: 11px 12px;
	border-radius: 12px;
	background: var(--blue, #00a8d0);
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.catalog-drop__all:hover {
	background: var(--blue-2, #008db0);
	color: #fff !important;
}

.catalog-drop__side {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	overflow: auto;
	padding: 16px 18px 18px;
	background: #fff;
	scrollbar-gutter: stable;
}

.catalog-drop__pane {
	min-height: 100%;
}

.catalog-drop__pane[hidden] {
	display: none !important;
}

.catalog-drop__pane-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5eef1;
}

.catalog-drop__pane-title {
	font-size: 16px;
	font-weight: 800;
	color: var(--ink, #10232b);
	text-decoration: none;
	line-height: 1.25;
	background: transparent !important;
	min-height: 0;
}

.catalog-drop__pane-title:hover {
	color: var(--blue-2, #008db0);
}

.catalog-drop__pane-more {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 700;
	color: var(--blue-2, #008db0);
	text-decoration: none;
	white-space: nowrap;
	background: transparent !important;
	min-height: 0;
}

.catalog-drop__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px 18px;
}

.catalog-drop__col {
	position: relative;
	padding: 6px 28px 6px 0;
}

.catalog-drop__col-title {
	display: block;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--muted, #5a6b73);
	text-decoration: none;
	background: transparent !important;
	min-height: 0;
}

.catalog-drop__col-title:hover {
	color: var(--blue-2, #008db0);
}

.catalog-drop__toggle {
	position: absolute;
	top: 4px;
	right: 0;
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
	padding: 0;
}

.catalog-drop__toggle span,
.catalog-drop__toggle span:before {
	display: block;
	width: 10px;
	height: 2px;
	margin: 0 auto;
	background: #6b7280;
	border-radius: 2px;
	position: relative;
}

.catalog-drop__toggle span:before {
	content: "";
	position: absolute;
	inset: 0;
	transform: rotate(90deg);
}

.catalog-drop__col.is-open > .catalog-drop__toggle span:before {
	opacity: 0;
}

.catalog-drop__grand {
	margin: 6px 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.catalog-drop__grand[hidden] {
	display: none !important;
}

.catalog-drop__grand a {
	display: block;
	padding: 3px 0;
	font-size: 13px;
	font-weight: 500;
	color: var(--muted, #5a6b73);
	text-decoration: none;
	background: transparent !important;
	min-height: 0;
}

.catalog-drop__grand a:hover {
	color: var(--blue-2, #008db0);
}

.catalog-drop__empty {
	margin: 16px 0 0;
	color: var(--muted, #5a6b73);
	font-size: 14px;
}

/* ---------- 2) Mega (is-compact) — наработки ---------- */
.catalog-drop--mega {
	position: absolute;
	/* сразу под строкой compact-шапки; padding = мост наведения */
	top: 44px;
	left: 0;
	right: 0;
	z-index: 60;
	padding-top: 12px;
	background: transparent;
}

.catalog-col {
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 8px 10px 10px;
	border-radius: 16px;
	background: linear-gradient(180deg, #f8fbfc 0%, #fff 70%);
	border: 1px solid #eef3f5;
}

.catalog-col .cat-title {
	flex: 0 0 auto;
}

.catalog-col__body {
	flex: 0 1 auto;
	min-height: 0;
}

.catalog-col__footer {
	flex: 0 0 auto;
	margin-top: 14px;
	padding-top: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.catalog-col .more-sub--expand,
.catalog-col .more-sub--section,
.catalog-col > a.more-sub {
	flex: 0 0 auto;
}

.catalog-drop__mega-inner {
	max-height: min(78vh, 620px);
	overflow: auto;
	background: #fff;
	border: 1px solid #e5eef1;
	border-radius: 24px;
	box-shadow: 0 24px 56px rgba(16, 35, 43, .18);
	padding: 16px 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.catalog-mega {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: start;
	gap: 8px 12px;
}

/* Высоту при раскрытии задаёт JS (= высота 6 пунктов), CSS только включает скролл */
.catalog-col.is-expanded .catalog-col__body {
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
	padding-right: 6px;
	margin-bottom: 0;
}

.catalog-col__extra[hidden],
.catalog-col .more-sub[hidden] {
	display: none !important;
}

.catalog-col .cat-title {
	display: block;
	margin: 0 0 3px;
	padding: 0 0 10px;
	border-bottom: 1px solid #e5eef1;
	font-size: 13px;
	font-weight: 800;
	color: var(--ink, #10232b);
	text-decoration: none;
	line-height: 1.25;
	background: transparent !important;
	min-height: 0;
}

.catalog-col .cat-title:hover {
	color: var(--blue-2, #008db0);
}

.catalog-col a.sub {
	display: block;
	padding: 1px 0;
	min-height: 0;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--muted, #5a6b73);
	text-decoration: none;
	background: transparent !important;
}

.catalog-col a.sub:hover {
	color: var(--blue-2, #008db0);
}

.catalog-col a.more-sub,
.catalog-col button.more-sub {
	display: inline-flex;
	align-items: center;
	margin-top: 0;
	padding: 0;
	border: 0;
	min-height: 0;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--blue, #00a8d0);
	text-decoration: none;
	background: transparent;
	cursor: pointer;
}

.catalog-col a.more-sub:hover,
.catalog-col button.more-sub:hover {
	color: var(--blue-2, #008db0);
}

.catalog-drop--mega .catalog-all {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 16px;
	border-radius: 14px;
	background: #10232b;
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
}

.catalog-drop--mega .catalog-all:hover {
	background: var(--blue, #00a8d0);
	color: #fff !important;
}

@media (max-width: 1100px) {
	.catalog-mega {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.catalog-drop__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.catalog-mega {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.catalog-drop__v-inner {
		width: min(94vw, 640px);
	}

	.catalog-drop__nav {
		flex-basis: 42%;
		width: auto;
	}
}
