/**
 * Шапка сайта — вариант «Компактный современный» (C).
 * Всё скоупится под #top-header. Переопределяет конфликтующие правила из style.css
 * (там .top-menu — с переносом и серым ховером; здесь — один ряд, капс, подчёркивание).
 * Работает поверх реальной разметки wp_nav_menu: .top-menu > li(.menu-item-has-children)
 *   > a + .open-sub-menu(каретка) + ul.sub-menu.
 */

/* ── Контейнер шапки ─────────────────────────────────────────────────── */
#top-header {
	padding: 0;                                  /* высоту задаёт .header-inner */
	background: #f5f6f7;                         /* чуть темнее белого, не сливается с контентом */
}
#top-header.shadow { box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }

#top-header .header-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 64px;
}

#top-header .header-logo { flex: 0 0 auto; display: inline-flex; }
#top-header .header-logo img { height: 38px; width: auto; display: block; }

/* nav центрируется в свободном пространстве между лого и контактами */
#top-header .header-nav { margin-inline: auto; min-width: 0; }

/* ── Меню ────────────────────────────────────────────────────────────── */
#top-header .top-menu {
	display: flex;
	flex-wrap: nowrap;            /* в один ряд (перебивает style.css) */
	align-items: center;
	justify-content: center;
	gap: 4px;
}
#top-header .top-menu > li { position: relative; display: flex; align-items: center; }

#top-header .top-menu > li > a {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 9px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	white-space: nowrap;
	border-radius: 0;
	transition: color var(--transition);
}
/* подчёркивание-индикатор */
#top-header .top-menu > li > a::after {
	content: "";
	position: absolute;
	left: 9px; right: 9px; bottom: 2px;
	height: 2px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .2s ease;
}
#top-header .top-menu > li > a:hover { background: transparent; color: var(--accent); }
#top-header .top-menu > li > a:hover::after { transform: scaleX(1); }

/* активный пункт (классы добавляет WordPress) */
#top-header .top-menu > .current-menu-item > a,
#top-header .top-menu > .current_page_item > a,
#top-header .top-menu > .current-menu-parent > a,
#top-header .top-menu > .current-menu-ancestor > a { color: var(--accent); }
#top-header .top-menu > .current-menu-item > a::after,
#top-header .top-menu > .current_page_item > a::after,
#top-header .top-menu > .current-menu-parent > a::after,
#top-header .top-menu > .current-menu-ancestor > a::after { transform: scaleX(1); }

/* каретка (.open-sub-menu) — делаем инлайновой вместо absolute из style.css */
#top-header .top-menu .open-sub-menu {
	position: static;
	width: auto; height: auto;
	display: inline-flex;
	align-items: center;
	margin-left: -2px;
	cursor: pointer;
	color: inherit;
	transition: transform .2s ease;
}
#top-header .top-menu .open-sub-menu svg { width: 11px; height: 11px; }
#top-header .top-menu .menu-item-has-children:hover .open-sub-menu,
#top-header .top-menu .menu-item-has-children.is-open .open-sub-menu { transform: rotate(180deg); }

/* ── Выпадающее меню ─────────────────────────────────────────────────── */
#top-header .top-menu .sub-menu {
	display: block;                 /* видимостью управляем через opacity/visibility */
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	min-width: 230px;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--grey-dark);
	border-radius: 12px;
	box-shadow: 0 18px 40px -20px rgba(20, 30, 60, .45);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
	z-index: 9;
}
/* небольшой «мостик», чтобы курсор не терял меню в зазоре */
#top-header .top-menu .menu-item-has-children::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 100%;
	height: 14px;
}
#top-header .top-menu .menu-item-has-children:hover > .sub-menu,
#top-header .top-menu .menu-item-has-children:focus-within > .sub-menu,
#top-header .top-menu .menu-item-has-children.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
#top-header .top-menu .sub-menu li { border: 0; }
#top-header .top-menu .sub-menu a {
	display: block;
	padding: 10px 14px;
	font-size: 13.5px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	border-radius: 8px;
	white-space: nowrap;
	transition: background-color var(--transition), color var(--transition);
}
#top-header .top-menu .sub-menu a:hover { background: var(--grey); color: var(--accent); }

/* ── Контакты ────────────────────────────────────────────────────────── */
#top-header .header-contacts {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 14px;
}
#top-header .header-icon {
	width: 40px; height: 40px;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid var(--grey-dark);
	border-radius: 50%;
	color: var(--text-color);
	transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}
#top-header .header-icon:hover { border-color: var(--accent); color: var(--accent); }
#top-header .header-icon svg { width: 17px; height: 17px; }

/* Телефон — текстом (основной контакт) */
#top-header .header-phone {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 16px;
	font-weight: 800;
	white-space: nowrap;
	color: var(--text-color);
	transition: color var(--transition);
}
#top-header .header-phone svg { width: 15px; height: 15px; color: var(--accent); flex: 0 0 auto; }
#top-header .header-phone:hover { color: var(--accent); }

#top-header .header-cta.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: 999px;            /* пилюля (C) */
	font-weight: 700;
	white-space: nowrap;
	padding: 11px 20px;
}
#top-header .header-cta.btn:active { transform: scale(.98); }
#top-header .header-icon:focus-visible,
#top-header .header-cta.btn:focus-visible,
#top-header .top-menu a:focus-visible,
#top-header .top-menu .open-sub-menu:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* ── Планшет: чуть плотнее ───────────────────────────────────────────── */
@media (max-width: 1199.98px) {
	#top-header .header-inner { gap: 14px; }
	#top-header .top-menu > li > a { padding: 8px 8px; letter-spacing: .03em; }
}

/* ── Мобайл (<768): меню прячем (есть отдельное мобильное), оставляем
      лого + телефон + CTA. Мессенджеры скрываем — они в нижней панели. ── */
@media (max-width: 767.98px) {
	#top-header .header-inner { gap: 12px; min-height: 56px; }
	#top-header .header-nav { display: none; }
	#top-header .header-contacts { margin-left: auto; }
	/* На мобиле контакты — в нижней плавающей панели; в шапке только лого + CTA. */
	#top-header .header-phone { display: none; }
	#top-header .header-logo img { height: 32px; }
	#top-header .header-cta.btn { padding: 9px 16px; font-size: 14px; }
}

/* ── Контакты в подвале (перенесены из шапки) ────────────────────────── */
.footer-contacts {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}
.footer-contacts li { margin-bottom: 8px; }
.footer-contacts li:first-child a { font-size: 18px; font-weight: 800; }
.footer-contacts a {
	color: var(--text-color);
	transition: color var(--transition);
}
.footer-contacts a:hover { color: var(--accent); }
