/**
 * Блок корзины/иконок в шапке — как в React (HeaderIcons, Container, UpContainer, DownContainer, MinPrice, Card).
 * Разметка: .cart_cont > .cart > #flushTopCart > .cart-header (.cart-navigation + .min-order-message).
 */

/* Обёртка блока = без лишней вёрстки, выравнивание по контенту */
.cart_cont {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

/* Внешний контейнер иконок = .headerIcons в React */
.cart_cont .cart {
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 999;
}

/* Внутренний контейнер = .Container в React (колонка: строка иконок + блок мин. заказа) */
#flushTopCart .cart-header,
.cart-header {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	gap: 0;
	font-family: "Montserrat", sans-serif;
	position: relative;
}

/* Строка иконок = .UpContainer в React (чуть уменьшено) */
.cart-navigation {
	display: flex;
	align-items: center;
	gap: 6px;
	z-index: 9991;
}

/* Одна кнопка (Сравнить, Избранное, Корзина) = .headerIcon в React */
.cart-navigation .nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	margin: 0;
	text-decoration: none;
	color: #1a1a1a;
	font-size: 13px;
	font-weight: 500;
	font-family: "Montserrat", sans-serif;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	padding: 6px 10px;
	border-radius: 8px;
	position: relative;
	background: transparent;
	min-width: 52px;
	border: none;
	cursor: pointer;
}

.cart-navigation .nav-item:hover {
	background: rgba(255, 204, 51, 0.1);
	color: #1a1a1a;
}

.cart-navigation .nav-item:active {
	transform: translateY(0);
}

.cart-navigation .nav-item.active {
	background: rgba(255, 204, 51, 0.08);
}

/* Иконка = обёртка svg (увеличенный размер) */
.cart-navigation .nav-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	position: relative;
}

.cart-navigation .nav-icon svg {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	stroke: currentColor;
}

.cart-navigation .nav-item span {
	font-size: 11px;
	font-weight: 500;
	font-family: "Montserrat", sans-serif;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
}

/* Счётчики на иконках (корзина, избранное, сравнение) */
.cart-navigation .cart-count,
.cart-navigation .wishlist-count,
.cart-navigation .compare-count {
	position: absolute;
	top: -5px;
	right: -10px;
	background: linear-gradient(135deg, #ffcc33 0%, #ffcc33 50%, #ffcc33 100%);
	color: #1a1a1a;
	border-radius: 50%;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 10px;
	font-weight: 700;
	box-shadow:
		0 2px 6px rgba(255, 204, 51, 0.4),
		0 0 0 2px rgba(255, 255, 255, 1);
	box-sizing: border-box;
	line-height: 1;
	font-family: "Montserrat", sans-serif;
}

/* Блок минимального заказа = .minPrice в React */
.cart-header .min-order-message {
	background: linear-gradient(135deg, #fff9e6, #fff5cc);
	border: 1px solid rgba(255, 204, 51, 0.3);
	border-radius: 12px;
	color: #1a1a1a;
	display: flex;
	font-size: 12px;
	font-weight: 600;
	margin-top: 6px;
	padding: 6px 10px;
	text-align: center;
	width: 100%;
	justify-content: center;
	box-shadow:
		0 2px 6px rgba(255, 204, 51, 0.15),
		inset 0 1px 2px rgba(255, 255, 255, 0.6);
	transition: all 0.3s ease;
	position: relative;
	cursor: default;
	opacity: 0.7;
	pointer-events: none;
	box-sizing: border-box;
	font-family: "Montserrat", sans-serif;
	align-items: center;
}

.cart-header .min-order-message span {
	white-space: nowrap;
}
#flushTopCart {
	width: 100%;
}

/* ПК-версия: скрываем кнопки "Домой" и "Каталог" в шапке, оставляем только на мобильной нижней панели */
@media (min-width: 1100px) {
	.cart-navigation .nav-item-home,
	.cart-navigation .nav-item-catalog {
		display: none;
	}
}

/* 960px — компактнее как в React */
@media (max-width: 960px) {
	.cart-navigation .nav-item {
		min-width: 48px;
		padding: 6px 8px;
	}

	.cart-navigation .nav-item span {
		font-size: 10px;
	}

	.cart-header .min-order-message {
		font-size: 11px;
		padding: 6px 10px;
	}
}

/* Мобильная нижняя панель: корзина + избранное + сравнить (как в приложениях) */
@media (max-width: 1099px) {
	/* Панель корзины всегда видна внизу (переопределяем возможное display:none из tsk_header_bottom) */
	.newhead-general .tsk-obl-bottom .cart_cont,
	.cart_cont {
		display: flex !important;
	}

	body {
		padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
	}

	.cart_cont {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: auto;
		width: 100%;
		justify-content: center;
		z-index: 9998;
		padding: 8px 0px;
		background: rgba(255, 255, 255, 0.98);
		backdrop-filter: blur(20px);
		-webkit-backdrop-filter: blur(20px);
		border-top: 1px solid rgba(0, 0, 0, 0.08);
		box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
	}

	.cart_cont .cart {
		width: 100%;
		max-width: 100%;
		justify-content: space-between;
		gap: 0;
	}

	.cart-header {
		width: 100%;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	.cart-header .min-order-message {
		display: none;
	}

	.cart-navigation {
		flex: 1;
		justify-content: space-between;
		gap: 4px;
	}

	.cart-navigation .nav-item {
		flex: 1;
		min-width: 0;
		max-width: 120px;
		padding: 8px 6px;
		gap: 4px;
	}

	.cart-navigation .nav-item span {
		font-size: 10px;
	}

	.cart-navigation .nav-icon {
		width: 26px;
		height: 26px;
	}

	/* Z-index выпадающей корзины задаётся в template (мобильная панель bottom: 0, полностью скрыта при закрытии) */
}

@media (max-width: 768px) {
	.cart-navigation .nav-item {
		min-width: 0;
		padding: 6px 4px;
	}

	.cart-navigation .nav-item span {
		font-size: 11px;
	}

	.cart-navigation .nav-icon svg {
		width: 22px;
		height: 22px;
	}

	.cart-header .min-order-message {
		font-size: 10px;
		padding: 6px 8px;
	}
}
/* Планшеты: делаем оформление и порядок иконок как на мобильной версии */
@media (min-width: 769px) and (max-width: 1099px) {
	/* Порядок иконок справа налево */
	.cart-navigation {
		flex-direction: row-reverse;
	}

	/* Размер подписи под иконкой как на мобилке */
	.cart-navigation .nav-item span {
		font-size: 11px;
	}

	/* Размер иконок как на мобилке */
	.cart-navigation .nav-icon svg {
		width: 22px;
		height: 22px;
	}
}
