/**
 * Homepage banner + products block.
 * Product cards reuse catalog-v2 card markup/styles.
 */

.home-banners {
	--hb-bg: #141518;
	--hb-panel: #2a2b2e;
	--hb-border: rgba(255, 255, 255, 0.08);
	--hb-accent: #ff7a00;
	--hb-text: #ffffff;
	--hb-muted: #9ca3b6;
	--hb-radius: 16px;

	position: relative;
	z-index: 2;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 40px 0 56px;
	box-sizing: border-box;
	color: var(--hb-text);
	font-family: Rubik, system-ui, -apple-system, sans-serif;
	clear: both;
	background: var(--hb-bg);
}

.home-banners__row {
	display: grid;
	grid-template-columns: minmax(0, 2.1fr) repeat(3, minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
	width: 100%;
	max-width: 1380px;
	margin: 0 auto 16px;
	padding: 0 28px;
	box-sizing: border-box;
}

.home-banners__row--banner-right {
	grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2.1fr);
}

.home-banners__products {
	display: contents;
}

.home-banners__product {
	min-width: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.home-banners__product .catalog-v2-card {
	flex: 1 1 auto;
	min-height: 320px;
}

.home-banners__product:hover .catalog-v2-card__image,
.home-banners__product:hover .catalog-v2-card__image-link img {
	transform: scale(1.08);
}

/* Match catalog ATC expand on product hover */
body.techno-home-banners .home-banners__product:hover .catalog-v2-card__atc.add_to_cart_button {
	width: auto !important;
	max-width: 120px !important;
	min-width: 32px !important;
	padding: 0 12px 0 0 !important;
	justify-content: flex-start !important;
	border-radius: 16px !important;
	background-color: #e86c03 !important;
	border-color: #e86c03 !important;
}

body.techno-home-banners .home-banners__product:hover .catalog-v2-card__atc.add_to_cart_button .__text {
	opacity: 1 !important;
	max-width: none !important;
}

.home-banners__row--banner-left .home-banners__banner {
	grid-column: 1;
}

.home-banners__row--banner-right .home-banners__banner {
	grid-column: 4;
}

.home-banners__banner {
	position: relative;
	display: block;
	min-height: 320px;
	border-radius: var(--hb-radius);
	overflow: hidden;
	text-decoration: none !important;
	color: inherit;
	background: var(--hb-panel);
	isolation: isolate;
}

.home-banners__banner-img,
.home-banners__banner-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.home-banners__banner-placeholder {
	background: linear-gradient(145deg, #2a2b2e 0%, #1a1b1e 100%);
}

.home-banners__banner:hover .home-banners__banner-img {
	transform: scale(1.04);
}

.home-banners__banner-scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.72) 100%);
	pointer-events: none;
	z-index: 1;
}

.home-banners__banner-label {
	position: absolute;
	left: 22px;
	right: 22px;
	bottom: 22px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: calc(100% - 44px);
}

.home-banners__banner-title {
	font-size: 22px;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.home-banners__banner-arrow {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	backdrop-filter: blur(6px);
	transition: background 0.2s ease, transform 0.2s ease;
}

.home-banners__banner:hover .home-banners__banner-arrow {
	background: var(--hb-accent);
	transform: translateX(2px);
}

/* Hide legacy Elementor product grids only after our block is mounted */
body.home.techno-home-banners-mounted .main-page-section-block-pr {
	display: none !important;
}

/* Hide Elementor scroll-hero when home-banners and/or home-hero is active */
body.home.techno-home-banners .main-page-scroll-img,
body.home.techno-home-banners .main-page-scroll,
body.home.techno-home-hero .main-page-scroll-img,
body.home.techno-home-hero .main-page-scroll {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	overflow: hidden !important;
}

body.home.techno-home-banners .e-con-top:has(.main-page-scroll-img),
body.home.techno-home-banners .elementor-element:has(> .main-page-scroll-img),
body.home.techno-home-hero .e-con-top:has(.main-page-scroll-img),
body.home.techno-home-hero .elementor-element:has(> .main-page-scroll-img) {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

/* Disable Elementor snap only when banners hide the old hero and theme hero is absent */
body.home.techno-home-banners:not(.techno-home-hero) #page {
	scroll-snap-type: none !important;
}

@media (max-width: 1100px) {
	.home-banners__row,
	.home-banners__row--banner-right {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	/* Banner first, then exactly 2 products per row block */
	.home-banners__banner {
		grid-column: 1 / -1 !important;
		order: -1;
		min-height: 220px;
	}

	.home-banners__products > .home-banners__product:nth-child(n + 3) {
		display: none !important;
	}

	.home-banners__product .catalog-v2-card {
		min-height: 280px;
	}

	.home-banners__banner-title {
		font-size: 18px;
	}
}

@media (max-width: 767px) {
	.home-banners {
		padding: 24px 0 36px;
	}

	.home-banners__row,
	.home-banners__row--banner-right {
		gap: 10px;
		padding: 0 12px;
	}

	.home-banners__banner {
		min-height: 180px;
		border-radius: 14px;
	}

	.home-banners__banner-label {
		left: 14px;
		right: 14px;
		bottom: 14px;
	}

	.home-banners__banner-title {
		font-size: 16px;
	}

	.home-banners__product .catalog-v2-card {
		min-height: 0;
	}
}
