/* =========================================================
   PRODUCT CARD  —  reference match (Flash Sale style)
   Top Selling + Image + Discount/Offer pill + Title + Stock + Price + Add to Cart
   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
   Theme er CSS jate bhangte na pare tai selector gulo ".tj-card ..." diye
   Color: Customizer > Theme Colors > Primary (button, badge) + Dark (price)
   ========================================================= */

/* ---------- 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 ---------- */
.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 !important; flex-direction: column; height: 100%;
	box-sizing: border-box; margin: 0;
	background: #fff;
	border: 1px solid #E8ECF3;
	border-radius: 14px;
	padding: 8px 8px 12px;
	box-shadow: 0 4px 14px -8px rgba(15, 35, 95, .18);
	overflow: hidden; text-align: left;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}
.tj-card *, .tj-card *::before, .tj-card *::after { box-sizing: border-box; }
.tj-card:hover {
	transform: translateY(-3px);
	border-color: #DCE3EE;
	box-shadow: 0 16px 30px -18px rgba(15, 35, 95, .45);
}

/* ---------- 1. image ---------- */
.tj-card .tj-card-media {
	position: relative; width: 100%; height: auto; aspect-ratio: 1 / 1; margin: 0;
	border-radius: 10px; background: #fff; overflow: hidden;
}
.tj-card .tj-card-media-link { display: block; width: 100%; height: 100%; }
.tj-card .tj-card-media img {
	width: 100% !important; height: 100% !important; max-width: 100%;
	object-fit: cover; padding: 0; margin: 0;
	display: block; transition: transform .35s ease;
}
.tj-card:hover .tj-card-media img { transform: scale(1.05); }

/* Top Selling — top-left */
.tj-card .tj-card-top {
	position: absolute; top: 6px; left: 6px; z-index: 3;
	display: inline-flex; align-items: center; gap: 3px;
	height: 22px; padding: 0 9px 0 6px; border-radius: 999px;
	background: #fff; color: #1F2937;
	font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: -.1px; white-space: nowrap;
	box-shadow: 0 2px 8px -3px rgba(15, 23, 42, .25);
}
.tj-card .tj-card-top svg { width: 13px !important; height: 13px !important; flex: none; }

