/**
 * homepage.css
 *
 * Homepage-only sections: hero carousel, trust bar, featured categories,
 * SEO text/testimonials, blog preview, newsletter. Ported directly from
 * the approved review mockup. Product carousel sections (New Arrivals /
 * Best Offers / Trending) reuse product-carousel.css + product-card.css —
 * nothing duplicated here.
 */

.section {
	padding: 48px 0;
}
/*
 * Alternating section backgrounds (mockup: white / #fafafa, starting
 * white right after the trust bar). This class existed before but was
 * never applied anywhere — the `.section`/`.wrap` wrapper structure was
 * already correct (each homepage template part wraps itself, or is
 * wrapped by front-page.php, depending on the part — see each
 * template's own docblock), the alternation itself was just never
 * wired in. testimonials.php already hardcoded its own `#fafafa` inline
 * style; this class covers the other two sections that need it (New
 * Arrivals and Trending Products), applied conditionally via the
 * `$carousel_section_alt` query var product-carousel.php reads — see
 * front-page.php.
 */
.section-alt {
	background: #fafafa;
}
.section-title {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	border-bottom: 2px solid #111;
	padding-bottom: 10px;
	margin-bottom: 24px;
}
.section-title h2 {
	font-size: 20px;
	text-transform: uppercase;
	margin: 0;
}

/* ---------------- Hero carousel ---------------- */
.hero-carousel {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--line);
}
.hero-track {
	display: flex;
	transition: transform 0.5s ease;
}
.hero-slide {
	min-width: 100%;
	height: 380px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-align: center;
	padding: 20px;
}
/*
 * Per-slide dark gradient backgrounds — the .s1/.s2/.s3 classes were
 * already being output correctly by hero-carousel.php, but these
 * background rules were never actually ported from the mockup, so
 * slides had no background at all (relying on whatever sat behind
 * them). Restoring the mockup's exact gradients.
 */
.hero-slide.s1 {
	background: linear-gradient(135deg, #111 0%, #333 100%);
}
.hero-slide.s2 {
	background: linear-gradient(135deg, #222 0%, #555 100%);
}
.hero-slide.s3 {
	background: linear-gradient(135deg, #000 0%, #3a3a3a 100%);
}
.hero-slide .inner {
	max-width: 620px;
}
.hero-slide h1 {
	font-size: 34px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	margin-bottom: 0.3em;
}
.hero-slide p {
	color: #ddd;
	margin-bottom: 20px;
}
.hero-slide .btn {
	display: inline-block;
	background: #fff;
	color: #111;
	padding: 12px 24px;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 700;
}
.hero-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid #111;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 16px;
	z-index: 5;
	cursor: pointer;
}
.hero-arrow.prev {
	left: 20px;
}
.hero-arrow.next {
	right: 20px;
}
.hero-dots {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 5;
}
.hero-dots button {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 1px solid #fff;
	background: transparent;
	padding: 0;
	cursor: pointer;
}
.hero-dots button.active {
	background: #fff;
}

/* ---------------- Trust bar ---------------- */
.usp-bar {
	border-bottom: 1px solid var(--line);
	background: var(--bg-soft);
}
.usp-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	padding: 26px 0;
}
.usp-item {
	text-align: center;
	font-size: 12.5px;
}
.usp-item .icon {
	margin-bottom: 6px;
	display: flex;
	justify-content: center;
	color: var(--ink);
}
.usp-item .icon svg {
	width: 24px;
	height: 24px;
}
.usp-item strong {
	display: block;
	text-transform: uppercase;
	font-size: 13px;
	letter-spacing: 0.02em;
	margin-bottom: 2px;
}

/* ---------------- Featured categories ---------------- */
.cat-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
}
.cat-card {
	position: relative;
	aspect-ratio: 1 / 1;
	border: 1px solid #111;
	overflow: hidden;
	display: flex;
	align-items: flex-end;
	background: #e8e8e8;
}
.cat-card span {
	background: rgba(17, 17, 17, 0.85);
	color: #fff;
	width: 100%;
	padding: 10px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-weight: 700;
}
.cat-swatch {
	position: absolute;
	inset: 0;
}

/*
 * Carousel variant of Shop by Category — used once there are 5+
 * featured categories (see featured-categories.php's $use_carousel
 * check); below that it falls back to the plain .cat-grid above.
 * Reuses the same .carousel-wrap/.carousel-track/.carousel-arrow
 * markup contract and JS (assets/js/product-carousel.js) as the
 * product carousels — no new scroll behavior needed, just sizing.
 */
.carousel-track .cat-card {
	min-width: 220px;
	max-width: 220px;
	flex: 0 0 auto;
	scroll-snap-align: start;
}
/*
 * .cat-card's height comes from `aspect-ratio: 1/1` against its own
 * width, not a fixed pixel value like the product-carousel cards
 * (product-carousel.css's .carousel-arrow math is hardcoded to that
 * fixed 210px card height) — so centering via top:50% here instead of
 * copying that hardcoded pixel offset.
 */
.cat-carousel .carousel-arrow {
	top: 50%;
	margin-top: 0;
	transform: translateY(-50%);
}

/* ---------------- SEO text + testimonials ---------------- */
.testimonial-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-top: 10px;
}
.testimonial-card {
	border: 1px solid #ddd;
	padding: 20px;
	font-size: 13px;
}
.testimonial-card p {
	color: var(--ink-soft);
	margin-bottom: 14px;
	font-style: italic;
}
.testimonial-card .author {
	font-weight: 700;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* ---------------- Blog preview ---------------- */
.blog-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}
.blog-card {
	border: 1px solid #ddd;
}
.blog-card .thumb {
	aspect-ratio: 16 / 9;
	background: #eee;
}
.blog-card .body {
	padding: 14px;
}
.blog-card h4 {
	font-size: 13.5px;
	margin-bottom: 6px;
}
.blog-card a.readmore {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 700;
}

/* ---------------- Newsletter ---------------- */
.newsletter {
	background: #111;
	color: #fff;
	text-align: center;
	padding: 46px 24px;
}
.newsletter h2 {
	text-transform: uppercase;
	margin-bottom: 8px;
}
.newsletter p {
	color: #ccc;
	margin-bottom: 20px;
}
.newsletter form {
	display: flex;
	max-width: 420px;
	margin: 0 auto;
}
.newsletter input {
	flex: 1;
	border: 0;
	padding: 12px;
	font-size: 13px;
}
.newsletter button {
	background: #fff;
	color: #111;
	border: 0;
	padding: 0 20px;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.04em;
}
.newsletter .fineprint {
	font-size: 11px;
	color: #888;
	margin-top: 10px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
	.usp-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.cat-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.testimonial-grid,
	.blog-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 600px) {
	.usp-grid {
		grid-template-columns: 1fr;
	}
	.cat-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.testimonial-grid,
	.blog-grid {
		grid-template-columns: 1fr;
	}
}
