/* ===== Шапка сайта (вместо Max Mega Menu) ===== */
:root { --es-accent: var(--primary-color, #089f9a); --es-ink: #1f2a2a; --es-top: 0px; --es-h: 84px; --es-h-scrolled: 72px; }
body.admin-bar { --es-top: 32px; }
@media (max-width: 782px) { body.admin-bar { --es-top: 46px; } }
@media (max-width: 600px) { body.admin-bar { --es-top: 0px; } }
@media (max-width: 1199.98px) { :root { --es-h: 64px; --es-h-scrolled: 64px; } }

.es-header { position: sticky; top: var(--es-top); z-index: 1030; background: #fff; color: var(--es-ink);
	box-shadow: 0 2px 16px rgba(20,40,40,.08); font-family: 'Manrope', sans-serif; transition: background-color .25s, box-shadow .25s, color .25s; }
.es-header--overlay { position: fixed; left: 0; right: 0; background: transparent; box-shadow: none; color: #fff; }
.es-header--overlay:not(.is-scrolled) .es-nav__link, .es-header--overlay:not(.is-scrolled) .es-phone { text-shadow: 0 1px 6px rgba(0,0,0,.25); }
.es-header--overlay.is-scrolled { background: #fff; color: var(--es-ink); box-shadow: 0 2px 16px rgba(20,40,40,.08); }

.es-header__inner { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: var(--es-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; transition: height .25s; }
.es-header.is-scrolled .es-header__inner { height: var(--es-h-scrolled); }

.es-logo { display: block; flex: 0 0 auto; line-height: 0; }
.es-logo img { height: 52px; width: auto; transition: height .25s; }
.es-header.is-scrolled .es-logo img { height: 44px; }
.es-logo__white { display: none; }
.es-header--overlay:not(.is-scrolled) .es-logo__white { display: block; }
.es-header--overlay:not(.is-scrolled) .es-logo__green { display: none; }

/* Меню (компьютер) */
.es-nav { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 28px; }
.es-header li, .es-panel li { margin: 0 !important; padding: 0 !important; height: auto !important; }
.es-header li::before, .es-panel li::before { content: none; }
.es-nav__item { position: relative; }
.es-nav__link { display: flex; align-items: center; gap: 4px; padding: 10px 0; color: inherit !important; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.es-nav__link:hover, .es-nav__item.is-current > .es-nav__link { color: var(--es-accent) !important; }
.es-header--overlay:not(.is-scrolled) .es-nav__link:hover, .es-header--overlay:not(.is-scrolled) .es-nav__item.is-current > .es-nav__link { color: #fff !important; opacity: .85; }
.es-nav__item.is-current > .es-nav__link { box-shadow: inset 0 -2px 0 currentColor; }
.es-chev { transition: transform .2s; }

.es-dd { position: absolute; top: 100%; left: 50%; transform: translate(-50%, 8px); min-width: 240px; padding: 12px; background: #fff; color: var(--es-ink);
	border-radius: 14px; box-shadow: 0 14px 40px rgba(20,40,40,.16); opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s; z-index: 5; }
.es-dd::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* «мостик», чтобы меню не закрывалось */
.es-nav__item.has-dd:hover > .es-dd, .es-nav__item.has-dd:focus-within > .es-dd, .es-nav__item.is-open > .es-dd { opacity: 1; visibility: visible; transform: translate(-50%, 4px); }
.es-nav__item.has-dd:hover .es-chev, .es-nav__item.is-open .es-chev { transform: rotate(180deg); }
.es-dd__link { display: block; padding: 8px 12px; border-radius: 8px; color: #3b4747 !important; text-decoration: none; font-size: 14px; line-height: 1.35; }
.es-dd__link:hover, .es-dd__link.is-current { background: #f1f7f6; color: var(--es-accent) !important; }
.is-mega > .es-dd { width: 640px; padding: 22px 26px; }
.es-dd__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.es-dd__col { display: flex; flex-direction: column; gap: 2px; }
.es-dd__head { display: block; padding: 4px 12px 6px; font-weight: 700; font-size: 15px; color: var(--es-ink) !important; text-decoration: none; }
.es-dd__head:hover { color: var(--es-accent) !important; }
.es-dd__col .es-dd__link { padding: 6px 12px; }
.es-dd__all { display: block; margin-top: 16px; padding: 14px 12px 0; border-top: 1px solid #ecebe8; color: var(--es-accent) !important; font-weight: 700; font-size: 14px; text-decoration: none; }

/* Контакты справа */
.es-header__contacts { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.es-phone { color: inherit !important; font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap; margin-right: 4px; }
.es-round { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e7f5f4; color: var(--es-accent) !important; transition: background-color .2s; }
.es-round:hover { background: #d3eeec; }
.es-header--overlay:not(.is-scrolled) .es-round { background: transparent; border: 1.5px solid rgba(255,255,255,.65); color: #fff !important; }
.es-round--lg { width: 44px; height: 44px; }

/* Телефон: кнопки */
.es-header__mobile { display: none; gap: 8px; align-items: center; }
.es-burger { width: 44px; height: 44px; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--es-accent); color: #fff; cursor: pointer; }
.es-header--overlay:not(.is-scrolled) .es-burger { background: #fff; color: var(--es-accent); }

@media (max-width: 1199.98px) {
	.es-header__nav, .es-header__contacts { display: none; }
	.es-header__mobile { display: flex; }
	.es-header__inner { padding: 0 16px; }
	.es-logo img, .es-header.is-scrolled .es-logo img { height: 38px; }
}

/* Мобильное меню — белая панель на весь экран */
.es-panel { position: fixed; inset: 0; z-index: 100000; /* выше кнопки чата */ background: #fff; color: var(--es-ink); display: flex; flex-direction: column; overflow-y: auto;
	overscroll-behavior: contain; font-family: 'Manrope', sans-serif; transform: translateX(100%); transition: transform .28s ease; }
.es-panel.is-open { transform: none; }
.es-panel[hidden] { display: none; }
.es-panel__top { position: sticky; top: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 16px; border-bottom: 1px solid #ecebe8; flex: 0 0 auto; z-index: 1; }
.es-panel__top .es-logo img { height: 38px; }
.es-panel__close { height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; background: #f1f0ed; color: var(--es-ink); font: 700 14px 'Manrope', sans-serif; cursor: pointer; }
.es-panel__nav { padding: 4px 22px 16px; flex: 1 0 auto; }
.es-mnav { list-style: none; margin: 0; padding: 0; }
.es-mnav__item { border-bottom: 1px solid #ecebe8; }
.es-mnav__top, .es-mnav__toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 15px 0; background: none; border: 0;
	color: var(--es-ink) !important; font: 600 17px 'Manrope', sans-serif; text-align: left; text-decoration: none; cursor: pointer; }
.es-mnav__item.is-current > .es-mnav__top, .es-mnav__toggle[aria-expanded="true"] { color: var(--es-accent) !important; }
.es-mnav__toggle svg { transition: transform .2s; flex: 0 0 auto; }
.es-mnav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.es-mnav__sub { background: #f6f5f3; border-radius: 12px; padding: 6px; margin: 0 0 12px; }
.es-mnav__link { display: block; padding: 9px 12px; border-radius: 8px; color: #3b4747 !important; text-decoration: none; font-size: 15px; line-height: 1.35; }
.es-mnav__link--l2 { font-weight: 700; color: var(--es-ink) !important; }
.es-mnav__link--l3 { padding-left: 24px; font-size: 14px; }
.es-mnav__all { color: var(--es-accent) !important; font-weight: 700; }
.es-panel__bottom { padding: 16px 22px 24px; border-top: 1px solid #ecebe8; display: flex; flex-direction: column; gap: 12px; flex: 0 0 auto; }
.es-panel__cta { height: 52px; border-radius: 12px; background: var(--es-accent); color: #fff !important; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; text-decoration: none; }
.es-panel__phone { display: inline-flex; align-items: center; gap: 8px; color: var(--es-ink) !important; font-weight: 700; font-size: 17px; text-decoration: none; }
.es-panel__msg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.es-panel__msg a { height: 46px; border: 1px solid #dcdad5; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--es-ink) !important; font-weight: 600; font-size: 14px; text-decoration: none; }
.es-panel__addr { font-size: 13px; color: #5f6b6b; }
html.es-lock, html.es-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) { .es-header, .es-header *, .es-panel, .es-dd { transition: none !important; } }

/* Главная: место под шапку в баннере вместо прежнего меню */
.es-banner-spacer { height: var(--es-h); }

/* «Курсы»: направления слева, курсы направления справа */
.is-mega > .es-dd { width: min(880px, calc(100vw - 48px)); padding: 16px; }
.es-tabs { display: flex; gap: 16px; }
.es-tabs__list { list-style: none; margin: 0; padding: 0 16px 0 0; flex: 0 0 250px; border-right: 1px solid #ecebe8; }
.es-tabs__tab { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border-radius: 10px;
	color: var(--es-ink) !important; text-decoration: none; font-size: 15px; font-weight: 600; line-height: 1.3; }
.es-tabs__tab svg { flex: 0 0 auto; opacity: .45; }
.es-tabs__tab.is-active { background: #e7f5f4; color: var(--es-accent) !important; }
.es-tabs__tab.is-active svg { opacity: 1; }
.es-tabs__panes { flex: 1 1 auto; min-width: 0; max-height: min(66vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.es-tabs__pane { display: none; }
.es-tabs__pane.is-active { display: block; }
.es-tabs__head { display: inline-block; margin: 4px 12px 10px; font-weight: 700; font-size: 15px; color: var(--es-accent) !important; text-decoration: none; }
.es-tabs__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.es-tabs__grid .es-dd__link { padding: 7px 12px; }
.is-mega .es-dd__all { margin-top: 10px; }

/* Мобильное: направления внутри «Курсов» */
.es-mnav__toggle--l2 { padding: 10px 12px; font-size: 15px; font-weight: 700; border-radius: 8px; }
.es-mnav__toggle--l2[aria-expanded="true"] { background: #e7f5f4; }
.es-mnav__sub2 { padding: 2px 0 8px; }

/* Подсказки под кнопками мессенджеров */
.es-header [data-tip] { position: relative; }
.es-header [data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px);
	padding: 5px 10px; border-radius: 6px; background: var(--es-ink); color: #fff; font: 600 12px/1.2 'Manrope', sans-serif; white-space: nowrap;
	text-shadow: none; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, transform .15s, visibility .15s; z-index: 10; }
.es-header [data-tip]:hover::after, .es-header [data-tip]:focus-visible::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* Пункт-«папка» без своей страницы — кнопка, выглядит как ссылка */
.es-nav__link--btn { background: none; border: 0; font-family: inherit; cursor: pointer; }

/* Липкая шапка на внутренних страницах.
   1) обёртка <header> по высоте равна шапке и не давала ей «прилипнуть» — убираем её из раскладки;
   2) overflow-x:hidden у html/body превращал body в отдельную область прокрутки, из-за чего sticky не работал.
      clip так же прячет горизонтальную прокрутку, но области прокрутки не создаёт. */
.es-header-wrap { display: contents; }
html, body { overflow-x: clip !important; }

/* Обычные выпадающие меню (Магазин, О нас, Полезное): шире, каждый пункт в одну строку */
.es-nav__item:not(.is-mega) > .es-dd { min-width: 280px; width: max-content; max-width: 420px; }
.es-nav__item:not(.is-mega) > .es-dd .es-dd__link { white-space: nowrap; }
