/* ─── Cabinet Material Widget ───────────────────────────────────────────── */

.hbc-cmat-wrap {
	--hbc-cmat-card-w: 325px;
	--hbc-cmat-card-h: 500px;
	--hbc-cmat-wall-angle: 30deg;
	--hbc-cmat-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	padding: 70px 4%;
	background: #f7f7f7;
	overflow: visible;
}

.hbc-cmat-wrap *,
.hbc-cmat-wrap *::before,
.hbc-cmat-wrap *::after {
	box-sizing: border-box;
}

.hbc-cmat-inner {
	display: flex;
	align-items: center;
	gap: 70px;
}

/* Left side: 3D Angled Gallery */

.hbc-cmat-visual {
	position: relative;
	width: 48%;
	flex-shrink: 0;
	user-select: none;
	-webkit-user-select: none;
}

.hbc-cmat-stage {
	width: 100%;
	height: calc(var(--hbc-cmat-card-h) + 50px);
	display: flex;
	align-items: center;
	overflow-x: auto;
	overflow-y: hidden;
	cursor: grab;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.hbc-cmat-stage::-webkit-scrollbar {
	display: none;
}

.hbc-cmat-stage.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto !important;
}

.hbc-cmat-deck {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	width: max-content;
	transform-style: preserve-3d;
}

.hbc-cmat-card {
	position: relative;
	width: var(--hbc-cmat-card-w);
	height: var(--hbc-cmat-card-h);
	background: #ffffff;
	cursor: pointer;
	transform-style: preserve-3d;
	flex-shrink: 0;
	border-radius: 2px;
	z-index: 1;
	will-change: transform;
	overflow: hidden;
}

.hbc-cmat-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	backface-visibility: hidden;
	image-rendering: -webkit-optimize-contrast;
	pointer-events: none;
}

.hbc-cmat-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 30px;
	background: rgba(0, 0, 0, 0.85);
	text-align: center;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	-webkit-font-smoothing: antialiased;
}

.hbc-cmat-card.is-active .hbc-cmat-overlay {
	opacity: 1;
	pointer-events: auto;
}

.hbc-cmat-card-title {
	margin: 0 0 15px;
	font-size: 1.8rem;
	font-weight: 700;
	line-height: 1.25;
	color: #ffffff;
	transform: translateY(20px);
	transition: transform 0.4s var(--hbc-cmat-ease);
}

.hbc-cmat-card-desc {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.9);
	transform: translateY(20px);
	transition: transform 0.4s var(--hbc-cmat-ease) 0.1s;
}

.hbc-cmat-card.is-active .hbc-cmat-card-title,
.hbc-cmat-card.is-active .hbc-cmat-card-desc {
	transform: translateY(0);
}

.hbc-cmat-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	opacity: 0;
	transform: scale(0.5);
	transition: opacity 0.3s var(--hbc-cmat-ease), transform 0.3s var(--hbc-cmat-ease), background-color 0.3s ease;
	pointer-events: auto;
}

.hbc-cmat-close:hover {
	background-color: #c90000;
}

.hbc-cmat-card.is-active .hbc-cmat-close {
	opacity: 1;
	transform: scale(1);
}

.hbc-cmat-close svg {
	width: 18px;
	height: 18px;
	stroke: #ffffff;
	stroke-width: 2.5;
	fill: none;
}

/* Desktop (>=1025px): 3D Angled Wall */

