/* ============================================================
   HEADER — partials/header.ejs
   ============================================================ */

header {
	display: flex;
	flex-direction: column;
	max-width: 100%;
	padding: 0.6rem 6rem;
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: #fff;
	font-family: 'Manrope', sans-serif;
}

/* ---------- Верхняя строка ---------- */
.top-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 6px 0;
	flex-wrap: nowrap;
}

/* ---------- Логотип ---------- */
header .logotype {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

header .logotype img {
	max-width: 110px;
	height: auto;
	display: block;
}

/* ---------- Меню ---------- */
.top-links {
	font-size: 14px;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex: 1;
	white-space: nowrap;
	min-width: 0;
}

.link-item {
	background: transparent;
	border: none;
	cursor: pointer;
	font-weight: 500;
	color: #484848;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	transition: color 0.2s ease;
}

.link-item:hover {
	color: #0a6cff;
}

/* ---------- Правая часть ---------- */
header .right {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

header .phone {
	white-space: nowrap;
	padding: 0.75rem;
	font-size: 11px;
	color: #fff;
	background: linear-gradient(to right, #3361f9, #294fce, #213fa9);
	border-radius: 1rem;
	text-decoration: none;
	font-weight: bold;
	letter-spacing: 1.5px;
}

/* Компактный телефон — по умолчанию скрыт */
header .mobile-phone {
	display: none;
	white-space: nowrap;
	padding: 10px 16px;
	font-size: 11px;
	color: #fff;
	background: linear-gradient(to right, #3361f9, #294fce, #213fa9);
	border-radius: 10px;
	text-decoration: none;
	font-weight: bold;
	letter-spacing: 1px;
}

/* ---------- Бургер ---------- */
.mobile-menu-btn {
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	display: none;
}

.mobile-menu-btn img {
	max-width: 42px;
	display: block;
}

/* ============================================================
   Мобильное меню (overlay + panel)
   ============================================================ */
.mobile-overlay {
	position: fixed;
	inset: 0;
	z-index: 2000;
	-webkit-tap-highlight-color: transparent;
	background: rgba(44, 84, 116, 0);
	opacity: 0;
	pointer-events: none;
	transition: background 320ms ease, opacity 320ms ease;
}

.mobile-overlay.open {
	background: rgba(44, 84, 116, 0.7);
	opacity: 1;
	pointer-events: auto;
}

.mobile-panel {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	background: #fff;
	border-radius: 10px 10px 0 0;
	max-height: calc(100vh - 80px);
	overflow: auto;
	transform: translateY(100%);
	transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
	padding: 18px 20px;
}

.mobile-overlay.open .mobile-panel {
	transform: translateY(0);
}

.mobile-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.25rem 0.5rem 1rem 0;
}

.logo_sm {
	max-width: 40px;
	max-height: 40px;
}

.mobile-close {
	font-family: "Manrope", sans-serif;
	font-size: 18px;
	font-weight: 700;
	width: 35px;
	height: 35px;
	border-radius: 50%;
	background: #d9d9d9;
	color: #fff;
	border: none;
	line-height: 1;
	cursor: pointer;
}

/* ---------- Пункты мобильного меню ---------- */
.mobile-nav {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mobile-nav-item {
	font-family: "Manrope", sans-serif;
	background-color: transparent;
	border: none;
	font-weight: 700;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 0;
	text-decoration: none;
	color: #000;
	transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-item:hover {
	background: rgba(6, 153, 255, 0.06);
}

.mobile-nav-item.active {
	color: #0a6cff;
}

.menu-text-sm {
	font-size: 11px;
	color: #484848;
	line-height: 1.4;
	margin-top: 0.5rem;
}

.phone-mobile-sm {
	font-size: 18px;
	color: #000;
	text-decoration: none;
	margin-top: 0.5rem;
	display: inline-block;
}

/* ============================================================
   Адаптив
   ============================================================ */

/* Широкий десктоп — уменьшаем отступы и лого, чтобы 9 пунктов меню влезали */
@media (max-width: 1470px) {
	header {
		padding: 1rem;
	}
	header .logotype img {
		max-width: 96px;
	}
	.top-links {
		font-size: 13px;
		gap: 0.6rem;
	}
	header .phone {
		padding: 0.6rem 0.8rem;
		font-size: 10px;
		letter-spacing: 1px;
	}
}

/* Узкий десктоп: скрываем меню, показываем бургер */
@media (max-width: 1250px) {
	header {
		padding: 1rem 4rem;
	}
	.top-links {
		display: none;
	}
	.mobile-menu-btn {
		display: block;
	}
}

/* Небольшой планшет */
@media (max-width: 900px) {
	header {
		padding: 1rem 2rem;
	}
	header .logotype img {
		max-width: 110px;
	}
}

/* Мобильный */
@media (max-width: 763px) {
	header {
		padding: 1rem 1.5rem;
		background: linear-gradient(
			135deg,
			rgba(241, 248, 255, 1),
			rgba(247, 249, 255, 1),
			rgba(239, 243, 255, 1)
		);
	}
	.top-row {
		gap: 1rem;
		padding: 0;
	}
	header .logotype img {
		max-width: 96px;
	}
}

/* Узкий мобильный: скрываем большой телефон, показываем компактный */
@media (max-width: 643px) {
	header .phone {
		display: none;
	}
	header .mobile-phone {
		display: inline-block;
	}
	.mobile-menu-btn img {
		max-width: 36px;
	}
}