/**
 * Header
 */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--glass-bg);
	backdrop-filter: var(--glass-blur);
	-webkit-backdrop-filter: var(--glass-blur);
	border-bottom: 1px solid rgb(var(--color-line));
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 4.5rem;
	padding-block: 0.4rem;
}

.site-branding a {
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: 1.25rem;
}

.site-branding {
	display: flex;
	align-items: center;
	line-height: 0;
}

.site-branding a,
.site-branding .custom-logo-link {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}

.site-branding img {
	display: block;
	max-height: 3.5rem;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
	transition: transform var(--transition-base), filter var(--transition-base);
}

.site-branding a:hover img {
	transform: scale(1.03);
	filter: drop-shadow(0 4px 12px rgba(201, 162, 99, 0.35));
}

.header-reviews {
	display: none;
	align-items: center;
	gap: 0.8rem;
	padding: 0.45rem 0.75rem;
	border: 1px solid rgba(198, 168, 122, 0.34);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	color: rgb(var(--color-primary));
	text-decoration: none;
	box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: border-color var(--transition-base), transform var(--transition-base), background var(--transition-base);
}

.header-reviews:hover {
	transform: translateY(-1px);
	border-color: rgba(198, 168, 122, 0.65);
	background: rgba(255, 255, 255, 0.07);
}

.header-reviews__rating {
	font-family: var(--font-serif);
	font-size: 1.1rem;
	line-height: 1;
	color: rgb(var(--color-primary));
}

.header-reviews__stars {
	color: #ffb400;
	font-size: 0.95rem;
	letter-spacing: 0.03em;
	line-height: 1;
	white-space: nowrap;
}

.header-reviews__count {
	display: inline-flex;
	flex-direction: column;
	gap: 0.05rem;
	padding-left: 0.8rem;
	border-left: 1px solid rgba(255, 255, 255, 0.14);
	line-height: 1.05;
	color: rgb(var(--color-primary) / 0.62);
	font-size: 0.68rem;
	white-space: nowrap;
}

.header-reviews__count strong {
	color: rgb(var(--color-primary));
	font-size: 0.95rem;
	font-weight: 500;
}

.header-reviews__award {
	display: none;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.6rem;
	border: 1px solid rgba(198, 168, 122, 0.46);
	border-radius: 999px;
	background: linear-gradient(135deg, rgba(198, 168, 122, 0.15), rgba(198, 168, 122, 0.26));
	color: rgb(var(--color-accent));
	font-size: 0.7rem;
	line-height: 1;
	white-space: nowrap;
}

.main-nav {
	display: flex;
	align-items: center;
}

.primary-menu {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 1.5rem;
}

.main-nav.is-open .primary-menu {
	display: flex;
	flex-direction: column;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: rgb(var(--color-surface));
	padding: 1rem var(--container-padding-x);
	border-bottom: 1px solid rgb(var(--color-line));
}

.primary-menu a {
	position: relative;
	display: inline-block;
	padding: 0.5rem 0;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgb(var(--color-primary) / 0.6);
	transition: color var(--transition-base);
}

.primary-menu a:hover,
.primary-menu a:focus {
	color: rgb(var(--color-primary));
}

.primary-menu a::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 1px;
	background: rgb(var(--color-accent));
	transition: width var(--transition-base);
}

.primary-menu a:hover::after,
.primary-menu a:focus-visible::after {
	width: 100%;
}

.menu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: none;
	background: transparent;
}

.menu-toggle-icon {
	position: relative;
	width: 1.25rem;
	height: 2px;
	background: rgb(var(--color-primary));
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	background: rgb(var(--color-primary));
	transition: transform var(--transition-base);
}

.menu-toggle-icon::before {
	top: -6px;
}

.menu-toggle-icon::after {
	top: 6px;
}

.main-nav.is-open .menu-toggle-icon {
	background: transparent;
}

.main-nav.is-open .menu-toggle-icon::before {
	top: 0;
	transform: rotate(45deg);
}

.main-nav.is-open .menu-toggle-icon::after {
	top: 0;
	transform: rotate(-45deg);
}

.header-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	font-size: 0.875rem;
}

.header-phone {
	font-weight: 500;
	white-space: nowrap;
}

.header-schedule {
	color: rgb(var(--color-primary) / 0.6);
	font-size: 0.75rem;
}

.header-messenger {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	letter-spacing: 0.05em;
	color: rgb(var(--color-accent));
	font-size: 0.75rem;
}

.header-messenger__label {
	display: none;
}

@media (min-width: 1024px) {
	.header-messenger__label {
		display: inline;
	}
}

.header-messenger__icons {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.header-messenger__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	text-decoration: none;
	color: #fff;
	transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
	flex-shrink: 0;
}

.header-messenger__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.header-messenger__icon--tg {
	background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
	box-shadow: 0 4px 10px -3px rgba(42, 171, 238, 0.45);
}

/* MAX — логотип с прозрачным фоном и встроенными полями.
   Увеличиваем контейнер, чтобы видимая часть совпала по высоте с Telegram. */
.header-messenger__icon--max {
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	width: 45px;
	height: 45px;
}

.header-messenger__icon--max img {
	border-radius: 0;
	width: 100%;
	height: 100%;
}

.header-messenger__icon:hover {
	transform: translateY(-1px) scale(1.06);
	filter: brightness(1.08);
}

.header-messenger__icon--tg:hover {
	box-shadow: 0 6px 14px -3px rgba(42, 171, 238, 0.65);
}

.header-messenger__icon--max:hover {
	filter: brightness(1.15) drop-shadow(0 4px 10px rgba(123, 92, 255, 0.45));
}

.header-messenger__icon:focus-visible {
	outline: 2px solid rgb(var(--color-accent));
	outline-offset: 3px;
}

