/* =========================================================
   VSH - DỊCH VỤ THEO DANH MỤC

   Card được render bằng:
   flatsome-child/templates/cpt/card.php

   Vì vậy file này CHỈ style layout/state của Element.
   Toàn bộ giao diện card dùng lại CSS .vsm-cpt-card của child theme.
   Pagination tiếp tục dùng .vsm-cpt-pagination hiện có của website.
========================================================= */

.vsh-service-category {
	position: relative;
	scroll-margin-top: 150px;
}

.vsh-service-category__results {
	position: relative;
	transition: opacity .18s ease;
}

.vsh-service-category.is-loading .vsh-service-category__results {
	opacity: .48;
	pointer-events: none;
}

.vsh-service-category__grid {
	display: grid;
	grid-template-columns:
		repeat(
			var(--vsh-service-cols-desktop, 3),
			minmax(0, 1fr)
		);
	gap: 20px;
}

/* Chỉ hỗ trợ card như grid item; không ghi đè giao diện card dùng chung. */
.vsh-service-category__grid > .vsm-cpt-card {
	min-width: 0;
	margin-top: 0;
	margin-bottom: 0;
}

.vsh-service-category__empty,
.vsh-service-category__notice {
	margin: 0;
	padding: 16px;
	background: var(--vsh-bg-soft, #f8fafc);
	border: 1px solid var(--vsh-border, #e5ebf2);
	border-radius: var(--vsh-radius, 10px);
	color: var(--vsh-text-muted, #607086);
	font-size: 13px;
	line-height: 1.6;
}

.vsh-service-category__loading {
	position: absolute;
	z-index: 5;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.vsh-service-category__spinner {
	display: block;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(25, 85, 181, .15);
	border-top-color: var(--vsh-blue, var(--primary-color));
	border-radius: 50%;
	animation: vshServiceSpin .7s linear infinite;
}

@keyframes vshServiceSpin {
	to {
		transform: rotate(360deg);
	}
}

/* Không style lại pagination, chỉ tạo khoảng cách trong Element. */
.vsh-service-category .vsm-cpt-pagination {
	margin-top: 26px;
}

@media (max-width: 849px) {
	.vsh-service-category__grid {
		grid-template-columns:
			repeat(
				var(--vsh-service-cols-tablet, 2),
				minmax(0, 1fr)
			);
		gap: 16px;
	}
}

@media (max-width: 549px) {
	.vsh-service-category__grid {
		grid-template-columns:
			repeat(
				var(--vsh-service-cols-mobile, 1),
				minmax(0, 1fr)
			);
		gap: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vsh-service-category__results {
		transition: none !important;
	}

	.vsh-service-category__spinner {
		animation-duration: 1.4s;
	}
}
