/* ==================================================================
 * Thẻ sản phẩm – dùng chung cho danh mục, trang chủ, related, search
 * Markup Flatsome:
 *   lưới Woo:      .product-small.col > .col-inner > .badge-container + .product-small.box
 *   [ux_products]: .col > .col-inner > .badge-container + .product-small.box
 * -> khung thẻ đặt trên .product-small.box (có ở cả hai), badge nằm đè góc trên.
 * ================================================================== */

.col-inner:has(> .product-small.box) {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.product-small.box {
	display: flex;
	flex-direction: column;
	flex: 1;
	height: 100%;
	background: #fff;
	border: 1px solid var(--cv-border);
	border-radius: var(--cv-radius);
	overflow: hidden;
	box-shadow: none;
	transition: box-shadow .25s var(--cv-ease), border-color .25s var(--cv-ease), transform .25s var(--cv-ease);
}

.col-inner:hover > .product-small.box {
	border-color: transparent;
	box-shadow: var(--cv-shadow-lg);
	transform: translateY(-2px);
}

/* badge đi cùng thẻ khi thẻ nhấc lên */
.col-inner > .badge-container {
	transition: transform .25s var(--cv-ease);
}

.col-inner:hover > .badge-container {
	transform: translateY(-2px);
}

/* bỏ box-shadow mặc định của Flatsome (box-shadow-1, depth) */
.product-small.col .col-inner[class*="box-shadow"],
.product-small.box[class*="box-shadow"] {
	box-shadow: none;
}

/* ---- ảnh ---- */

.product-small .box-image {
	background: var(--cv-surface-alt);
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.product-small .box-image > div:first-child,
.product-small .box-image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.product-small .box-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 6%;
	transition: transform .4s var(--cv-ease);
}

.product-small.box:hover .box-image img {
	transform: scale(1.04);
}

/* Quick view */
.product-small .grid-tools {
	padding: 0;
}

.product-small .grid-tools a.quick-view {
	background: rgba(15, 42, 40, .85);
	font-family: var(--cv-font-heading);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .02em;
	text-transform: none;
	padding: 10px 0;
}

/* ---- badge giảm giá ---- */

.product-small .badge-container {
	margin: 12px 0 0 12px;
}

.badge-container .badge {
	height: auto;
	width: auto;
	margin: 0;
}

.badge-container .badge-inner,
.badge-container .badge-inner.on-sale {
	height: auto;
	width: auto;
	min-width: 0;
	padding: 4px 8px;
	border: 0;
	border-radius: var(--cv-radius-sm);
	background: var(--cv-accent);
	color: #fff;
	font-family: var(--cv-font-heading);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	white-space: nowrap;
}

/* ---- phần chữ ---- */

.product-small .box-text {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 14px 14px 16px;
	text-align: left !important; /* [ux_products] gắn .text-center */
}

/* .text-center > div của Flatsome đặt margin auto -> các khối co lại giữa thẻ */
.product-small .box-text > div {
	width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.product-small.box .price-wrapper .price {
	display: flex;
	justify-content: flex-start;
}

.product-small .box-text .category {
	margin-bottom: 4px;
	font-family: var(--cv-font-body);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	color: var(--cv-primary);
	opacity: 1;
}

.product-small .product-title {
	margin-bottom: 8px;
	font-family: var(--cv-font-body);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: 0;
	max-height: none;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	min-height: 2.9em;
}

.product-small .product-title a,
#main .product-small .product-title a {
	color: var(--cv-text);
}

.product-small .product-title a:hover,
#main .product-small .product-title a:hover {
	color: var(--cv-primary);
}

/* giá: giá sale + giá gốc cùng một dòng */
.product-small .price-wrapper {
	margin-top: auto;
}

.product-small .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	font-family: var(--cv-font-heading);
}

.product-small .price ins {
	order: -1;
	text-decoration: none;
}

.product-small .price ins .amount,
.product-small .price > .amount {
	display: inline;
	padding: 0;
	font-size: 17px;
	font-weight: 600;
	color: var(--cv-text);
}

.product-small .price.price-on-sale ins .amount,
.product-small .price ins .amount {
	color: var(--cv-accent);
}

.product-small .price del {
	opacity: 1;
}

.product-small .price del .amount {
	font-size: 13px;
	font-weight: 400;
	color: var(--cv-text-subtle);
}

/* nút thêm vào giỏ */
.product-small .add-to-cart-button {
	margin-top: 12px;
}

.product-small .add-to-cart-button a.button,
.product-small .add-to-cart-button .button {
	display: block;
	width: 100%;
	margin: 0;
	min-height: 38px;
	line-height: 36px;
	padding: 0 12px;
	border: 1.5px solid var(--cv-primary);
	border-radius: var(--cv-radius-sm);
	background: transparent;
	color: var(--cv-primary);
	font-size: 13px;
	font-weight: 600;
	text-transform: none;
}

.product-small .add-to-cart-button a.button:hover,
.product-small.box:hover .add-to-cart-button a.button {
	background: var(--cv-primary);
	color: #fff;
}

.product-small .add-to-cart-button a.button.loading {
	opacity: .7;
}

.product-small .add-to-cart-button .added_to_cart {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 500;
	text-align: center;
}

/* ---- khoảng cách lưới ---- */

.products.row {
	margin-left: -10px;
	margin-right: -10px;
}

.products.row > .product-small.col {
	padding: 0 10px 20px;
}

@media (max-width: 549px) {
	.products.row {
		margin-left: -6px;
		margin-right: -6px;
	}

	.products.row > .product-small.col {
		padding: 0 6px 12px;
	}

	.product-small .box-text {
		padding: 10px 10px 12px;
	}

	.product-small .product-title {
		font-size: 13px;
	}

	.product-small .price ins .amount,
	.product-small .price > .amount {
		font-size: 15px;
	}

	.product-small .badge-container {
		margin: 8px 0 0 8px;
	}

	.col-inner:hover > .product-small.box,
	.col-inner:hover > .badge-container {
		transform: none;
	}
}
