/* ==========================================================================
   মডিউল: Products — প্রোডাক্ট গ্রিড ও কম্প্যাক্ট কার্ড
   ========================================================================== */

/* ── গ্রিড: ২ → ৩ → ৪ → ৫ কলাম ── */
.arianerptheme-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
	.arianerptheme-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 14px;
	}
}

@media (min-width: 1024px) {
	.arianerptheme-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1280px) {
	.arianerptheme-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

/* বড় মনিটর — চওড়া বাড়লেও কার্ড অস্বাভাবিক বড় নয়, বরং বেশি পণ্য */
@media (min-width: 1536px) {
	.arianerptheme-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

/* ── কার্ড ── */
.arianerptheme-product {
	display: flex;
	flex-direction: column;
	transition: transform .15s ease, box-shadow .15s ease;
}

.arianerptheme-product:hover {
	transform: translateY(-2px);
}

/* ছবির বাক্স — ৫:৪ (বর্গের চেয়ে কম লম্বা); ছবি যেমনই হোক পুরোটা দেখা যায়, বাক্সের আকার বদলায় না */
.arianerptheme-product__media {
	position: relative;
	flex: none;
	width: 100%;
	aspect-ratio: 5 / 4;
	overflow: hidden;
	background: var(--arianerptheme-media-bg);
	border-bottom: 1px solid var(--arianerptheme-border);
}

.arianerptheme-product__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 7%;
	object-fit: contain;
	object-position: center;
	transition: transform .25s ease;
}

.arianerptheme-product:hover .arianerptheme-product__media img {
	transform: scale(1.04);
}

.arianerptheme-product.is-out-of-stock .arianerptheme-product__media img {
	opacity: .5;
	filter: grayscale(.7);
}

/* স্টক ব্যাজ (বাঁ-উপরে) */
.arianerptheme-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: .7rem;
	font-weight: 600;
	line-height: 1.6;
	color: #fff;
}

.arianerptheme-badge--success {
	background: var(--arianerptheme-success);
}

.arianerptheme-badge--danger {
	background: var(--arianerptheme-danger);
}

/* ছাড় ব্যাজ (ডান-উপরে) — দামের লাইনে জায়গা বাঁচে */
.arianerptheme-product__off {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--arianerptheme-danger);
	color: #fff;
	font-size: .72rem;
	font-weight: 800;
	line-height: 1.6;
	box-shadow: 0 4px 10px color-mix(in srgb, var(--arianerptheme-danger) 35%, transparent);
}

.arianerptheme-product__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 3px;
	padding: 10px 12px 12px;
}

/* ব্র্যান্ড (পিল) · ক্যাটাগরি · SKU (ডান কোণায়) — এক লাইন; ফাঁকা হলেও জায়গা রাখে যাতে কার্ড সমান থাকে */
.arianerptheme-product__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 20px;
	margin: 0;
	overflow: hidden;
	white-space: nowrap;
}

.arianerptheme-product__brand {
	flex: none;
	max-width: 50%;
	overflow: hidden;
	padding: 0 7px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--arianerptheme-primary) 14%, transparent);
	color: var(--arianerptheme-primary);
	font-size: .7rem;
	font-weight: 700;
	line-height: 1.6;
	text-overflow: ellipsis;
}

.arianerptheme-product__cat {
	min-width: 0;
	overflow: hidden;
	color: var(--arianerptheme-muted);
	font-size: .68rem;
	font-weight: 500;
	letter-spacing: .02em;
	text-transform: uppercase;
	text-overflow: ellipsis;
}

.arianerptheme-product__sku {
	flex: 0 1 auto;
	max-width: 45%;
	margin-left: auto;
	overflow: hidden;
	color: var(--arianerptheme-muted);
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: .66rem;
	opacity: .85;
	text-overflow: ellipsis;
}

/* টাইটেল সবসময় ঠিক ২ লাইনের জায়গা নেয় — তাই সব কার্ডে দাম ও বাটন একই লাইনে থাকে।
   Inter (ইংরেজি নামের জন্য আরামদায়ক), মাঝারি ওজন, একটু খোলা লাইন — চোখে চাপ কম */
.arianerptheme-product__title {
	display: -webkit-box;
	min-height: calc(2 * 1.45em);
	margin: 3px 0 0;
	overflow: hidden;
	color: color-mix(in srgb, var(--arianerptheme-text) 90%, var(--arianerptheme-muted));
	font-family: var(--arianerptheme-font-latin);
	font-size: .875rem;
	font-weight: 500;
	letter-spacing: -.005em;
	line-height: 1.45;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	word-break: break-word;
}

