/* tandem.kz — доработки шаблона (2026-10-16). Подключается в header.php после template_styles.css. */

/* ---------- Каталог партнёра: на всю ширину экрана, шрифт растёт вместе с экраном ---------- */

body.partner-wide {
	--partner-font: clamp(12px, calc(0.55vw + 5px), 17px);
	--partner-sidebar-font: clamp(13px, calc(0.45vw + 6.5px), 17px);
	--partner-gutter: clamp(15px, 2.5vw, 48px);
	--partner-sidebar-width: clamp(260px, 16vw, 340px);
}

/* на всю ширину — только шапка и область каталога; подвал и слайдер «Каталоги и лифлеты» остаются стандартной ширины */
body.partner-wide .bx-header,
body.partner-wide .container_catalog_content,
body.partner-wide .container_catalog_content .container {
	max-width: none;
}

body.partner-wide .bx-header,
body.partner-wide .container_catalog_content {
	padding-left: var(--partner-gutter);
	padding-right: var(--partner-gutter);
}

@media (min-width: 992px) {
	body.partner-wide .bx-site > .col-lg-3 {
		flex: 0 0 var(--partner-sidebar-width);
		max-width: var(--partner-sidebar-width);
	}

	body.partner-wide .bx-site > .col-lg-9 {
		flex: 1 1 0;
		max-width: none;
		min-width: 0;
	}
}

body.partner-wide .table_names_tabulate,
body.partner-wide .table_names_tabulate > div,
body.partner-wide .non-guest-catalog .table_title_name,
body.partner-wide .non-guest-catalog .table_board_code_name,
body.partner-wide .non-guest-catalog .table_upakovka,
body.partner-wide .non-guest-catalog .table_stock,
body.partner-wide .non-guest-catalog .table_price,
body.partner-wide .non-guest-catalog .product-item-amount-field {
	font-size: var(--partner-font);
}

body.partner-wide .side_bar_catalog a {
	font-size: var(--partner-sidebar-font);
}

/* ---------- Метка NEW: товар добавлен на сайт меньше месяца назад ---------- */

.badge_new {
	display: inline-block;
	margin-right: 6px;
	padding: 2px 6px;
	border-radius: 4px;
	background: #e30613;
	color: #fff;
	font-size: max(10px, 0.75em);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.03em;
	vertical-align: middle;
	white-space: nowrap;
}

.product_div.product_div_new,
.product_div.product_div_new:hover,
.product-item-title_new,
.product-item-title_new a {
	color: #e30613;
}

/* ---------- Карточка товара ---------- */

.bx-catalog-element {
	padding-left: clamp(15px, 1.5vw, 30px);
}

.tandem-product-title {
	margin: 10px 0 24px;
	color: #193967;
	font-size: clamp(22px, calc(1vw + 12px), 30px);
	font-weight: 700;
	line-height: 1.25;
}

.tandem-product-title_new {
	color: #e30613;
}

.tandem-product-title .badge_new {
	margin-right: 10px;
	font-size: 14px;
	vertical-align: 4px;
}

.bx-catalog-element .product-item-detail-slider-container {
	border: 1px solid #e3e6ea;
	border-radius: 15px;
	overflow: hidden;
	background: #fff;
}

/* фото и панель покупки — на всю ширину, панель под фото */
.bx-catalog-element .tandem-photo-col,
.bx-catalog-element .tandem-pay-col {
	flex: 0 0 100%;
	max-width: 100%;
}

.bx-catalog-element .tandem-pay-col {
	margin-top: 20px;
}

/* широкая панель: слева оценки, цена, характеристики; справа количество и кнопка */
@media (min-width: 768px) {
	.bx-catalog-element .product-item-detail-pay-block {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: 40px;
		align-items: start;
	}

	/* слева по порядку: оценки, цена, характеристики (строки 1–3) */
	.bx-catalog-element .product-item-detail-pay-block > * {
		grid-column: 1;
	}

	/* справа: количество напротив оценок и цены, кнопка — напротив характеристик */
	.bx-catalog-element .product-item-detail-pay-block > [data-entity="quantity-block"],
	.bx-catalog-element .product-item-detail-pay-block > [id$="_not_avail"] {
		grid-column: 2;
		grid-row: 1 / span 2;
	}

	.bx-catalog-element .product-item-detail-pay-block > [data-entity="main-button-container"] {
		grid-column: 2;
		grid-row: 3;
	}
}

.bx-catalog-element .product-item-detail-pay-block {
	padding: 24px;
	background: #fff;
	border: 1px solid #e3e6ea;
	border-radius: 15px;
	box-shadow: 0 2px 10px rgba(25, 57, 103, 0.06);
	text-align: left;
}

.bx-catalog-element .product-item-detail-pay-block .text-center,
.bx-catalog-element .product-item-detail-pay-block .product-item-detail-info-container-title {
	text-align: left !important;
}

.bx-catalog-element .product-item-detail-pay-block .bx-rating {
	text-align: left;
}

.bx-catalog-element .product-item-detail-price-current {
	color: #b02420;
	font-size: 30px;
	font-weight: 700;
	text-align: left;
}

.tandem-price-unit {
	margin-bottom: 4px;
	color: #6c757d;
	font-size: 14px;
}

.tandem-product-info {
	margin: 0 0 18px;
	padding: 12px 0;
	list-style: none;
	border-top: 1px solid #eef0f3;
	border-bottom: 1px solid #eef0f3;
}