/* discount — bottom-left */
.tj-card .tj-card-badge {
	position: absolute; left: 6px; bottom: 6px; top: auto; z-index: 3;
	display: inline-flex; align-items: center;
	height: 22px; padding: 0 8px; border-radius: 6px;
	background: var(--aisourcemart-primary, #FF5A1F); color: #fff;
	font-size: 12px; font-weight: 800; line-height: 1; white-space: nowrap;
	box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--aisourcemart-primary, #FF5A1F) 70%, transparent);
}

/* Offer — bottom-right */
.tj-card .tj-card-offer {
	position: absolute; right: 6px; bottom: 6px; z-index: 3;
	display: inline-flex; align-items: center;
	height: 22px; padding: 0 11px; border-radius: 999px;
	background: #1E9E52; color: #fff;
	font-size: 12px; font-weight: 800; line-height: 1; white-space: nowrap;
	box-shadow: 0 4px 10px -4px rgba(30, 158, 82, .7);
}

/* ---------- 2. title ---------- */
.tj-card .tj-card-title {
	display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
	margin: 8px 2px 0; padding: 0;
	font-size: 14px; font-weight: 700; line-height: 1.35;
	color: #111827; text-decoration: none;
}
.tj-card .tj-card-title:hover { color: var(--aisourcemart-primary, #FF5A1F); }

/* ---------- 3. stock ---------- */
.tj-card .tj-card-stock {
	display: block; margin: 2px 2px 0;
	font-size: 11.5px; font-weight: 600; line-height: 1.3;
}
.tj-card .tj-card-stock.is-in  { color: #16A34A; }
.tj-card .tj-card-stock.is-pre { color: #EA8C00; }
.tj-card .tj-card-stock.is-out { color: #E11D48; }

/* ---------- 4. price ---------- */
.tj-card .tj-card-price {
	display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 3px 2px 0;
}
.tj-card .tj-card-price-now {
	display: inline-flex; align-items: baseline;
	font-size: 19px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15;
	color: var(--aisourcemart-dark, #14215F);
}
.tj-card .tj-card-price-now .woocommerce-Price-amount,
.tj-card .tj-card-price-now bdi { font: inherit; color: inherit; white-space: nowrap; }
.tj-card .tj-card-price-now .woocommerce-Price-currencySymbol { font: inherit; color: inherit; margin: 0; }
.tj-card .tj-card-price del {
	margin: 0; font-size: 13px; font-weight: 500; color: #9AA3B2;
	text-decoration: line-through; opacity: 1;
}
.tj-card .tj-card-price del .woocommerce-Price-amount,
.tj-card .tj-card-price del bdi,
.tj-card .tj-card-price del .woocommerce-Price-currencySymbol { font: inherit; color: inherit; margin: 0; }

/* ---------- 5. Add to Cart (full width) ---------- */
.tj-card .tj-card-foot {
	display: block; margin-top: auto; padding-top: 9px;
}
.tj-card .tj-card-cart {
	width: 100% !important; height: 34px; min-height: 0; padding: 0 10px !important; margin: 0 !important;
	display: flex !important; align-items: center; justify-content: center; gap: 7px;
	border-radius: 8px !important;
	border: 1.5px solid var(--aisourcemart-primary, #FF5A1F) !important;
	background: #fff !important;
	color: var(--aisourcemart-primary, #FF5A1F) !important;
	font-size: 13.5px; font-weight: 700; line-height: 1; white-space: nowrap;
	text-decoration: none; text-transform: none; letter-spacing: 0;
	box-shadow: none; cursor: pointer;
	transition: background .22s, color .22s, box-shadow .22s, opacity .22s;
}
.tj-card .tj-card-cart .tj-card-cart-ico { width: 17px !important; height: 17px !important; flex: none; }
.tj-card .tj-card-cart:hover,
.tj-card .tj-card-cart:focus-visible {
	background: var(--aisourcemart-primary, #FF5A1F) !important; color: #fff !important;
	box-shadow: 0 8px 16px -10px color-mix(in srgb, var(--aisourcemart-primary, #FF5A1F) 85%, transparent);
}
.tj-card .tj-card-cart.loading { opacity: .6; pointer-events: none; }
.tj-card .tj-card-cart.loading::after,
.tj-card .tj-card-cart.added::after { display: none !important; }
.tj-card .tj-card-cart.added { background: var(--aisourcemart-primary, #FF5A1F) !important; color: #fff !important; }
.tj-card .tj-card-cart.is-disabled {
	border-color: #D7DCE4 !important; background: #F4F6F9 !important; color: #8A94A6 !important; pointer-events: none;
}
.tj-card .added_to_cart { display: none !important; }

/* out of stock — image halka */
.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; }
}
@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; }
}
@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: 12px; padding: 6px 6px 9px; }
	.tj-card .tj-card-title { font-size: 12.5px; }
	.tj-card .tj-card-price-now { font-size: 16px; }
	.tj-card .tj-card-price del { font-size: 11.5px; }
	.tj-card .tj-card-top { font-size: 10px; height: 20px; }
	.tj-card .tj-card-badge, .tj-card .tj-card-offer { font-size: 11px; height: 20px; }
	.tj-card .tj-card-cart { height: 32px; font-size: 12px; }
	.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 calc((100% - 56px) / 5); 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); }
	section.tj-flash .tj-flash-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 calc((100% - 24px) / 3); }
}
@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); }
	section.tj-flash .tj-flash-track > .tj-card { flex: 0 0 calc((100% - 10px) / 2); }
}