/**
 * Product loop card — Thiết Bị Phụ Thái
 */

:root {
	--tbpt-red: #ed1c24;
	--tbpt-red-hover: #d41920;
	--tbpt-text: #1a1a1a;
	--tbpt-muted: #8f8f8f;
	--tbpt-border: #e5e5e5;
	--tbpt-green: #1f9d55;
	--tbpt-radius-card: 12px;
	--tbpt-radius-badge: 6px;
	--tbpt-radius-btn: 8px;
	--tbpt-space-xs: 8px;
	--tbpt-space-sm: 12px;
	--tbpt-space-md: 18px;
	--tbpt-space-lg: 16px;
}

/* ── Card ── */
.tbpt-product-card,
.product-small:has(.tbpt-product-card__actions) {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	padding: var(--tbpt-space-md);
	border: 1px solid var(--tbpt-border) !important;
	border-radius: var(--tbpt-radius-card);
	background: #ffffff !important;
	box-shadow: none !important;
	overflow: visible;
}

.tbpt-product-loop-item > .col-inner,
.product-small:has(.tbpt-product-card__actions) > .col-inner {
	height: 100%;
	padding: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	transform: none !important;
}

dl {
	text-transform: none;
}

/* ── Badge ── */
.tbpt-product-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	min-height: 22px;
	padding: 4px 10px;
	border-radius: var(--tbpt-radius-badge);
	background: var(--tbpt-red);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

/* ── Image ── */
.tbpt-product-card__media,
.product-small:has(.tbpt-product-card__actions) .box-image {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 175px;
	margin: 0 0 14px !important;
	padding: 0 !important;
	height: auto !important;
}

.tbpt-product-card__image-link,
.product-small:has(.tbpt-product-card__actions) .box-image > a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	text-decoration: none;
}

.tbpt-product-card__media img,
.product-small:has(.tbpt-product-card__actions) .box-image img {
	display: block;
	width: auto !important;
	max-width: 100%;
	height: auto !important;
	max-height: 165px;
	margin: 0 auto;
	padding: 0 !important;
	border: 0;
	object-fit: contain !important;
	position: static !important;
}

/* ── Body ── */
.tbpt-product-card__body,
.product-small:has(.tbpt-product-card__actions) .box-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: stretch;
	padding: 0 !important;
	text-align: left !important;
}

/* ── Title ── */
.tbpt-product-card__title-wrap,
.product-small:has(.tbpt-product-card__actions) .title-wrapper {
	margin: 0 0 12px !important;
}

.tbpt-product-card .product-title,
.tbpt-product-card .woocommerce-loop-product__title,
.product-small:has(.tbpt-product-card__actions) .product-title,
.product-small:has(.tbpt-product-card__actions) .woocommerce-loop-product__title {
	display: -webkit-box;
	margin: 0 !important;
	overflow: hidden;
	color: var(--tbpt-text) !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	text-align: left !important;
	text-transform: none;
}

.tbpt-product-card .product-title a,
.tbpt-product-card .woocommerce-loop-product__title a,
.product-small:has(.tbpt-product-card__actions) .product-title a {
	color: inherit !important;
	text-decoration: none !important;
}

/* ── Meta (2 cột như mockup) ── */
.tbpt-product-card__meta {
	margin: 0 0 14px;
	padding: 0;
}

.tbpt-product-card__meta-row {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	gap: 2px 6px;
	margin: 0 0 5px;
}

.tbpt-product-card__meta-row:last-child {
	margin-bottom: 0;
}

.tbpt-product-card__meta-label,
.tbpt-product-card__meta dt {
	margin: 0;
	color: var(--tbpt-muted);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
}

.tbpt-product-card__meta-value,
.tbpt-product-card__meta dd {
	margin: 0;
	color: var(--tbpt-text);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
}

.tbpt-product-card__stock.is-instock {
	color: var(--tbpt-green) !important;
	font-weight: 600;
}

.tbpt-product-card__stock.is-outofstock {
	color: var(--tbpt-red) !important;
	font-weight: 600;
}

/* ── Price (dưới meta) ── */
.tbpt-product-card__price-wrap,
.product-small:has(.tbpt-product-card__actions) .price-wrapper {
	margin: 0 0 14px !important;
}

.tbpt-product-card .price,
.product-small:has(.tbpt-product-card__actions) .price {
	display: flex !important;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 10px;
	margin: 0 !important;
	padding: 0;
	color: var(--tbpt-red) !important;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	text-align: left !important;
}

