/**
 * Process Section ("Quy trình hợp tác", trang chủ).
 * Cấu trúc 2 cột: Cột trái Timeline các bước, Cột phải ảnh minh họa Sticky.
 * Scroll Highlight mượt mà, không lộ nét đường kẻ xuyên qua ô tròn số.
 *
 * @package TMNhanPhat
 */

.process-home {
	--process-brand-blue: var(--process-heading-blue, var(--color-primary, #046AB5));
	--process-brand-red: var(--process-heading-red, #E31F2B);
	--process-circle-size: clamp(48px, 4vw, 56px);
	--process-line-width: 2px;
	position: relative;
	isolation: isolate;
	padding-bottom: 100px;
	background-color: var(--process-bg, #ffffff);
}

.process-home__background {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.process-home__bg-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.process-home__container {
	position: relative;
	z-index: 1;
	max-width: var(--process-container-width, var(--container-max-width));
}

/* ==================== HEADER ==================== */
.process-home__header {
	margin-inline: auto;
	max-width: 820px;
	text-align: center;
	margin-bottom: clamp(36px, 5vw, 60px);
}

.process-home__heading {
	margin: 0 0 clamp(10px, 1.4vw, 18px);
	font-size: clamp(32px, 4vw, min(56px, var(--process-heading-size, 56px)));
	font-weight: min(900, var(--process-heading-weight, 900));
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.process-home__heading-blue {
	color: var(--process-heading-blue, #046AB5);
}

.process-home__heading-red {
	color: var(--process-heading-red, #E31F2B);
}

.process-home__description {
	margin: 0 auto;
	max-width: 820px;
	color: var(--process-desc-color, #464646);
	font-size: clamp(16px, calc(20 * var(--fig1px)), 20px);
	line-height: 1.5;
}

/* ==================== CONTENT 2 CỘT ==================== */
.process-home__content {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: clamp(32px, 5vw, 70px);
	align-items: start;
}

.process-home__timeline {
	width: 100%;
}

/* ==================== TIMELINE STEPS ==================== */
.process-home__steps {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Đường kẻ dọc Timeline: chạy chính xác từ tâm số 1 đến tâm số cuối cùng */
.process-home__steps::before {
	content: "";
	position: absolute;
	top: calc(var(--process-circle-size) / 2);
	bottom: calc(var(--process-circle-size) / 2);
	left: calc(var(--process-circle-size) / 2 - (var(--process-line-width) / 2));
	width: var(--process-line-width);
	background-color: var(--process-line-color, #E5E7EB);
	z-index: 1;
}

/* Mỗi bước có min-height để tạo đủ không gian cuộn tự nhiên theo tầm mắt */
.process-step {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: clamp(16px, 2vw, 24px);
	min-height: clamp(170px, 22vh, 220px);
	padding-bottom: 24px;
	/* TUYỆT ĐỐI KHÔNG đặt opacity lên .process-step cha để không làm mờ nền ô tròn số */
}

.process-step:last-child {
	min-height: auto;
	padding-bottom: 0;
}

/* Ô tròn số (Badge): nền ĐẶC để che đường kẻ phía sau hoàn toàn */
.process-step__marker {
	position: relative;
	z-index: 2;
	flex: 0 0 var(--process-circle-size);
	width: var(--process-circle-size);
	height: var(--process-circle-size);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	/* Nền đặc che đường line bên dưới */
	background-color: #ffffff;
	border: 2px solid #E5E7EB;
	color: #9CA3AF;
	font-size: clamp(17px, 1.8vw, 22px);
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: background-color 0.35s ease,
		border-color 0.35s ease,
		color 0.35s ease,
		transform 0.35s ease,
		box-shadow 0.35s ease;
}

.process-step__icon {
	width: 55%;
	height: 55%;
	object-fit: contain;
}

/* Trạng thái Active của Marker: Đổi màu thương hiệu + phóng nhẹ + vòng glow */
.process-step.is-active .process-step__marker {
	background-color: var(--process-circle-active-bg, #E31F2B);
	border-color: var(--process-circle-active-bg, #E31F2B);
	color: #ffffff;
	transform: scale(1.08);
	box-shadow: 0 0 0 4px rgba(227, 31, 43, 0.18), 0 4px 12px rgba(227, 31, 43, 0.25);
}

/* Nội dung chữ: Căn thẳng hàng tâm với ô tròn số */
.process-step__body {
	padding-top: calc((var(--process-circle-size) - 1.21em) / 2);
	opacity: 0.3;
	transform: translateY(6px);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Chỉ làm mờ/sáng phần body chữ — marker giữ nguyên nền đặc */
.process-step.is-active .process-step__body {
	opacity: 1;
	transform: translateY(0);
}

.process-step__title {
	margin: 0 0 8px;
	color: #6B7280;
	font-size: clamp(19px, 2vw, 25px);
	font-weight: 700;
	line-height: 1.25;
	transition: color 0.35s ease;
}

.process-step.is-active .process-step__title {
	color: var(--process-active-text, #111827);
}

.process-step__description {
	margin: 0;
	color: #4B5563;
	font-size: clamp(14px, 1.1vw, 16px);
	line-height: 1.6;
}

/* ==================== CỘT ẢNH STICKY (BÊN PHẢI) ==================== */
.process-home__media {
	position: sticky;
	top: calc(var(--header-height, 80px) + 30px);
	align-self: start;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

/* Khung card bo góc viền kép thanh lịch theo mẫu */
.process-home__card {
	position: relative;
	width: 100%;
	max-width: 520px;
	background-color: #ffffff;
	border: 1.5px solid #E2E8F0;
	border-radius: 10px;
	padding: 14px 14px 16px 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.35s ease;
}

.process-home__card:hover {
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.09);
}

.process-home__card-media {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 10px;
	background-color: #f1f5f9;
}

.process-home__image {
	display: block;
	width: 100%;
	height: clamp(280px, 38vh, 390px);
	object-fit: cover;
	object-position: center;
	border-radius: 10px;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hiệu ứng Fade mượt mà khi chuyển ảnh */
.process-home__image.is-fading {
	opacity: 0;
	transform: scale(0.97);
}

/* Khối tiêu đề caption bên dưới ảnh */
.process-home__card-caption {
	padding-top: 14px;
	padding-bottom: 2px;
	text-align: center;
}

.process-home__card-title {
	margin: 0;
	color: #1E3A8A;
	font-size: clamp(16px, 1.4vw, 19px);
	font-weight: 700;
	line-height: 1.35;
	transition: opacity 0.25s ease, transform 0.25s ease;
	font-size: 0.9rem;
	font-weight: 600;
	color: #475569;
}


.process-home__card-title.is-fading {
	opacity: 0;
	transform: translateY(4px);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
	.process-home__content {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.process-home__media {
		position: static;
		margin-top: 10px;
	}

	.process-home__media-inner {
		max-width: 100%;
	}

	.process-step {
		min-height: auto;
		padding-bottom: 28px;
	}

	.process-step__body {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 575px) {

	.process-step {
		gap: 14px;
		padding-bottom: 24px;
	}

	.process-step__marker {
		font-size: 16px;
	}

	.process-step__title {
		font-size: 18px;
	}

	.process-step__description {
		font-size: 13.5px;
	}

	.process-home__image {
		height: 240px;
	}
}