/* ==========================================================================
   Header: телефон + элементы личного кабинета
   Подключается из header_menu.tpl / header_tel.tpl
   ========================================================================== */

/* --- общая раскладка строки шапки --- */
.hdr-col-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.hdr-contacts {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* мобильный/планшетный режим (меню свёрнуто в бургер):
   у колонок темы padding 30px — в шапке это не даёт уместить
   логотип, телефон, кабинет и бургер в одну строку */
@media (max-width: 1229.98px) {
	.navbar .maintop {
		padding-left: 15px;
		padding-right: 15px;
	}
	.navbar .maintop > .row {
		margin-left: -6px;
		margin-right: -6px;
	}
	.navbar .maintop > .row > .hdr-col-logo,
	.navbar .maintop > .row > .hdr-col-actions,
	.navbar .maintop > .row > .main-menu-collapse {
		padding-left: 6px;
		padding-right: 6px;
	}
	.hdr-col-actions {
		margin-left: auto;
	}
	.hdr-col-actions .navbar-toggler {
		margin-right: 0 !important;
		padding: 10px 5px;
	}
}

/* десктоп: телефон и кабинет — в две строки рядом с логотипом */
@media (min-width: 1230px) {
	.hdr-contacts {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
	/* ужимаем отступы между колонками (у темы по 30px),
	   иначе меню не помещается в одну строку на узком десктопе;
	   внешние края шапки оставляем на месте */
	.navbar .maintop > .row > .hdr-col-logo {
		padding-left: 30px;
		padding-right: 10px;
	}
	.navbar .maintop > .row > .hdr-col-actions {
		padding-left: 10px;
		padding-right: 10px;
	}
	.navbar .maintop > .row > .main-menu-collapse {
		padding-left: 10px;
		padding-right: 30px;
	}
}

/* блок ЛК в мобильном меню не должен добавлять отступ пунктам меню */
@media (min-width: 1230px) {
	.navbar .main-menu-collapse > *:not(:last-child) {
		margin-right: 0;
	}
}

/* узкий десктоп — компактнее логотип и телефон */
@media (min-width: 1230px) and (max-width: 1399px) {
	.hdr-col-logo img {
		width: 135px;
	}
	.hdr-phone {
		padding: 7px 12px;
		font-size: 13px;
	}
	.hdr-user__btn {
		font-size: 13px;
		padding-right: 10px;
	}
	.hdr-user__avatar {
		width: 30px;
		height: 30px;
	}
}

/* логотип не должен съедать ширину на телефонах */
@media (max-width: 767px) {
	.hdr-col-logo img {
		width: 140px;
	}
}

@media (max-width: 400px) {
	.hdr-col-logo img {
		width: 118px;
	}
	.navbar .maintop > .row > .hdr-col-logo,
	.navbar .maintop > .row > .hdr-col-actions {
		padding-left: 4px;
		padding-right: 4px;
	}
}

/* --- телефон --- */
.hdr-phone {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	max-width: 100%;
	padding: 9px 16px;
	border: 1px solid transparent;
	border-radius: 40px;
	background: #ffdbbb;
	color: #293041 !important;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
	text-decoration: none !important;
	transition: background .2s ease, box-shadow .2s ease;
}

.hdr-phone:hover,
.hdr-phone:focus {
	background: #ffcaa0;
	color: #293041 !important;
	box-shadow: 0 4px 14px rgba(41, 48, 65, 0.12);
}

.hdr-phone__icon {
	display: inline-flex;
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	color: #293041;
}

.hdr-phone__icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.hdr-phone__text {
	display: inline-block;
}

/* на узких экранах — компактная круглая кнопка «позвонить» */
@media (max-width: 575px) {
	.hdr-phone {
		width: 42px;
		height: 42px;
		padding: 0;
		border-radius: 50%;
	}
	.hdr-phone__text {
		display: none;
	}
	.hdr-phone__icon {
		width: 18px;
		height: 18px;
	}
}

/* --- чип пользователя / кнопка входа --- */
.hdr-user {
	position: relative;
}

.hdr-user__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 190px;
	margin: 0;
	padding: 3px 12px 3px 3px;
	border: 1px solid rgba(41, 48, 65, 0.12);
	border-radius: 40px;
	background: #fff;
	color: #293041 !important;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.1;
	text-decoration: none !important;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.hdr-user__btn:hover,
.hdr-user__btn:focus,
.hdr-user.is-open .hdr-user__btn {
	border-color: #ffdbbb;
	color: #293041 !important;
	box-shadow: 0 4px 14px rgba(41, 48, 65, 0.1);
	outline: none;
}

.hdr-user__avatar {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #ffdbbb;
	color: #293041;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
}

.hdr-user__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hdr-user__avatar svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.hdr-user__name {
	overflow: hidden;
	max-width: 110px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hdr-user__caret {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	fill: currentColor;
	opacity: .6;
	transition: transform .2s ease;
}

.hdr-user.is-open .hdr-user__caret {
	transform: rotate(180deg);
}

/* на мобильных оставляем только аватар */
@media (max-width: 1229.98px) {
	.hdr-user__btn {
		padding: 3px;
		border-color: transparent;
		background: transparent;
	}
	.hdr-user__name,
	.hdr-user__caret {
		display: none;
	}
	.hdr-user__avatar {
		width: 42px;
		height: 42px;
	}
	.hdr-user__avatar svg {
		width: 18px;
		height: 18px;
	}
}

/* --- выпадающее меню ЛК --- */
.hdr-user__menu {
	position: absolute;
	z-index: 60;
	top: calc(100% + 10px);
	right: 0;
	min-width: 250px;
	padding: 8px;
	border: 1px solid rgba(41, 48, 65, 0.08);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 12px 34px rgba(41, 48, 65, 0.16);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

@media (min-width: 1230px) {
	.hdr-user__menu {
		right: auto;
		left: 0;
	}
}

.hdr-user.is-open .hdr-user__menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.hdr-user__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
	padding: 10px;
	border-bottom: 1px solid #eee;
}

.hdr-user__head .hdr-user__avatar {
	width: 42px;
	height: 42px;
	font-size: 15px;
}

.hdr-user__fio {
	display: block;
	overflow: hidden;
	color: #293041;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-overflow: ellipsis;
}

.hdr-user__sub {
	display: block;
	color: #8a8f99;
	font-size: 12px;
	line-height: 1.3;
}

.hdr-user__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-radius: 9px;
	color: #293041 !important;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none !important;
	transition: background .15s ease;
}

.hdr-user__link svg {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	fill: currentColor;
	opacity: .65;
}

.hdr-user__link:hover,
.hdr-user__link:focus {
	background: #ffdbbb;
	color: #293041 !important;
}

.hdr-user__link--exit {
	color: #b3453a !important;
}

.hdr-user__link--exit:hover,
.hdr-user__link--exit:focus {
	background: #fbeae7;
	color: #b3453a !important;
}

/* --- блок ЛК внутри раскрытого мобильного меню --- */
.hdr-mobile-user {
	width: 100%;
	margin-top: 1rem;
	padding: 14px;
	border: 1px solid rgba(41, 48, 65, 0.08);
	border-radius: 14px;
	background: #fdf6ef;
}

.hdr-mobile-user__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(41, 48, 65, 0.08);
}

.hdr-mobile-user__head .hdr-user__avatar {
	width: 44px;
	height: 44px;
	font-size: 16px;
}

.hdr-mobile-user__links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.hdr-mobile-user__links .hdr-user__link {
	flex: 1 1 45%;
	background: #fff;
}

.hdr-mobile-user__links .hdr-user__link--phone {
	flex: 1 1 100%;
	justify-content: center;
	background: #ffdbbb;
	font-weight: 700;
}

.hdr-mobile-user__login {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px;
	border-radius: 40px;
	background: #ffdbbb;
	color: #293041 !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none !important;
}

.hdr-mobile-user__login svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.hdr-mobile-user__note {
	margin: 8px 0 0;
	color: #8a8f99;
	font-size: 12px;
	line-height: 1.35;
	text-align: center;
}

