/* ==========================================================================
   মডিউল: Home — লেআউট (বাঁ পাশে ক্যাটাগরি সাইডবার), ব্যানার, ক্যাটাগরি টাইল
   (প্রোডাক্ট গ্রিড/কার্ডের স্টাইল Products মডিউলে)
   ========================================================================== */

/* ── Hero: বাঁয়ে দোকানের কথা + ভরসার তথ্য, ডানে "আজকের সেরা অফার" (বা ব্যানার ছবি) ── */
.arianerptheme-hero {
	background:
		radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--arianerptheme-primary) 22%, transparent), transparent 55%),
		linear-gradient(135deg, color-mix(in srgb, var(--arianerptheme-primary) 10%, var(--arianerptheme-surface)), var(--arianerptheme-surface));
	border-bottom: 1px solid var(--arianerptheme-border);
}

.arianerptheme-hero__inner {
	display: grid;
	gap: 20px;
	align-items: center;
	padding-block: 28px;
}

@media (min-width: 860px) {
	.arianerptheme-hero__inner {
		padding-block: 40px;
	}

	.arianerptheme-hero.has-side .arianerptheme-hero__inner {
		grid-template-columns: minmax(0, 1fr) 250px;
		gap: 32px;
	}

	.arianerptheme-hero.has-image .arianerptheme-hero__inner {
		grid-template-columns: 1.1fr .9fr;
	}
}

@media (min-width: 1280px) {
	.arianerptheme-hero.has-side:not(.has-image) .arianerptheme-hero__inner {
		grid-template-columns: minmax(0, 1fr) 270px;
	}
}

.arianerptheme-hero__text {
	min-width: 0;
}

.arianerptheme-hero__title {
	margin: 0 0 10px;
	font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem);
	line-height: 1.2;
}

.arianerptheme-hero__subtitle {
	max-width: 560px;
	margin: 0 0 20px;
	color: var(--arianerptheme-muted);
	font-size: 1.02rem;
}

.arianerptheme-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* ভরসার তথ্য */
.arianerptheme-hero__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 22px 0 0;
	padding: 0;
	list-style: none;
}

.arianerptheme-hero__badges li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--arianerptheme-text);
	font-size: .86rem;
	font-weight: 600;
}

.arianerptheme-hero__badge-icon {
	display: inline-grid;
	flex: 0 0 28px;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--arianerptheme-success) 15%, transparent);
	color: var(--arianerptheme-success);
}

.arianerptheme-hero__badge-icon .arianerptheme-icon {
	width: 15px;
	height: 15px;
}

/* ডানে: আজকের সেরা অফার (আসল পণ্যের কার্ড — Quick Buy/কার্ট সব কাজ করে) */
.arianerptheme-hero__spot {
	position: relative;
	width: 100%;
	max-width: 270px;
	margin-inline: auto;
}

.arianerptheme-hero__spot-label {
	position: absolute;
	top: -12px;
	left: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--arianerptheme-danger);
	color: #fff;
	font-size: .78rem;
	font-weight: 700;
	white-space: nowrap;
	box-shadow: 0 6px 16px color-mix(in srgb, var(--arianerptheme-danger) 35%, transparent);
	transform: translateX(-50%);
}

.arianerptheme-hero__spot-label .arianerptheme-icon {
	width: 14px;
	height: 14px;
}

.arianerptheme-hero__spot .arianerptheme-product {
	box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
}

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

/* স্লাইডার — সব স্লাইড একই জায়গায়, বর্তমানটি দৃশ্যমান (উচ্চতা লাফায় না) */
.arianerptheme-hero__slides {
	display: grid;
}

.arianerptheme-hero__slide {
	grid-area: 1 / 1;
	min-width: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateX(24px) scale(.97);
	transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}

.arianerptheme-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .45s ease, transform .45s ease, visibility 0s;
}

.arianerptheme-hero__slide.is-leaving-back {
	transform: translateX(24px) scale(.97);
}

