/* ==========================================================================
   Мега-меню «Каталог» в шапке (wb-menu.js): слева категории, справа приложения.
   Контейнер — #service-catalog-mega в common/header.twig. Стиль — как у остальных
   секций (стекло, скругления, градиент бренда, Inter).
   ========================================================================== */

/* затемнение страницы под шапкой */
.wbm-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 990; background: rgba(7, 19, 58, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s ease; }
.wbm-backdrop.is-on { opacity: 1; }

/* поднимаем шапку с открытым меню над затемнением */
.service-catalog-menu.is-open { position: relative; z-index: 1000; }

/* сам контейнер: прячем старые стили мега-меню из service-landing.css */
.wbm {
	display: none; position: fixed; left: 50%; top: var(--wbm-top, 84px); z-index: 1001; transform: translateX(-50%);
	width: min(1180px, calc(100vw - 40px)); max-width: none; height: auto; margin: 0; padding: 0; overflow: hidden;
	border: 1px solid rgba(80, 109, 163, .16); border-radius: 26px; text-align: left;
	background: rgba(255, 255, 255, .98); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
	box-shadow: 0 40px 80px -28px rgba(10, 26, 74, .5), 0 4px 14px rgba(10, 26, 74, .08);
}
.wbm.is-open { display: block; animation: wbm-in .38s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes wbm-in { from { opacity: 0; transform: translate(-50%, -10px) scale(.985); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

.wbm *, .wbm *::before, .wbm *::after { box-sizing: border-box; }
.wbm__shell { display: grid; grid-template-columns: 308px minmax(0, 1fr); height: min(600px, calc(100vh - var(--wbm-top, 84px) - 28px)); min-height: 380px; font-family: Inter, sans-serif; }

/* ---------- Левая колонка ---------- */
.wbm__side { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 18px 14px 14px 16px; border-right: 1px solid rgba(80, 109, 163, .12); background: linear-gradient(180deg, #f6f9ff, #fff); }

.wbm__search { position: relative; display: block; margin: 0 2px 4px; }
.wbm__search svg { position: absolute; left: 13px; top: 50%; margin-top: -9px; color: #8a97bd; pointer-events: none; }
.wbm__search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1.5px solid #dbe5fa; border-radius: 14px; outline: 0; background: #fff; color: #0a1a4a; font: 500 14.5px/1 Inter, sans-serif; box-shadow: none; transition: border-color .2s ease, box-shadow .25s ease; }
.wbm__search input::placeholder { color: #8a97bd; }
.wbm__search input:focus { border-color: #0d7bff; box-shadow: 0 0 0 4px rgba(13, 123, 255, .14); }
.wbm__search input::-webkit-search-cancel-button { cursor: pointer; }

.wbm__cats { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0 4px 0 0; list-style: none; overflow-y: auto; scrollbar-width: thin; }
.wbm__cats li { margin: 0 0 2px; padding: 0; list-style: none; }

/* цвета заданы явно для всех состояний — в теме есть глобальное button:hover */
.wbm .wbm__cat { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 9px 12px 9px 9px; border: 0; border-radius: 14px; color: #1c2b52; background: transparent; text-align: left; font: 600 14.5px/1.25 Inter, sans-serif; letter-spacing: -.015em; cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .25s cubic-bezier(.22, 1, .36, 1); }
.wbm .wbm__cat:hover, .wbm .wbm__cat:focus { color: #0a1a4a; background: #eaf2ff; outline: 0; }
.wbm .wbm__cat.is-active { color: #0a1a4a; background: #e3eeff; box-shadow: inset 0 0 0 1px rgba(13, 123, 255, .18); }
.wbm .wbm__cat.is-active::before { content: ''; position: absolute; left: -16px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #0d7bff, #7c5cff); }
.wbm .wbm__cat:focus-visible { box-shadow: 0 0 0 3px rgba(13, 123, 255, .35); }

.wbm__ico { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; color: #0d7bff; background: #eaf2ff; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), background .25s ease, color .25s ease, box-shadow .3s ease; }
.wbm__cat:hover .wbm__ico { background: #dcebff; }
.wbm__cat.is-active .wbm__ico { color: #fff; background: linear-gradient(135deg, #0d7bff, #7c5cff); box-shadow: 0 10px 18px -8px rgba(13, 123, 255, .7); }
.wbm__ico svg { width: 19px; height: 19px; }
.wbm__cat:hover .wbm__ico, .wbm__cat.is-active .wbm__ico { transform: scale(1.08) rotate(-5deg); }
.wbm__cname { flex: 1 1 auto; min-width: 0; }
.wbm__cat b { flex: 0 0 auto; min-width: 24px; padding: 3px 7px; border-radius: 999px; color: #5d6b96; background: rgba(13, 123, 255, .08); text-align: center; font: 700 11.5px/1.2 Inter, sans-serif; }
.wbm__cat.is-active b { color: #fff; background: #0d7bff; }
.wbm__chev { flex: 0 0 auto; color: #9aa8cb; transition: transform .25s ease, color .2s ease; }
.wbm__cat.is-active .wbm__chev, .wbm__cat:hover .wbm__chev { color: #0d7bff; transform: translateX(3px); }
.wbm__cat.is-featured .wbm__cname::after { content: 'new'; margin-left: 8px; padding: 2px 7px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #0d7bff, #7c5cff); font: 800 9.5px/1.3 Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }

.wbm .wbm__all { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 0; padding: 13px 16px; border: 1px solid rgba(13, 123, 255, .25); border-radius: 14px; color: #0d7bff; background: #fff; font: 600 14.5px/1 Inter, sans-serif; letter-spacing: -.01em; text-decoration: none; transition: color .2s ease, background .25s ease, border-color .2s ease, transform .25s ease; }
.wbm .wbm__all:hover, .wbm .wbm__all:focus { color: #fff; background: linear-gradient(100deg, #0d7bff, #7c5cff); border-color: transparent; text-decoration: none; transform: translateY(-1px); }
.wbm__all svg { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.wbm__all:hover svg { transform: translateX(4px); }

/* ---------- Правая часть ---------- */
.wbm__main { min-width: 0; min-height: 0; padding: 22px 24px 24px; overflow-y: auto; scrollbar-width: thin; background: radial-gradient(420px 220px at 100% 0%, rgba(124, 92, 255, .07), transparent 70%); }
.wbm__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.wbm__count { display: block; margin-bottom: 6px; color: #0d7bff; font: 600 13.5px/1.2 Inter, sans-serif; letter-spacing: 0; text-transform: none; }
.wbm__head h3 { margin: 0; color: #08163b; font: 800 26px/1.1 Inter, sans-serif; letter-spacing: -.05em; }
.wbm .wbm__more { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 10px 14px; border-radius: 12px; color: #0d7bff; background: #eaf2ff; font: 600 13.5px/1 Inter, sans-serif; text-decoration: none; transition: color .2s ease, background .25s ease, gap .25s ease; }
.wbm .wbm__more:hover, .wbm .wbm__more:focus { gap: 12px; color: #fff; background: #0d7bff; text-decoration: none; }

.wbm__subs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.wbm__subs span { margin-right: 4px; color: #8a97bd; font: 500 13px/1.2 Inter, sans-serif; letter-spacing: 0; text-transform: none; }
.wbm .wbm__subs a { padding: 7px 13px; border: 1px solid #dbe5fa; border-radius: 999px; color: #3a4a78; background: #fff; font: 500 13px/1 Inter, sans-serif; text-decoration: none; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.wbm .wbm__subs a:hover, .wbm .wbm__subs a:focus { color: #0d7bff; background: #f1f6ff; border-color: #bed7ff; text-decoration: none; }

.wbm__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1300px) { .wbm__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.wbm .wbm__app { position: relative; display: flex; align-items: flex-start; gap: 13px; min-width: 0; padding: 14px 40px 14px 14px; border: 1px solid #e6eefb; border-radius: 18px; color: #08163b; background: #fff; text-decoration: none; box-shadow: 0 8px 18px -14px rgba(42, 79, 142, .4); animation: wbm-card .45s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i, 0) * 28ms); transition: transform .25s ease, box-shadow .25s ease, border-color .2s ease; }
@keyframes wbm-card { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wbm .wbm__app:hover, .wbm .wbm__app:focus { color: #08163b; border-color: #bed7ff; text-decoration: none; transform: translateY(-3px); box-shadow: 0 18px 30px -16px rgba(13, 123, 255, .5); outline: 0; }
.wbm .wbm__app:focus-visible { box-shadow: 0 0 0 3px rgba(13, 123, 255, .35); }

.wbm__tile { display: grid; place-items: center; flex: 0 0 auto; width: 50px; height: 50px; overflow: hidden; border-radius: 15px; color: #0d7bff; background: #eaf2ff; font: 700 15px/1 Inter, sans-serif; letter-spacing: -.02em; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), background .25s ease, color .25s ease, box-shadow .3s ease; }
.wbm__app:hover .wbm__tile:not(.wbm__tile--img) { color: #fff; background: linear-gradient(135deg, #0d7bff, #7c5cff); box-shadow: 0 12px 20px -10px rgba(13, 123, 255, .7); }
.wbm__tile--img { background: #f1f5fc; box-shadow: 0 0 0 1px #e6eefb; }
.wbm__tile img { width: 100%; height: 100%; object-fit: cover; }
.wbm__app:hover .wbm__tile { transform: scale(1.08) rotate(-4deg); }
.wbm__atext { display: grid; gap: 4px; min-width: 0; }
.wbm__atext strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: #08163b; font: 700 14.5px/1.3 Inter, sans-serif; letter-spacing: -.025em; }
.wbm__atext small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: #7482ad; font: 400 12.5px/1.4 Inter, sans-serif; }
.wbm__atext em { color: #0d7bff; font: 600 11.5px/1.2 Inter, sans-serif; font-style: normal; }
.wbm__go { position: absolute; right: 12px; top: 50%; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; color: #0d7bff; background: #eaf2ff; opacity: 0; transform: translateX(-6px); transition: opacity .2s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.wbm__app:hover .wbm__go, .wbm__app:focus .wbm__go { opacity: 1; transform: none; }

.wbm__empty { display: grid; justify-items: start; gap: 8px; padding: 30px 6px; }
.wbm__empty strong { color: #08163b; font: 700 18px/1.3 Inter, sans-serif; }
.wbm__empty p { margin: 0; color: #7482ad; font: 400 14px/1.45 Inter, sans-serif; }
.wbm .wbm__empty a { margin-top: 6px; padding: 10px 16px; border-radius: 12px; color: #fff; background: linear-gradient(100deg, #0d7bff, #7c5cff); font: 600 14px/1 Inter, sans-serif; text-decoration: none; }
.wbm .wbm__empty a:hover { color: #fff; text-decoration: none; }

/* скелетоны */
.wbm__cat--sk, .wbm__app--sk { pointer-events: none; animation: none; }
.wbm__cat--sk { display: flex; align-items: center; gap: 12px; padding: 9px; }
.wbm__cat--sk .wbm__ico, .wbm__cat--sk .wbm__cname, .wbm__app--sk .wbm__tile, .wbm__app--sk strong, .wbm__app--sk small { display: block; background: linear-gradient(90deg, #e9f0fb 25%, #f5f8fe 45%, #e9f0fb 65%); background-size: 200% 100%; animation: wbm-sh 1.4s linear infinite; box-shadow: none; }
.wbm__cat--sk .wbm__cname { height: 14px; border-radius: 7px; }
.wbm__app--sk strong { width: 80%; height: 14px; border-radius: 7px; }
.wbm__app--sk small { width: 55%; height: 11px; border-radius: 6px; }
@keyframes wbm-sh { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
	.wbm__shell { grid-template-columns: 260px minmax(0, 1fr); }
	.wbm__head h3 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
	.wbm.is-open, .wbm .wbm__app, .wbm-backdrop { animation: none; transition: none; }
}

/* Подложка не перехватывает мышь: иначе, закрыв кнопку «Каталог», она «уводит» курсор с неё
   и меню закрывается сразу после открытия по наведению. Закрытие по клику снаружи — в wb-menu.js. */
.wbm-backdrop { pointer-events: none; }

/* невидимый «мостик» между кнопкой и панелью: курсор не теряет меню, пока переходит на него */
.wbm::before { content: ''; position: absolute; left: 0; right: 0; top: -28px; height: 28px; }
.wbm { overflow: visible; }
.wbm__shell { overflow: hidden; border-radius: 25px; }

/* Меню «Каталог»: категории без иконок-плиток, выделение плоское. */
.wbm__ico { display: none !important; }
.wbm .wbm__cat { padding-left: 14px; }
.wbm .wbm__cat.is-active::before { display: none; }
.wbm .wbm__cat.is-active { box-shadow: none; background: #eef2f9; }
.wbm__cat.is-featured .wbm__cname::after { background: #0b63d1; }