@media (min-width: 1025px) {
	.hbc-cmat-stage {
		perspective: 1000px;
		perspective-origin: 0% 50%;
		padding-left: 5%;
	}

	.hbc-cmat-deck {
		gap: 0;
		padding: 40px 20px 40px 0;
		transform: rotateY(var(--hbc-cmat-wall-angle));
		transform-origin: 0% 50%;
	}

	.hbc-cmat-card {
		transform: rotateY(calc(-1 * var(--hbc-cmat-wall-angle))) scale(0.8);
		box-shadow:
			0 5px 15px rgba(0, 0, 0, 0.08),
			0 15px 35px rgba(0, 0, 0, 0.05);
		border: 1px solid rgba(0, 0, 0, 0.05);
		margin-right: -25px;
		transition: transform 0.5s var(--hbc-cmat-ease), box-shadow 0.5s ease, z-index 0s 0.2s, filter 0.3s;
	}

	.hbc-cmat-card:last-child {
		margin-right: 0;
	}

	.hbc-cmat-card:not(.is-active):hover {
		transform: translateY(-20px) rotateY(calc(-1 * var(--hbc-cmat-wall-angle))) scale(0.84);
		z-index: 500 !important;
		box-shadow:
			0 30px 60px rgba(0, 0, 0, 0.15),
			0 10px 20px rgba(0, 0, 0, 0.1);
		filter: brightness(1.02);
		transition: transform 0.4s var(--hbc-cmat-ease), box-shadow 0.4s ease, z-index 0s;
	}

	.hbc-cmat-card.is-active {
		transform: translateY(0) rotateY(calc(-1 * var(--hbc-cmat-wall-angle))) translateZ(150px) scale(1);
		z-index: 1000 !important;
		box-shadow:
			0 50px 120px rgba(0, 0, 0, 0.35),
			0 20px 40px rgba(0, 0, 0, 0.15);
		filter: brightness(1);
		border-color: transparent;
		cursor: default;
		margin-right: 50px;
		margin-left: 50px;
		transition: transform 0.5s var(--hbc-cmat-ease), box-shadow 0.5s ease, z-index 0s;
	}
}

.hbc-cmat-content {
	flex: 1;
	min-width: 0;
}

.hbc-cmat-title {
	margin: 0 0 24px;
	padding: 0;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.2;
	color: #111111;
}

.hbc-cmat-highlight {
	color: #d60000;
}

.hbc-cmat-desc {
	margin-bottom: 26px;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.85;
	color: #4a4a4a;
}

.hbc-cmat-points {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.hbc-cmat-point {
	position: relative;
	padding-left: 28px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
	color: #222222;
}

.hbc-cmat-point::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 0;
	color: #d60000;
	font-weight: 800;
}

.hbc-cmat-step {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 10px;
	background: #111111;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1.2px;
	border-radius: 3px;
	z-index: 5;
	pointer-events: none;
}

/* ─── Tablet (≤1024px) ───────────────────────────────────────────────────── */

@media (max-width: 1024px) {
	.hbc-cmat-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 40px;
	}

	.hbc-cmat-visual {
		width: 100% !important;
	}

	.hbc-cmat-stage {
		height: auto;
		perspective: none;
		padding: 0;
		display: block;
		cursor: default;
		overflow: visible;
	}

	.hbc-cmat-deck {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 10px 20px 40px;
		gap: 15px;
		margin: 0;
		width: 100%;
		transform: none !important;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.hbc-cmat-deck::-webkit-scrollbar {
		display: none;
	}

	.hbc-cmat-card {
		flex: 0 0 85%;
		width: auto;
		max-width: var(--hbc-cmat-card-w);
		height: var(--hbc-cmat-card-h);
		transform: none !important;
		margin: 0 !important;
		border: none;
		border-radius: 8px;
		box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
		scroll-snap-align: center;
	}

	.hbc-cmat-card.is-active {
		transform: none !important;
		z-index: 2;
	}

	.hbc-cmat-card-title {
		font-size: 1.5rem;
	}

	.hbc-cmat-card-desc {
		font-size: 0.9rem;
	}

	.hbc-cmat-title {
		font-size: 32px;
	}

	.hbc-cmat-desc {
		font-size: 14px;
	}
}

/* ─── Mobile (≤767px) ────────────────────────────────────────────────────── */

@media (max-width: 767px) {
	.hbc-cmat-wrap {
		padding: 42px 18px;
	}

	.hbc-cmat-inner {
		gap: 34px;
	}

	.hbc-cmat-deck {
		padding: 6px 16px 30px;
		gap: 12px;
	}

	.hbc-cmat-overlay {
		padding: 22px;
	}

	.hbc-cmat-title {
		font-size: 28px;
	}

	.hbc-cmat-desc {
		font-size: 14px;
		line-height: 1.65;
	}
}
