/*
 * Simple Bangla — homepage sections.
 *
 * Loaded on the front page only. The cards themselves live in card.css.
 */

.sb-home {
	padding-block: var(--sb-space-4) var(--sb-space-7);
}

.sb-home-section + .sb-home-section {
	margin-top: var(--sb-space-6);
}

/* ------------------------------------------------------------------ *
 * Hero: narrow Hot Deals slider beside the wide banner carousel
 * ------------------------------------------------------------------ */

.sb-hero {
	margin-bottom: var(--sb-space-6);
}

.sb-hero__grid {
	display: grid;
	gap: var(--sb-space-4);
}

/* The deals column sits under the banner on a phone — the banner is the headline. */
.sb-hero__deals {
	order: 2;
}

.sb-hero__banner {
	order: 1;
}

@media (min-width: 900px) {
	.sb-hero__grid {
		/* Measured off the reference: roughly one part card to three parts banner. */
		grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
		align-items: stretch;
	}

	.sb-hero__grid--single {
		grid-template-columns: minmax(0, 1fr);
	}

	.sb-hero__deals {
		order: 0;
	}

	.sb-hero__banner {
		order: 0;
	}
}

/* One card at a time in the hero column, whatever the breakpoint. */
.sb-hero__deals .sb-products--single {
	--sb-per-view: 1;
}

.sb-hero__deals .sb-card {
	border: 1px solid var(--sb-line);
}

.sb-hero__track {
	display: flex;
	gap: 0;
	scroll-snap-type: x mandatory;
	border-radius: var(--sb-radius);
}

.sb-hero__slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	display: block;
}

.sb-hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Keeps every slide the same height however the uploads were cropped. */
	aspect-ratio: 2 / 1;
}

@media (min-width: 900px) {
	.sb-hero__image {
		aspect-ratio: 16 / 7;
	}
}

.sb-home__notice {
	padding: var(--sb-space-6);
	border-radius: var(--sb-radius);
	background: var(--sb-bg-alt);
	color: var(--sb-muted);
	text-align: center;
}

/* ------------------------------------------------------------------ *
 * Category circles
 * ------------------------------------------------------------------ */

/*
 * A scrolling row on phones, a centred row once there is space. Wrapping four circles onto a
 * second line looks like a mistake; scrolling them does not.
 */
.sb-circles {
	display: flex;
	gap: var(--sb-space-4);
	list-style: none;
	padding-bottom: var(--sb-space-2);
}

.sb-circles__item {
	flex: 0 0 auto;
}

.sb-circles__link {
	display: grid;
	justify-items: center;
	gap: var(--sb-space-2);
	width: 110px;
	color: inherit;
	text-decoration: none;
}

.sb-circles__frame {
	display: grid;
	place-items: center;
	width: 96px;
	height: 96px;
	overflow: hidden;
	border-radius: var(--sb-radius-pill);
	background: var(--sb-bg-alt);
	transition: transform var(--sb-transition);
}

.sb-circles__link:hover .sb-circles__frame,
.sb-circles__link:focus-visible .sb-circles__frame {
	transform: translateY(-3px);
}

.sb-circles__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Stand-in for a category that has no thumbnail set yet. */
.sb-circles__initial {
	font-family: var(--sb-font-heading);
	font-size: 2rem;
	color: var(--sb-muted);
}

.sb-circles__label {
	font-family: var(--sb-font-heading);
	font-size: var(--sb-text-sm);
	color: var(--sb-muted);
	text-align: center;
	line-height: 1.3;
}

@media (min-width: 768px) {
	.sb-circles {
		justify-content: center;
		flex-wrap: wrap;
		gap: var(--sb-space-5);
	}

	.sb-circles__frame {
		width: 120px;
		height: 120px;
	}

	.sb-circles__link {
		width: 130px;
	}

	.sb-circles__label {
		font-size: var(--sb-text-base);
	}
}

/* ------------------------------------------------------------------ *
 * Banner pair
 * ------------------------------------------------------------------ */

.sb-banners {
	display: grid;
	gap: var(--sb-space-4);
}

.sb-banners__item {
	display: block;
	overflow: hidden;
	border-radius: var(--sb-radius);
}

.sb-banners__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--sb-transition);
}

a.sb-banners__item:hover .sb-banners__image {
	transform: scale(1.02);
}

/*
 * The two source images differ in size, but the reference renders them as equal columns —
 * so the grid splits evenly and object-fit absorbs the difference.
 */
@media (min-width: 768px) {
	.sb-banners {
		grid-template-columns: 1fr 1fr;
		gap: var(--sb-space-4);
	}

	/* A pair with only one banner configured should not sit in a half-width column. */
	.sb-banners:has(.sb-banners__item:only-child) {
		grid-template-columns: 1fr;
	}

	.sb-banners__image {
		aspect-ratio: 2 / 1;
	}
}