.arianerptheme-product__link {
	color: inherit;
}

.arianerptheme-product__link:hover {
	color: var(--arianerptheme-primary);
	text-decoration: none;
}

/* ── নিচের অংশ: দাম + বাটন ── */
.arianerptheme-product__foot {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
	padding-top: 6px;
}

/* লাইনের উচ্চতা নির্দিষ্ট — দাম থাকুক বা "দাম জানতে যোগাযোগ", সব কার্ড একই উচ্চতার */
.arianerptheme-product__price {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 1.7rem;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	line-height: 1.2;
	color: var(--arianerptheme-primary);
	font-size: 1.08rem;
	font-weight: 700;
	white-space: nowrap;
}

.arianerptheme-product__price.is-ask {
	color: var(--arianerptheme-muted);
	font-size: .85rem;
	font-weight: 600;
}

/* কার্ডে ছাড়ের % ছবির কোণায় — দামের লাইনে শুধু দাম ও কাটা দাম */
.arianerptheme-product__price .arianerptheme-price__off {
	display: none;
}

.arianerptheme-product__actions {
	display: grid;
	gap: 6px;
}

.arianerptheme-product__actions .arianerptheme-btn {
	min-height: 38px;
	padding: 6px 10px;
	font-size: .88rem;
	white-space: nowrap;
}

/* বড় স্ক্রিন: দাম বাঁয়ে, ছোট গোল বাটন ডানে — এক সারি (কার্ড অনেক কম লম্বা) */
@media (min-width: 640px) {
	.arianerptheme-product__foot {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
	}

	.arianerptheme-product__foot .arianerptheme-product__price {
		flex: 1;
	}

	.arianerptheme-product__foot .arianerptheme-product__actions {
		display: flex;
		flex: none;
		gap: 6px;
	}

	/* কার্টে যোগ → শুধু আইকন (লেখা স্ক্রিন-রিডারের জন্য থাকে) */
	.arianerptheme-product__foot .arianerptheme-cart-add {
		width: 40px;
		min-height: 40px;
		padding: 0;
		border-radius: 50%;
	}

	.arianerptheme-product__foot .arianerptheme-cart-add .arianerptheme-cart-add__label,
	.arianerptheme-product__foot .arianerptheme-cart-add ~ .arianerptheme-btn--whatsapp > span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.arianerptheme-product__foot .arianerptheme-cart-add .arianerptheme-cart-add__icon {
		display: inline-flex !important;
	}

	.arianerptheme-product__foot .arianerptheme-cart-add ~ .arianerptheme-btn--whatsapp {
		width: 40px;
		min-height: 40px;
		padding: 0;
		border-radius: 50%;
	}

	/* দাম নেই / কেনা যায় না — বাঁয়ের লেখা বাদ, WhatsApp বাটন পুরো চওড়া (লেবেলসহ) */
	.arianerptheme-product__foot:not(:has(.arianerptheme-cart-add)) .arianerptheme-product__price.is-ask {
		display: none;
	}

	.arianerptheme-product__foot:not(:has(.arianerptheme-cart-add)) .arianerptheme-product__actions {
		flex: 1;
	}

	.arianerptheme-product__foot:not(:has(.arianerptheme-cart-add)) .arianerptheme-product__actions .arianerptheme-btn {
		width: 100%;
	}
}

/* ছোট মোবাইল — আরও কম্প্যাক্ট */
@media (max-width: 480px) {
	.arianerptheme-grid {
		gap: 10px;
	}

	.arianerptheme-product__body {
		padding: 8px 10px 10px;
	}

	.arianerptheme-product__title {
		font-size: .83rem;
	}

	.arianerptheme-product__price {
		font-size: 1rem;
	}

	.arianerptheme-product__price.is-ask {
		font-size: .78rem;
	}

	.arianerptheme-product__sku {
		max-width: 40%; /* জায়গা কম হলে ক্যাটাগরি ছোট হয় ("…"), SKU থাকে */
		font-size: .62rem;
	}

	.arianerptheme-product__actions .arianerptheme-btn {
		gap: 6px;
		min-height: 38px;
		padding: 6px 8px;
		font-size: .8rem;
	}

	.arianerptheme-product__actions .arianerptheme-icon {
		width: 16px;
		height: 16px;
	}

	.arianerptheme-badge,
	.arianerptheme-product__off {
		top: 6px;
		padding: 0 7px;
		font-size: .66rem;
	}

	.arianerptheme-badge {
		left: 6px;
	}

	.arianerptheme-product__off {
		right: 6px;
	}
}
