/* Unified WooCommerce cards based on the Home Product Category card.
 * Layout column counts remain controlled by existing Flatsome row classes.
 */

.product-category .box,
.woocommerce .product-small .box,
.ktt-related-products-section .product-small .box {
	position: relative;
	height: 100%;
	overflow: hidden;
	border: 0 !important;
	border-radius: 24px !important;
	background: #fff;
	box-shadow: none;
	transform: translateY(0);
	transition: transform .35s ease, box-shadow .35s ease;
}

.product-category .box:hover,
.woocommerce .product-small .box:hover,
.ktt-related-products-section .product-small .box:hover {
	transform: translateY(-4px);
	box-shadow: 0 15px 36px rgba(0, 0, 0, .05);
}

.product-category .box-image,
.woocommerce .product-small .box-image,
.ktt-related-products-section .product-small .box-image {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 24px !important;
	aspect-ratio: 1 / 1;
}

.product-category .box-image img,
.woocommerce .product-small .box-image img,
.ktt-related-products-section .product-small .box-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .45s ease;
}

.product-category .box:hover .box-image img,
.woocommerce .product-small .box:hover .box-image img,
.ktt-related-products-section .product-small .box:hover .box-image img {
	transform: scale(1.04);
}

.product-category .box-image::after,
.woocommerce .product-small .box-image::after,
.ktt-related-products-section .product-small .box-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: rgba(0, 0, 0, .05);
}

.product-category .box-text,
.woocommerce .product-small .box-text,
.ktt-related-products-section .product-small .box-text {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	min-height: 64px;
	overflow: hidden;
	padding: 15px 15px 15px 25px !important;
	background: rgba(0, 0, 0, .30);
	text-align: left !important;
	transition: color .3s ease;
}

.product-category .box-text::before,
.woocommerce .product-small .box-text::before,
.ktt-related-products-section .product-small .box-text::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	z-index: 0;
	width: 0;
	background: rgb(212, 33, 40);
	transition: width .45s ease;
}

.product-category .box:hover .box-text::before,
.woocommerce .product-small .box:hover .box-text::before,
.ktt-related-products-section .product-small .box:hover .box-text::before {
	width: 100%;
}

.product-category .box-text-inner,
.woocommerce .product-small .box-text > *,
.ktt-related-products-section .product-small .box-text > * {
	position: relative;
	z-index: 1;
}

.product-category .box-text h5,
.product-category .box-text .header-title,
.woocommerce .product-small .box-text p,
.woocommerce .product-small .box-text span,
.woocommerce .product-small .box-text a,
.ktt-related-products-section .product-small .box-text p,
.ktt-related-products-section .product-small .box-text span,
.ktt-related-products-section .product-small .box-text a {
	margin: 0;
	color: #fff !important;
	text-align: left;
	opacity: 1 !important;
}

.product-category .box-text h5,
.product-category .box-text .header-title {
	line-height: 1.2;
}

.woocommerce .product-small .box-text .product-cat,
.ktt-related-products-section .product-small .box-text .product-cat {
	margin-bottom: 3px;
	color: rgba(255, 255, 255, .78) !important;
	font-size: 11px;
	line-height: 1.25;
}

.woocommerce .product-small .box-text .product-title a,
.ktt-related-products-section .product-small .box-text .product-title a {
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.35;
	letter-spacing: .42px !important;
}

.woocommerce .product-small .box-text .price,
.woocommerce .product-small .box-text .amount,
.ktt-related-products-section .product-small .box-text .price,
.ktt-related-products-section .product-small .box-text .amount {
	color: #fff !important;
}

/* Ẩn heading "SẢN PHẨM" ở đầu cột nội dung của Shop. */
body.woocommerce-shop .ktt-archive-section-title {
	display: none !important;
}

/* Card nhỏ từ 5 cột trở lên: giảm tỷ lệ bo góc, chữ và khoảng đệm. */
@media (min-width: 850px) {
	.large-columns-5 > .product-category .box,
	.large-columns-5 > .product-category .box-image,
	.large-columns-5 > .product-small .box,
	.large-columns-5 > .product-small .box-image,
	.large-columns-6 > .product-category .box,
	.large-columns-6 > .product-category .box-image,
	.large-columns-6 > .product-small .box,
	.large-columns-6 > .product-small .box-image {
		border-radius: 18px !important;
	}

	.large-columns-5 > .product-category .box-text,
	.large-columns-5 > .product-small .box-text,
	.large-columns-6 > .product-category .box-text,
	.large-columns-6 > .product-small .box-text {
		min-height: 56px;
		padding: 11px 10px 11px 16px !important;
	}

	.large-columns-5 > .product-category .header-title,
	.large-columns-5 > .product-small .product-title a,
	.large-columns-6 > .product-category .header-title,
	.large-columns-6 > .product-small .product-title a {
		font-size: 13px !important;
		letter-spacing: .25px !important;
	}

	.large-columns-5 > .product-small .product-cat,
	.large-columns-6 > .product-small .product-cat {
		font-size: 9px !important;
	}
}

/* Card 3 cột trên tablet: dùng tỷ lệ trung gian. */
@media (min-width: 550px) and (max-width: 849px) {
	.product-category .box,
	.product-category .box-image,
	.woocommerce .product-small .box,
	.woocommerce .product-small .box-image {
		border-radius: 20px !important;
	}

	.product-category .box-text,
	.woocommerce .product-small .box-text {
		min-height: 58px;
		padding: 12px 11px 12px 17px !important;
	}

	.product-category .header-title,
	.woocommerce .product-small .product-title a {
		font-size: 13px !important;
	}
}

@media (max-width: 549px) {
	.product-category .box,
	.product-category .box-image,
	.woocommerce .product-small .box,
	.woocommerce .product-small .box-image,
	.ktt-related-products-section .product-small .box,
	.ktt-related-products-section .product-small .box-image {
		border-radius: 14px !important;
	}

	.product-category .box-text,
	.woocommerce .product-small .box-text,
	.ktt-related-products-section .product-small .box-text {
		min-height: 48px;
		padding: 9px 8px 9px 11px !important;
	}

	.product-category .header-title,
	.woocommerce .product-small .box-text .product-title a,
	.ktt-related-products-section .product-small .box-text .product-title a {
		font-size: 11px !important;
		letter-spacing: .15px !important;
	}

	.woocommerce .product-small .box-text .product-cat,
	.ktt-related-products-section .product-small .box-text .product-cat {
		font-size: 8px;
	}
}