.arianerptheme-hero__slide.is-leaving {
	transform: translateX(-24px) scale(.97);
}

.arianerptheme-hero__spot.is-slider .arianerptheme-hero__slides {
	touch-action: pan-y; /* আনুভূমিক সোয়াইপ স্লাইডারের, উপর-নিচ স্ক্রল পেজের */
}

.arianerptheme-hero__slider-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 12px;
}

.arianerptheme-hero__arrow {
	width: 30px;
	height: 30px;
	font-size: 1.2rem;
	line-height: 1;
}

.arianerptheme-hero__dots {
	display: flex;
	align-items: center;
	gap: 6px;
}

.arianerptheme-hero__dot {
	position: relative;
	width: 8px;
	height: 8px;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--arianerptheme-text) 25%, transparent);
	cursor: pointer;
	transition: width .25s ease, background-color .25s ease;
}

.arianerptheme-hero__dot.is-active {
	width: 26px;
	background: color-mix(in srgb, var(--arianerptheme-danger) 30%, transparent);
}

/* সক্রিয় ডটে সময়ের দাগ — কখন পরের অফার আসবে বোঝা যায় */
.arianerptheme-hero__dot.is-active::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--arianerptheme-danger);
	transform-origin: left;
	animation: arianerptheme-slide-timer var(--slide-ms, 4500ms) linear forwards;
}

.arianerptheme-hero__spot.is-paused .arianerptheme-hero__dot.is-active::after {
	animation-play-state: paused;
}

@keyframes arianerptheme-slide-timer {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
	.arianerptheme-hero__slide {
		transform: none !important;
	}

	.arianerptheme-hero__dot.is-active::after {
		animation: none;
		transform: none;
	}
}

/* ফোন/ট্যাবলেটে ব্যানার ছোট — অফারের পণ্য ঠিক নিচের "অফারে আছে" সারিতেই আছে */
@media (max-width: 859px) {
	.arianerptheme-hero__spot {
		display: none;
	}
}

@media (max-width: 639px) {
	.arianerptheme-hero__badges {
		gap: 8px;
	}

	.arianerptheme-hero__badges li {
		font-size: .8rem;
	}
}

.arianerptheme-hero__img {
	display: block;
	width: 100%;
	max-height: 380px;
	object-fit: cover;
	border-radius: var(--arianerptheme-radius);
	box-shadow: var(--arianerptheme-shadow);
}

/* ── ক্যাটাগরির আইকন (ছবি বা রঙিন অক্ষর) — সাইডবার ও টাইল দুটোতেই ── */
.arianerptheme-cat-avatar {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: inherit;
	font-weight: 700;
	line-height: 1;
}

.arianerptheme-cat-avatar.has-img {
	background: var(--arianerptheme-media-bg);
}

.arianerptheme-cat-avatar.has-img img {
	width: 100%;
	height: 100%;
	padding: 12%;
	object-fit: contain;
}

.arianerptheme-cat-avatar.is-letter {
	background: hsl(var(--cat-h, 210) 85% 94%);
	color: hsl(var(--cat-h, 210) 65% 38%);
}

:root[data-theme="dark"] .arianerptheme-cat-avatar.is-letter {
	background: hsl(var(--cat-h, 210) 45% 22%);
	color: hsl(var(--cat-h, 210) 85% 78%);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .arianerptheme-cat-avatar.is-letter {
		background: hsl(var(--cat-h, 210) 45% 22%);
		color: hsl(var(--cat-h, 210) 85% 78%);
	}
}

.arianerptheme-cat-avatar.is-all {
	background: color-mix(in srgb, var(--arianerptheme-primary) 14%, transparent);
	color: var(--arianerptheme-primary);
}

.arianerptheme-cat-avatar .arianerptheme-icon {
	width: 55%;
	height: 55%;
}

