/* =========================================================
   PRODUCT CARD  —  reference match
   Image + Title + Price + 5 star + Cart button. Ar kichu nei.
   Path   : assets/css/product-card.css
   Handle : aisourcemart-product-card   (inc/enqueue.php theke load)
   Markup : inc/product-card.php  ->  aisourcemart_product_card()
   Home (sec1..sec5) + Shop + Category + Tag + Search + Related
   ========================================================= */

/* ---------- Section shell ---------- */
.tj-sec {
	max-width: 1320px; margin: 55px auto 30px; padding: 0 15px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.tj-sec-header {
	display: flex; align-items: center; justify-content: space-between;
	gap: 22px; margin-bottom: 22px; flex-wrap: wrap;
}
.tj-sec-title-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tj-sec-mini {
	font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
	color: var(--aisourcemart-primary, #0052FF); white-space: nowrap;
}
.tj-sec-title {
	font-size: 30px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2;
	margin: 0; color: var(--aisourcemart-dark, #0F172A);
}
.tj-sec-title .tj-accent { color: var(--aisourcemart-primary, #0052FF); }
.tj-sec-btn {
	display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
	padding: 9px 18px; border-radius: 999px; text-decoration: none;
	font-size: 14px; font-weight: 600; background: #fff;
	color: var(--aisourcemart-primary, #0052FF);
	border: 1px solid #DCE8F8;
	transition: background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.tj-sec-btn:hover { background: #EFF6FF; border-color: #BBD4FB; box-shadow: 0 6px 16px -10px rgba(0, 82, 255, .5); }
.tj-sec-btn svg { transition: transform .25s; }
.tj-sec-btn:hover svg { transform: translateX(3px); }
.tj-sec-empty {
	padding: 40px; text-align: center; color: #64748B; background: #fff;
	border: 1px dashed #DDE7F5; border-radius: 12px;
}

/* ---------- Grid : 6 column (reference) ---------- */
.tj-sec-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 14px; margin: 0; padding: 0; list-style: none; align-items: stretch;
}
section[id^="tj-sec-sec"] .tj-sec-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- Card ---------- */
.tj-card {
	position: relative; display: flex; flex-direction: column; height: 100%;
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	padding: 10px 10px 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
	overflow: hidden;
	transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}
.tj-card:hover {
	transform: translateY(-2px);
	border-color: #DADDE3;
	box-shadow: 0 12px 24px -16px rgba(15, 23, 42, .45);
}

/* ---------- 1. image ---------- */
.tj-card-media {
	position: relative; height: 168px; border-radius: 6px;
	background: #fff; overflow: hidden;
}
.tj-card-media-link { display: block; width: 100%; height: 100%; }
.tj-card-media img {
	width: 100%; height: 100%; object-fit: contain; padding: 4px;
	display: block; transition: transform .35s ease;
}
.tj-card:hover .tj-card-media img { transform: scale(1.04); }

/* discount pill — top-left */
.tj-card-badge {
	position: absolute; top: 8px; left: 8px; z-index: 3;
	display: inline-flex; align-items: center;
	height: 21px; padding: 0 8px; border-radius: 999px;
	background: #EC003F; color: #fff;
	font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .2px;
	white-space: nowrap;
}

/* ---------- 2. title ---------- */
.tj-card-title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden; margin-top: 10px; min-height: 38px;
	font-size: 13.5px; font-weight: 600; line-height: 1.4;
	color: #111827; text-decoration: none;
}
.tj-card-title:hover { color: #EC003F; }

/* ---------- 3. price ---------- */
.tj-card-price {
	display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: 8px;
}
.tj-card-price-now {
	display: inline-flex; align-items: baseline;
	font-size: 16px; font-weight: 800; letter-spacing: -.2px; color: #ff5a00;
}
.tj-card-price-now .woocommerce-Price-amount,
.tj-card-price-now bdi { font: inherit; color: inherit; white-space: nowrap; }
.tj-card-price-now .woocommerce-Price-currencySymbol {
	font-size: 13px; font-weight: 700; margin-right: 2px;
}
.tj-card-price del {
	margin: 0; font-size: 12px; font-weight: 400; color: #9CA3AF; text-decoration: line-through;
}
.tj-card-price del .woocommerce-Price-amount,
.tj-card-price del bdi { font: inherit; color: inherit; }
.tj-card-price del .woocommerce-Price-currencySymbol { font-size: 11px; }

/* ---------- 4 + 5. stars / cart (bottom row) ---------- */
.tj-card-foot {
	display: flex; align-items: center; justify-content: space-between;
	gap: 8px; margin-top: 10px;
}
.tj-card-rating { display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.tj-card-rating svg { width: 14px; height: 14px; flex: none; color: #FFB300; }
.tj-card-rating svg.is-off { color: #E2E8F0; }

.tj-card-cart {
	width: 32px; height: 32px; flex: none; padding: 0;
	border-radius: 50%; border: 1.5px solid #E9DDFB; background: #fff;
	color: #ff5a00; display: flex; align-items: center; justify-content: center;
	text-decoration: none; cursor: pointer;
	transition: background .22s, color .22s, border-color .22s, transform .22s, opacity .22s;
}
.tj-card-cart svg { width: 15px; height: 15px; }
.tj-card-cart:hover { background: #ff5a00; border-color: #ff5a00; color: #fff; transform: scale(1.06); }
.tj-card-cart.loading { opacity: .55; pointer-events: none; }
.tj-card-cart.added { background: #ff5a00; border-color: #ff5a00; color: #fff; }

/* out of stock — shudhu image halka hoy, kono text nei */
.tj-card.is-out .tj-card-media img { opacity: .45; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
	.tj-sec-grid, section[id^="tj-sec-sec"] .tj-sec-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
	.tj-sec-grid, section[id^="tj-sec-sec"] .tj-sec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.tj-sec-title { font-size: 26px; }
	.tj-card-media { height: 150px; }
}
@media (max-width: 768px) {
	.tj-sec { margin: 38px auto 24px; }
	.tj-sec-grid, section[id^="tj-sec-sec"] .tj-sec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
	.tj-card-media { height: 140px; }
}
@media (max-width: 560px) {
	.tj-sec-grid, section[id^="tj-sec-sec"] .tj-sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.tj-card { border-radius: 8px; padding: 8px 8px 10px; }
	.tj-card-media { height: 128px; }
	.tj-card-title { font-size: 12.5px; min-height: 35px; }
	.tj-card-price-now { font-size: 15px; }
	.tj-sec-btn { padding: 8px 15px; font-size: 13px; }
}

/* =========================================================
   Legacy section containers (BEST / NEW / FLASH) now hold .tj-card
   Oi section gulite inline <style> ache, tai !important lagbe.
   ========================================================= */
section.tj-best .tj-best-grid {
	display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	gap: 14px !important; align-items: stretch;
}
section.tj-new .tj-new-track {
	display: flex !important; gap: 14px !important; align-items: stretch; transition: transform .45s ease;
}
section.tj-new .tj-new-track > .tj-card {
	flex: 0 0 calc((100% - 70px) / 6); min-width: 0; max-width: none;
}
section.tj-flash .tj-flash-track {
	display: flex !important; gap: 14px !important; align-items: stretch;
}
section.tj-flash .tj-flash-track > .tj-card { flex: 0 0 212px; min-width: 0; max-width: none; }

@media (max-width: 1280px) {
	section.tj-best .tj-best-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
	section.tj-new .tj-new-track > .tj-card { flex: 0 0 calc((100% - 56px) / 5); }
}
@media (max-width: 1024px) {
	section.tj-best .tj-best-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
	section.tj-new .tj-new-track > .tj-card { flex: 0 0 calc((100% - 42px) / 4); }
}
@media (max-width: 768px) {
	section.tj-best .tj-best-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; }
	section.tj-new .tj-new-track { gap: 12px !important; }
	section.tj-new .tj-new-track > .tj-card { flex: 0 0 calc((100% - 24px) / 3); }
	section.tj-flash .tj-flash-track > .tj-card { flex: 0 0 172px; }
}
@media (max-width: 560px) {
	section.tj-best .tj-best-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
	section.tj-new .tj-new-track > .tj-card { flex: 0 0 calc((100% - 10px) / 2); }
}