.header-phone-wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

/* =====================================================================
   Liquid Glass кнопка в шапке.
   Многослойная композиция:
     • сама кнопка — полупрозрачный «купол» из затемнённого стекла
       с золотым внутренним свечением;
     • ::before  — верхний блик (highlight), как на физическом стекле;
     • ::after   — тонкий внешний контур-блик для эффекта «преломления».
   На hover — усиливаем свечение + лёгкий подъём.
   ===================================================================== */
.header-btn {
	position: relative;
	isolation: isolate;
	padding: 0.7rem 1.5rem;
	font-size: 0.8125rem;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: rgb(var(--color-primary));
	background:
		/* тёплый внутренний блик снизу */
		radial-gradient(120% 90% at 50% 115%,
			rgba(198, 168, 122, 0.22) 0%,
			rgba(198, 168, 122, 0.05) 45%,
			rgba(255, 255, 255, 0) 70%),
		/* основа — почти чёрное стекло */
		linear-gradient(180deg,
			rgba(255, 255, 255, 0.08) 0%,
			rgba(255, 255, 255, 0.02) 50%,
			rgba(0, 0, 0, 0.35) 100%);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	backdrop-filter: blur(14px) saturate(140%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.22),
		inset 0 -1px 0 rgba(0, 0, 0, 0.3),
		0 6px 18px -6px rgba(0, 0, 0, 0.55);
	cursor: pointer;
	transition:
		transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1),
		box-shadow 0.35s ease,
		border-color 0.35s ease,
		background 0.35s ease;
	overflow: hidden;
}

/* Верхний блик — тонкая «полоса света» */
.header-btn::before {
	content: "";
	position: absolute;
	inset: 1px 1px auto 1px;
	height: 45%;
	border-radius: 999px 999px 50% 50% / 999px 999px 100% 100%;
	background: linear-gradient(180deg,
		rgba(255, 255, 255, 0.28) 0%,
		rgba(255, 255, 255, 0.08) 55%,
		rgba(255, 255, 255, 0) 100%);
	pointer-events: none;
	opacity: 0.85;
	transition: opacity 0.35s ease;
}

.header-btn:hover {
	transform: translateY(-1px);
	border-color: rgba(198, 168, 122, 0.5);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.3),
		inset 0 -1px 0 rgba(0, 0, 0, 0.25),
		0 10px 24px -8px rgba(198, 168, 122, 0.35),
		0 0 0 1px rgba(198, 168, 122, 0.15);
}

.header-btn:hover::before {
	opacity: 1;
}

.header-btn:active {
	transform: translateY(0);
}

/* Primary (Заказать консультацию) — золотая стеклянная капсула */
.header-btn--primary {
	color: #fffaf0;
	background:
		radial-gradient(120% 120% at 50% 110%,
			rgba(255, 216, 156, 0.55) 0%,
			rgba(198, 168, 122, 0.35) 35%,
			rgba(120, 90, 55, 0.2) 70%,
			rgba(0, 0, 0, 0.25) 100%),
		linear-gradient(180deg,
			rgba(255, 255, 255, 0.22) 0%,
			rgba(255, 255, 255, 0.05) 50%,
			rgba(0, 0, 0, 0.15) 100%);
	border-color: rgba(198, 168, 122, 0.55);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.45),
		inset 0 -1px 0 rgba(0, 0, 0, 0.2),
		0 8px 22px -6px rgba(198, 168, 122, 0.5),
		0 0 0 1px rgba(198, 168, 122, 0.2);
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.header-btn--primary::before {
	background: linear-gradient(180deg,
		rgba(255, 255, 255, 0.55) 0%,
		rgba(255, 255, 255, 0.15) 55%,
		rgba(255, 255, 255, 0) 100%);
	opacity: 1;
}

.header-btn--primary:hover {
	border-color: rgba(255, 216, 156, 0.85);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		inset 0 -1px 0 rgba(0, 0, 0, 0.15),
		0 14px 32px -8px rgba(198, 168, 122, 0.7),
		0 0 0 1px rgba(255, 216, 156, 0.35);
}

/* Outline (если используется где-то) — оставляем стеклянный нейтральный вариант */
.header-btn--outline:hover {
	border-color: rgba(198, 168, 122, 0.5);
}

.header-btn:focus-visible {
	outline: 2px solid rgb(var(--color-accent));
	outline-offset: 3px;
}

/* Пользователи, предпочитающие минимум движения */
@media (prefers-reduced-motion: reduce) {
	.header-btn,
	.header-btn::before {
		transition: none;
	}
	.header-btn:hover {
		transform: none;
	}
}

@media (min-width: 768px) {
	.menu-toggle {
		display: none;
	}

	.primary-menu {
		display: flex;
		flex-direction: row;
		position: static;
		background: none;
		padding: 0;
		border: none;
	}
}

@media (min-width: 1180px) {
	.header-reviews {
		display: inline-flex;
	}
}

@media (min-width: 1420px) {
	.header-reviews__award {
		display: inline-flex;
	}
}

/* =====================================================================
   Мобильная компактная шапка (<768px):
   - только логотип + бургер-меню
   - телефон, мессенджеры и CTA-кнопка перенесены в sticky bottom bar
     и меню-выпадашку → высота шапки ~56px вместо 3 рядов
   ===================================================================== */
@media (max-width: 767px) {
	.header-inner {
		min-height: 3.5rem;
		gap: 0.5rem;
		padding-block: 0.3rem;
	}

	.site-branding a {
		font-size: 1rem;
	}

	.site-branding img {
		max-height: 2.6rem;
	}

	.header-actions {
		display: none;
	}

	.menu-toggle {
		width: 2.25rem;
		height: 2.25rem;
	}
}