/* ── ক্যাটাগরি টাইল — ছোট/মাঝারি স্ক্রিনে এক সারি, সোয়াইপ ── */
.arianerptheme-section--cats {
	padding-block: 18px 0;
}

.arianerptheme-section--cats .arianerptheme-section__head {
	margin-bottom: 10px;
}

.arianerptheme-section--cats .arianerptheme-section__title {
	font-size: 1.05rem;
}

.arianerptheme-scroller__nav {
	display: flex;
	gap: 6px;
}

.arianerptheme-scroller__nav[hidden] {
	display: none;
}

.arianerptheme-scroller__btn {
	width: 34px;
	height: 34px;
	font-size: 1.3rem;
	line-height: 1;
}

.arianerptheme-scroller__btn:disabled {
	opacity: .35;
	cursor: default;
}

.arianerptheme-cattiles {
	display: flex;
	gap: 10px;
	margin: 0 calc(var(--arianerptheme-gutter) * -1);
	padding: 2px var(--arianerptheme-gutter) 10px;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scroll-padding-inline: var(--arianerptheme-gutter); /* সোয়াইপ/বাছাইয়ে টাইল কিনারায় লেগে থাকে না */
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.arianerptheme-cattiles::-webkit-scrollbar {
	display: none;
}

.arianerptheme-cattiles > li {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.arianerptheme-cattile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 88px;
	padding: 10px 6px;
	border: 1px solid var(--arianerptheme-border);
	border-radius: var(--arianerptheme-radius);
	background: var(--arianerptheme-surface);
	color: var(--arianerptheme-text);
	text-align: center;
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.arianerptheme-cattile:hover {
	border-color: var(--arianerptheme-primary);
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: var(--arianerptheme-shadow);
}

.arianerptheme-cattile.is-active {
	border-color: var(--arianerptheme-primary);
	box-shadow: inset 0 0 0 1px var(--arianerptheme-primary);
}

.arianerptheme-cattile__icon {
	width: 52px;
	height: 52px;
	border-radius: 16px;
	font-size: 1.35rem;
}

.arianerptheme-cattile__name {
	display: -webkit-box;
	width: 100%;
	min-height: 2.5em;
	overflow: hidden;
	font-size: .8rem;
	font-weight: 600;
	line-height: 1.25;
	word-break: break-word;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.arianerptheme-cattile__count {
	color: var(--arianerptheme-muted);
	font-size: .72rem;
}

@media (min-width: 640px) {
	.arianerptheme-cattile {
		width: 104px;
	}

	.arianerptheme-cattile__icon {
		width: 60px;
		height: 60px;
	}
}

/* ── হোম লেআউট: বড় স্ক্রিনে বাঁ পাশে স্থির ক্যাটাগরি সাইডবার ── */
.arianerptheme-home__side {
	display: none;
}

@media (min-width: 1200px) {
	.arianerptheme-home.has-side {
		display: grid;
		grid-template-columns: 250px minmax(0, 1fr);
		gap: 24px;
		align-items: start;
		max-width: var(--arianerptheme-max);
		margin-inline: auto;
		padding: 20px var(--arianerptheme-gutter) 0;
	}

	.arianerptheme-home.has-side .arianerptheme-home__side {
		display: block;
		position: sticky;
		top: calc(var(--arianerptheme-header-h) + 16px);
	}

	/* মূল অংশের সেকশনগুলো কলামের ভেতরে — নিজেদের পাশের প্যাডিং লাগে না */
	.arianerptheme-home.has-side .arianerptheme-home__main .arianerptheme-container {
		max-width: none;
		padding-inline: 0;
	}

	.arianerptheme-home.has-side .arianerptheme-section--cats {
		display: none; /* সাইডবারেই আছে */
	}

	.arianerptheme-home.has-side .arianerptheme-hero {
		border: 1px solid var(--arianerptheme-border);
		border-radius: var(--arianerptheme-radius);
		overflow: hidden;
	}

	.arianerptheme-home.has-side .arianerptheme-home__main .arianerptheme-hero__inner {
		padding: 36px 32px 36px 36px; /* কলামের ভেতরের কার্ড — উপরের container নিয়মের চেয়ে নির্দিষ্ট */
	}

	.arianerptheme-home.has-side .arianerptheme-home__main > .arianerptheme-section:first-of-type,
	.arianerptheme-home.has-side .arianerptheme-hero + .arianerptheme-section {
		padding-top: 24px;
	}
}

/* ── সাইডবার ── */
.arianerptheme-catnav {
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - var(--arianerptheme-header-h) - 32px);
	border: 1px solid var(--arianerptheme-border);
	border-radius: var(--arianerptheme-radius);
	background: var(--arianerptheme-surface);
	box-shadow: var(--arianerptheme-shadow);
	overflow: hidden;
}

.arianerptheme-catnav__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 14px 16px;
	border-bottom: 1px solid var(--arianerptheme-border);
	background: var(--arianerptheme-primary);
	color: var(--arianerptheme-primary-ink);
	font-weight: 700;
}

.arianerptheme-catnav__title .arianerptheme-icon {
	width: 18px;
	height: 18px;
}

.arianerptheme-catnav__list {
	flex: 1;
	margin: 0;
	padding: 6px;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.arianerptheme-catnav__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 8px;
	border-radius: var(--arianerptheme-radius-sm);
	color: var(--arianerptheme-text);
	transition: background-color .15s ease, color .15s ease;
}

.arianerptheme-catnav__link:hover {
	background: var(--arianerptheme-surface-2);
	color: var(--arianerptheme-primary);
	text-decoration: none;
}

.arianerptheme-catnav__link.is-active {
	background: color-mix(in srgb, var(--arianerptheme-primary) 12%, transparent);
	color: var(--arianerptheme-primary);
	font-weight: 700;
}

.arianerptheme-catnav__icon {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	font-size: .9rem;
}

.arianerptheme-catnav__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-size: .9rem;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.arianerptheme-catnav__count {
	min-width: 24px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--arianerptheme-surface-2);
	color: var(--arianerptheme-muted);
	font-size: .72rem;
	font-weight: 600;
	text-align: center;
}

