/* ═══════════════════════════════════════════════════════════════════════════
   Homepage. Loaded only by pages/home.php (trialled at /index2 first).

   Three ideas:
   1. A short hero. Pitch, trust lines and a strip of category "aisles" fit in
      about 300px, so Best Sellers starts inside the first screen.
   2. Bands. Every section is full-width, alternating cream (--h2-band) and a
      slightly darker sand (--h2-band-alt), so sections separate without
      borders or boxes.
   (The compact sticky header began here and is now site-wide, in site.css.)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
	--h2-band: var(--color-bg);          /* #f9f5f0, the site's cream */
	--h2-band-alt: #f0e8dc;              /* one step darker, same warmth */
	--h2-band-edge: #e6dccd;
	--h2-ink: var(--retro-navy);
	--h2-pad: clamp(1.75rem, 3.5vw, 2.75rem);
}

/* The header (tighter, sticky, compact on scroll) is site-wide in site.css. */

/* ── 1. Hero ─────────────────────────────────────────────────────────────── */

.h2-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	color: #fff;
	background: var(--h2-ink);
}

.h2-hero-bg {
	position: absolute;
	inset: 0;
	/* Below the scrim (::before, z-index -1). At equal z-index this div,
	   coming later in the DOM, painted over the scrim and it did nothing. */
	z-index: -2;
	background-size: cover;
	background-position: right center;
	/* hero-candy.jpg is dark on the left by design, so it can run near full
	   strength; the old gumdrop photo needed 0.35 to keep the type legible. */
	opacity: 0.9;
}

/* Fade the photo into the ink on the text side, so the copy never sits on
   a busy patch of gumdrops. */
.h2-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(90deg, var(--h2-ink) 0%, rgba(24, 18, 12, 0.8) 35%, rgba(24, 18, 12, 0) 70%);
}

.h2-hero-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: center;
	padding-top: 1.75rem;
	padding-bottom: 1.25rem;
}

.h2-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.5rem;
	font-family: var(--font-heading);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--retro-yellow);
}

.h2-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--color-primary);
	box-shadow: 0 0 0 4px rgba(0, 202, 203, 0.25);
	animation: h2-pulse 2.4s ease-in-out infinite;
}

@keyframes h2-pulse {
	50% { box-shadow: 0 0 0 7px rgba(0, 202, 203, 0); }
}

.h2-title {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 400;
	font-size: clamp(2.25rem, 4.6vw, 3.75rem);
	line-height: 0.95;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.h2-title em {
	font-style: normal;
	color: var(--color-primary);
}

.h2-sub {
	margin: 0.6rem 0 0;
	max-width: 34rem;
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.82);
}

.h2-ctas {
	display: flex;
	gap: 0.75rem;
	margin-top: 1rem;
	flex-wrap: wrap;
}

.h2-btn {
	display: inline-flex;
	align-items: center;
	padding: 0.6rem 1.2rem;
	border-radius: var(--radius-sm);
	font-family: var(--font-heading);
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-decoration: none;
	transition: transform 0.15s ease, background 0.15s ease;
}

.h2-btn:hover {
	transform: translateY(-1px);
}

.h2-btn-primary {
	background: var(--color-primary);
	color: #034849;
}

.h2-btn-primary:hover {
	background: #33d8d8;
}

.h2-btn-ghost {
	color: #fff;
	border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.h2-btn-ghost:hover {
	border-color: #fff;
}

.h2-trust {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.55rem;
}

.h2-trust li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.85rem;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(6px);
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.75);
	line-height: 1.3;
}

.h2-trust li > span:first-child {
	font-size: 1.25rem;
}

.h2-trust strong {
	display: block;
	color: #fff;
	font-size: 0.875rem;
}

/* Aisles: the category strip along the bottom edge of the hero. */
.h2-aisles {
	padding-bottom: 1.1rem;
}

.h2-aisle-track {
	list-style: none;
	margin: 0;
	padding: 0.25rem 0 0.35rem;
	display: flex;
	gap: 0.6rem;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-snap-type: x proximity;
}

.h2-aisle-track::-webkit-scrollbar {
	display: none;
}

