/*
 * Кнопка профілю (обліковий запис WooCommerce) в шапці сайту.
 *
 * Підключається на всіх сторінках (functions.php → nmiu-header-account) і
 * не змінює решту стилів шапки: додає лише нову кнопку та підлаштовує ширину
 * селектора мови, щоб «кошик + профіль + мови» займали стільки ж, скільки
 * нижня кнопка меню «Про музей».
 */

/* ---------- Верхній ряд шапки (десктоп) ---------- */

header.header .header-wrap .content-wrap .top-wrap .account-wrap {
	display: flex;
	width: auto;
	height: 100%;
	aspect-ratio: 1/1;
	border-left: 2px solid var(--main-black);
	transition: var(--slow);
}

header.header .header-wrap .content-wrap .top-wrap .account-wrap .account-link {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 16px;
	font-size: 1.25em;
	line-height: 150%;
	font-weight: 600;
	color: var(--main-black);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

header.header .header-wrap .content-wrap .top-wrap .account-wrap .account-link span {
	display: none;
}

header.header .header-wrap .content-wrap .top-wrap .account-wrap .account-link::before {
	content: '';
	position: relative;
	width: 26px;
	min-width: 26px;
	aspect-ratio: 1/1;
	background: transparent;
	background-image: url(../img/account-icon-black.svg);
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	margin: 0px;
}

/* ---------- Мітка кількості на кошику: менший текст, щоб вміщались 2–3 цифри ---------- */

header.header .header-wrap .content-wrap .top-wrap .cart-wrap .cart-contents span.cart-count {
	width: auto;
	min-width: 18px;
	padding: 0 4px;
	border-radius: 9px;
	font-size: 0.6em;
	font-weight: 600;
	line-height: 100%;
}

/* ---------- Ширини: «кошик + профіль + мови» = ширині «Про музей» ---------- */

@media screen and (min-width: 1440px) {
	/* Звичайна шапка: селектор мови був 12.3%, тепер віддає місце кнопці профілю (62px). */
	header.header .header-wrap .content-wrap .top-wrap:has(.account-wrap) .languages-menu {
		width: calc(12.3% - 62px);
		min-width: calc(12.3% - 62px);
	}

	/* Шапка при прокручуванні (.fixed): мови заміщені бургером, місце бере пошук. */
	header.header.fixed .header-wrap .content-wrap .top-wrap .account-wrap {
		width: 62px;
	}

	header.header.fixed .header-wrap .content-wrap .top-wrap:has(.account-wrap) .search {
		width: calc(47.47% - 124px);
	}
}

/* ---------- Мобільне меню ---------- */

header.header .mobile-menu .buttons-wrap .account-wrap {
	display: none;
	width: 100%;
	transition: var(--slow);
	order: 1;
}

header.header .mobile-menu .buttons-wrap .account-wrap .account-link {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	padding: 16px 30px;
	font-size: 1.125em;
	line-height: 150%;
	font-weight: 600;
	color: var(--main-black);
	text-decoration: none;
	white-space: nowrap;
}

header.header .mobile-menu .buttons-wrap .account-wrap .account-link::before {
	content: '';
	position: relative;
	width: 26px;
	min-width: 26px;
	aspect-ratio: 1/1;
	background: var(--main-white);
	background-image: url(../img/account-icon-black.svg);
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	margin-right: 10px;
}

@media screen and (max-width: 767px) {
	/* Як і кошик: на телефоні кнопка профілю переїжджає з верхнього ряду в мобільне меню. */
	header.header .header-wrap .content-wrap .top-wrap .account-wrap {
		display: none;
	}

	header.header .mobile-menu .buttons-wrap .account-wrap {
		display: flex;
		border-bottom: 2px solid var(--main-black);
	}

	header.header .mobile-menu .buttons-wrap .account-wrap .account-link {
		padding: 15px 20px;
	}
}