.arianerptheme-catnav__more {
	display: block;
	padding: 12px 16px;
	border-top: 1px solid var(--arianerptheme-border);
	color: var(--arianerptheme-primary);
	font-size: .85rem;
	font-weight: 600;
}

/* ফোনে ← → বাটন লাগে না — আঙুলে সোয়াইপ */
@media (max-width: 639px) {
	.arianerptheme-scroller__nav {
		display: none !important;
	}
}

/* ── পণ্যের অংশ: শিরোনাম, সংখ্যা, সাজানো, "আরও দেখুন" ── */
.arianerptheme-home-products {
	scroll-margin-top: calc(var(--arianerptheme-header-h) + 12px);
}

.arianerptheme-home-products__head {
	flex-wrap: wrap;
	gap: 10px 16px;
}

.arianerptheme-home-products__title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	min-width: 0;
}

.arianerptheme-home-products__title .arianerptheme-section__title:focus {
	outline: none;
}

.arianerptheme-home-products__count {
	color: var(--arianerptheme-muted);
	font-size: .9rem;
	font-weight: 600;
}

.arianerptheme-home-products__count[hidden],
.arianerptheme-home-products__tools[hidden],
.arianerptheme-home-products__more[hidden] {
	display: none;
}

.arianerptheme-home-products__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.arianerptheme-home-products__tools select {
	min-height: 38px;
	padding: 6px 32px 6px 12px;
	border: 1px solid var(--arianerptheme-border);
	border-radius: var(--arianerptheme-radius-sm);
	background: var(--arianerptheme-surface);
	color: var(--arianerptheme-text);
	font: inherit;
	font-size: .9rem;
}