.h2-aisle-track li {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.h2-aisle {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.3rem 0.95rem 0.3rem 0.3rem;
	border-radius: 999px;
	background: #fff;
	color: var(--h2-ink);
	text-decoration: none;
	box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.h2-aisle:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 0 var(--color-primary);
}

.h2-aisle-img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: var(--color-primary-wash);
	font-family: var(--font-display);
	font-size: 1.1rem;
	color: var(--color-primary-dark);
	flex-shrink: 0;
}

.h2-aisle-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.h2-aisle-name {
	font-family: var(--font-heading);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	white-space: nowrap;
}

.h2-aisle-all {
	background: var(--color-primary);
}

.h2-aisle-all .h2-aisle-img {
	background: rgba(255, 255, 255, 0.5);
}

/* ── 2. Bands ────────────────────────────────────────────────────────────── */

.h2-band {
	background: var(--h2-band);
	padding: var(--h2-pad) 0;
}

.h2-band-alt {
	background: var(--h2-band-alt);
	border-top: 1px solid var(--h2-band-edge);
	border-bottom: 1px solid var(--h2-band-edge);
}

/* The band now does the separating, so the pieces inside drop their own
   outer margins rather than stacking gaps on top of the band padding. */
.h2-band .product-rail-section,
.h2-band .savings-band,
.h2-band .warehouse-banner {
	margin-top: 0;
	margin-bottom: 0;
}

.h2-band .product-rail-scroll {
	padding-bottom: 0.5rem;
}

.h2-band .brands-section,
.h2-band .brands-track {
	padding-bottom: 0.25rem;
}

/* Cards sit on white, so on the darker band they lift off it a little. */
.h2-band-alt .rail-card,
.h2-band-alt .brand-logo-card,
.h2-band-alt .flavor-tile {
	box-shadow: 0 1px 2px rgba(24, 18, 12, 0.06), 0 4px 12px rgba(24, 18, 12, 0.05);
}

/* Seasonal keeps its accent as a thin stripe rather than a boxed gradient. */
.h2-band-seasonal {
	border-top: 3px solid #f97316;
}

.h2-band .popular-links {
	padding-top: 0;
}

/* ── 7. Colour + flavour side by side ────────────────────────────────────── */

.h2-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
}

.h2-split .section-heading {
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	margin-bottom: 0.4rem;
}

.h2-split .section-subheading {
	margin-bottom: 0.9rem;
}

.h2-split .jar-rack {
	flex-wrap: wrap;
	overflow: visible;
	padding: 0;
	margin: 0;
}

.h2-split .flavor-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
	.h2-split {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 860px) {
	.h2-hero-inner {
		grid-template-columns: 1fr;
		gap: 1rem;
		padding-top: 1.25rem;
		padding-bottom: 0.9rem;
	}

	/* Three trust cards would push the aisles out of the first screen on a
	   phone; one swipeable line keeps all three. */
	.h2-trust {
		display: flex;
		overflow-x: auto;
		scrollbar-width: none;
		gap: 0.5rem;
	}

	.h2-trust::-webkit-scrollbar {
		display: none;
	}

	.h2-trust li {
		flex: 0 0 auto;
		padding: 0.45rem 0.7rem;
		font-size: 0.75rem;
	}

	.h2-trust li > span:last-child {
		white-space: nowrap;
	}

	.h2-trust strong {
		display: inline;
		font-size: 0.8125rem;
	}

	.h2-hero::before {
		/* On a phone the copy sits over the candy itself, so the scrim is
		   heavier here than on desktop, where the image's own dark side does it. */
		background: linear-gradient(180deg, rgba(24, 18, 12, 0.86) 0%, rgba(24, 18, 12, 0.72) 60%, rgba(24, 18, 12, 0.4) 100%);
	}
}

@media (max-width: 640px) {
	/* The hero's aisle strip is the same list, one tap away, and the menu
	   button still carries the full navigation. */
	.site-header .site-nav {
		display: none;
	}

	.h2-title {
		font-size: 2.1rem;
	}

	.h2-sub {
		font-size: 0.875rem;
	}

	.h2-ctas {
		display: none;
	}

	.h2-split .flavor-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.h2-dot {
		animation: none;
	}
}