.tbpt-product-card .price ins {
	order: 1;
	margin: 0;
	padding: 0;
	background: none;
	text-decoration: none;
}

.tbpt-product-card .price del {
	order: 2;
	color: var(--tbpt-muted) !important;
	font-size: 14px;
	font-weight: 400;
	opacity: 1 !important;
	text-decoration: line-through;
}

.tbpt-product-card .price ins .woocommerce-Price-amount,
.tbpt-product-card .price > .woocommerce-Price-amount,
.tbpt-product-card .price ins .amount,
.tbpt-product-card .price > .amount,
.tbpt-product-card .price .woocommerce-Price-currencySymbol {
	color: var(--tbpt-red) !important;
	font-size: inherit !important;
	font-weight: 700 !important;
}

.tbpt-product-card .price del .woocommerce-Price-amount,
.tbpt-product-card .price del .amount,
.tbpt-product-card .price del bdi {
	color: var(--tbpt-muted) !important;
	font-size: 14px !important;
	font-weight: 400 !important;
}

/* ── Buttons ── */
.tbpt-product-card__actions {
	display: flex !important;
	gap: 10px;
	margin-top: auto;
	padding: 0;
	width: 100%;
}

a.tbpt-product-card__btn,
a.tbpt-product-card__btn.button,
a.tbpt-product-card__btn.add_to_cart_button {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex !important;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 40px;
	margin: 0 !important;
	padding: 0 12px;
	border: 1.5px solid #d6000c !important;
	border-radius: var(--tbpt-radius-btn) !important;
	box-shadow: none !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	text-align: center;
	text-decoration: none !important;
	text-transform: none !important;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

a.tbpt-product-card__btn::before,
a.tbpt-product-card__btn::after {
	display: none !important;
	content: none !important;
}

a.tbpt-product-card__btn--buy {
	border-color: var(--tbpt-red) !important;
	background: var(--tbpt-red) !important;
	color: #ffffff !important;
}

a.tbpt-product-card__btn--buy:hover,
a.tbpt-product-card__btn--buy:focus {
	border-color: var(--tbpt-red-hover) !important;
	background: var(--tbpt-red-hover) !important;
	color: #ffffff !important;
}

a.tbpt-product-card__btn--detail {
	border-color: var(--tbpt-red) !important;
	background: #ffffff !important;
	color: var(--tbpt-red) !important;
}

a.tbpt-product-card__btn--detail:hover,
a.tbpt-product-card__btn--detail:focus {
	border-color: var(--tbpt-red-hover) !important;
	background: rgba(237, 28, 36, 0.04) !important;
	color: var(--tbpt-red-hover) !important;
}

a.tbpt-product-card__btn--cart {
	flex: 0 0 40px;
	width: 40px !important;
	padding: 0 !important;
	border-color: var(--tbpt-red) !important;
	background: #ffffff !important;
	color: var(--tbpt-red) !important;
}

/* ── Hide Flatsome chrome ── */
.tbpt-product-card .badge-container,
.tbpt-product-card .image-tools,
.tbpt-product-card .grid-tools,
.tbpt-product-card .add-to-cart-button,
.tbpt-product-card .star-rating,
.tbpt-product-card .review-count,
.tbpt-product-card .category,
.tbpt-product-card .back-image,
.product-small:has(.tbpt-product-card__actions) .badge-container,
.product-small:has(.tbpt-product-card__actions) .image-tools {
	display: none !important;
}

/* ── Responsive ── */
@media (max-width: 849px) {
	.tbpt-product-card,
	.product-small:has(.tbpt-product-card__actions) {
		padding: 14px;
	}

	.tbpt-product-card__media,
	.product-small:has(.tbpt-product-card__actions) .box-image {
		min-height: 150px;
	}

	.tbpt-product-card .price,
	.product-small:has(.tbpt-product-card__actions) .price {
		font-size: 20px;
	}

	.tbpt-product-card__meta-row {
		grid-template-columns: 80px minmax(0, 1fr);
	}

	a.tbpt-product-card__btn {
		min-height: 38px;
		font-size: 13px !important;
	}
}

@media (max-width: 380px) {
	.tbpt-product-card__actions {
		flex-direction: column;
	}

	a.tbpt-product-card__btn {
		width: 100%;
	}
}