.arianerptheme-home-products__tools .arianerptheme-shop__stock {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 0 12px;
	border: 1px solid var(--arianerptheme-border);
	border-radius: var(--arianerptheme-radius-sm);
	background: var(--arianerptheme-surface);
	font-size: .9rem;
	cursor: pointer;
}

.arianerptheme-home-products__tools .arianerptheme-shop__stock input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--arianerptheme-primary);
}

.arianerptheme-home-products__body {
	transition: opacity .15s ease;
}

.arianerptheme-home-products__body.is-loading {
	opacity: .45;
	pointer-events: none;
}

.arianerptheme-home-products__more {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.arianerptheme-home-products__more-btn {
	min-width: 220px;
}

.arianerptheme-home-products__more-btn[aria-busy="true"] {
	opacity: .6;
	cursor: progress;
}

/* ক্যাটাগরি বাছাই করা থাকলে ব্যানার লুকানো — পণ্য সরাসরি সামনে */
.arianerptheme-home-filtered .arianerptheme-hero {
	display: none;
}

@media (max-width: 639px) {
	.arianerptheme-home-products__tools {
		width: 100%;
		margin-left: 0;
	}

	.arianerptheme-home-products__tools select {
		flex: 1;
	}
}

/* ── আনুভূমিক পণ্যের সারি ("অফারে আছে", ক্যাটাগরির সারি) ── */
.arianerptheme-home-row {
	padding-block: 20px 0;
}

.arianerptheme-home-row + .arianerptheme-home-row {
	padding-top: 12px;
}

.arianerptheme-home-row__title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 12px;
	min-width: 0;
}

.arianerptheme-home-row__title .arianerptheme-section__title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.arianerptheme-home-row__icon {
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--arianerptheme-danger) 14%, transparent);
	color: var(--arianerptheme-danger);
}

.arianerptheme-home-row__icon .arianerptheme-icon {
	width: 18px;
	height: 18px;
}

.arianerptheme-home-row__sub {
	color: var(--arianerptheme-muted);
	font-size: .88rem;
	font-weight: 600;
}

.arianerptheme-home-row--offers .arianerptheme-home-row__sub {
	color: var(--arianerptheme-danger);
}

.arianerptheme-home-row__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: auto;
}

/* গ্রিডকে এক সারিতে — প্রতিটি কার্ড নির্দিষ্ট চওড়া, পাশে সোয়াইপ */
.arianerptheme-grid.arianerptheme-grid--row {
	grid-template-columns: none;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 12px) / 2.25); /* ফোনে ২টি + পরেরটির একটু — বোঝা যায় সরানো যায় */
	margin: 0 calc(var(--arianerptheme-gutter) * -1);
	padding: 2px var(--arianerptheme-gutter) 10px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--arianerptheme-gutter);
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.arianerptheme-grid--row::-webkit-scrollbar {
	display: none;
}

.arianerptheme-grid--row > * {
	scroll-snap-align: start;
}

@media (min-width: 640px) {
	.arianerptheme-grid.arianerptheme-grid--row {
		grid-auto-columns: calc((100% - 32px) / 3.2);
	}
}

@media (min-width: 1024px) {
	.arianerptheme-grid.arianerptheme-grid--row {
		grid-auto-columns: calc((100% - 48px) / 4);
		margin: 0;
		padding-inline: 0;
		scroll-padding-inline: 0;
	}
}

@media (min-width: 1280px) {
	.arianerptheme-grid.arianerptheme-grid--row {
		grid-auto-columns: calc((100% - 64px) / 5); /* নিচের গ্রিডের কার্ডের সমান চওড়া */
	}
}

@media (min-width: 1536px) {
	.arianerptheme-grid.arianerptheme-grid--row {
		grid-auto-columns: calc((100% - 70px) / 6);
	}
}

/* ক্যাটাগরি বাছাই করা থাকলে সারিগুলো লুকানো — শুধু সেই ক্যাটাগরির পণ্য */
.arianerptheme-home-filtered .arianerptheme-home-row {
	display: none;
}