.tandem-product-info li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 5px 0;
	font-size: 14px;
}

.tandem-product-info__name {
	color: #6c757d;
}

.tandem-product-info__value {
	color: #212121;
	font-weight: 600;
	text-align: right;
}

.bx-catalog-element .product-item-detail-pay-block .product-item-amount-field-container {
	margin-left: 0;
	margin-right: 0;
}

.bx-catalog-element .product-item-detail-buy-button.btn-primary,
.product-item-detail-short-card-btn .btn-primary {
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	background: #193967;
	border-color: #193967;
	border-radius: 6px;
	font-weight: 700;
}

.bx-catalog-element .product-item-detail-buy-button.btn-primary:hover,
.bx-catalog-element .product-item-detail-buy-button.btn-primary:focus,
.product-item-detail-short-card-btn .btn-primary:hover {
	background: #0f2748;
	border-color: #0f2748;
}

.tandem-not-available {
	padding: 12px 16px;
	background: #f1f3f5;
	border-radius: 6px;
	color: #6c757d;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-align: center;
	text-transform: uppercase;
}

.product-item-detail-short-card-btn .btn-link {
	color: #6c757d;
	font-weight: 700;
	text-decoration: none;
}

.bx-catalog-element .product-item-detail-tab.active .product-item-detail-tab-link,
.bx-catalog-element .product-item-detail-tab-link:hover {
	color: #193967;
}

.bx-catalog-element .product-item-detail-tab.active:after {
	background: #193967;
}

/* Гость: без панели покупки — только название и фото.
   Плавающая мини-панель считает позицию от панели покупки; когда та скрыта, мини-панель висит поверх шапки — гостю не нужна. */
.tandem-guest .tandem-pay-col,
.tandem-guest .product-item-detail-short-card-fixed {
	display: none !important;
}

/* «Похожие товары» / «Вы недавно смотрели» под карточкой — как плитки гостевого каталога */
.tandem-related,
.tandem-related .row {
	margin-left: 0;
	margin-right: 0;
}

/* тот же отступ, что у карточки (.bx-catalog-element) — блоки встают ровно под название товара */
.tandem-related {
	padding-left: clamp(15px, 1.5vw, 30px);
}

.tandem-related > .col,
.tandem-related .row > .col {
	padding-left: 0;
	padding-right: 0;
}

.tandem-related .catalog-block-header {
	margin: 10px 0 24px;
	padding: 0;
	color: #193967;
	font-size: 22px;
	font-weight: 700;
	text-align: left;
	text-transform: none;
	border: 0;
}

.tandem-related .row.product-item-list-col-4,
.tandem-related .row.product-item-list-col-3,
.tandem-related .row.product-item-list-col-2 {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 24px;
	margin: 0;
}

/* заголовок блока — только если в нём есть товары (JS компонентов его не показывает) */
.tandem-related [data-entity="parent-container"]:has(.product-item) > .catalog-block-header {
	display: block !important;
	opacity: 1 !important;
}

.tandem-related .product-item-small-card,
.tandem-related .product-item-big-card {
	display: flex;
	width: auto;
	max-width: none;
	flex: none;
	padding: 0;
	margin: 0;
}

/* высоту плиткам выставляет JS в footer.php одной на всю страницу — здесь она своя, по самой высокой в ряду */
.tandem-related .product-item-container {
	display: flex;
	flex: 1;
	width: 100%;
	height: auto !important;
	margin-top: 0;
}

/* !important перебивает <style>.product-item{display:none}</style> из /catalog/index.php для партнёра */
.tandem-related .product-item {
	display: block !important;
	flex: 1;
	height: auto !important;
}

/* как в гостевом каталоге: только фото и название, без цены и кнопок */
.tandem-related .product-item-info-container {
	display: none !important;
}

.tandem-related .product-item-image-wrapper {
	padding-top: 85%;
}

.tandem-related .product-item-title {
	white-space: normal;
	text-overflow: clip;
	overflow: visible;
	padding: 20px;
}

.tandem-related .product-item-title a {
	text-decoration: none !important;
	font-size: 16px;
	font-weight: 700;
}

/* ---------- Главная: блок «Новинки» ---------- */

.section-new-products {
	padding-bottom: 20px;
}

.section-new-products .slider_1_title {
	margin-bottom: 30px;
}

.new-products-slider .slick-track {
	display: flex;
	padding: 10px 0;
}

.new-products-slider .slick-slide {
	height: auto;
}

.new-products-slider .slick-slide > div {
	height: 100%;
}

.new-product-card {
	height: 100%;
	padding: 0 10px;
}

.new-product-card__link {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding: 20px 14px 18px;
	background: #fff;
	border: 1px solid #e3e6ea;
	border-radius: 15px;
	text-decoration: none !important;
	transition: box-shadow 0.15s ease, background 0.15s ease;
}

.new-product-card__link:hover {
	background: #f5f9ff;
	box-shadow: 0 4px 14px rgba(25, 57, 103, 0.15);
}

.new-product-card__link .badge_new {
	position: absolute;
	top: 12px;
	left: 12px;
}

.new-product-card__img {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 180px;
}

.new-product-card__img img {
	max-width: 100%;
	max-height: 180px;
	object-fit: contain;
}

.new-product-card__name {
	margin-top: 14px;
	color: #b02420;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}
