/**
 * Homepage sections — hero slider, category grid, product carousels.
 * Mirrors the Aluminum Ladders Kenya storefront homepage.
 */

:root {
	--home-section-padding: 40px 0;
}

/* ==========================================
   1. HERO SLIDER
   ========================================== */
.home-hero {
	padding: 16px;
}

.home-hero__card {
	position: relative;
	overflow: hidden;
	border-radius: 16px;
	background: var(--as-secondary);
}

.home-hero__glow {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(ellipse 65% 80% at 85% 50%, rgba(224, 92, 30, 0.14) 0%, transparent 70%);
}

.home-hero__inner {
	position: relative;
	padding: 48px 0;
}

.home-hero__slide {
	display: none;
	grid-template-columns: 1fr;
	align-items: center;
	gap: 32px;
	min-height: 420px;
}

.home-hero__slide.is-active {
	display: grid;
	animation: as-hero-fade-in 0.5s ease forwards;
}

@keyframes as-hero-fade-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Left column ── */
.home-hero__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

.home-hero__eyebrow {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	color: var(--as-primary);
}

.home-hero__title {
	margin: 16px 0 0;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.15;
	color: var(--as-white);
}

.home-hero__title-accent {
	color: var(--as-primary);
}

.home-hero__desc {
	margin: 20px 0 0;
	max-width: 28rem;
	font-size: 14px;
	line-height: 1.65;
	color: #FFFFFF;
	font-weight: 700;
}

.home-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 32px;
}

.home-hero__cta-primary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	border-radius: var(--as-radius-pill);
	background: var(--as-primary);
	color: var(--as-white);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: var(--as-shadow-lg);
	transition: background 180ms ease, box-shadow 180ms ease;
}

.home-hero__cta-primary:hover {
	background: var(--as-primary-dark);
	color: var(--as-white);
	box-shadow: 0 20px 25px -5px rgba(21, 23, 28, 0.2);
}

.home-hero__cta-ghost {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: var(--as-radius-pill);
	background: rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(4px);
	color: var(--as-white);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: background 180ms ease, border-color 180ms ease;
}

.home-hero__cta-ghost:hover {
	border-color: rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.1);
	color: var(--as-white);
}

.home-hero__cta-ghost-chevron {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	flex-shrink: 0;
}

.home-hero__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 40px;
}

.home-hero__badge {
	display: flex;
	align-items: center;
	gap: 10px;
}

.home-hero__badge-icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgba(203, 114, 70, 0.2);
	color: var(--as-primary);
}

.home-hero__badge-text {
	font-size: 12px;
	line-height: 1.35;
	color: #FFFFFF;
	font-weight: 700;
}

.home-hero__badge-text strong {
	display: block;
	font-weight: 800;
	color: var(--as-white);
}

/* ── Right column: one product ── */
.home-hero__visual {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.home-hero__product {
	position: relative;
	width: 100%;
}

.home-hero__product-media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	max-width: 340px;
	max-height: 340px;
	margin-inline: auto;
}

.home-hero__product-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
	filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.15));
	transition: transform 500ms ease;
}

.home-hero__product-media:hover .home-hero__product-image {
	transform: scale(1.05);
}

.home-hero__product-sale {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	padding: 4px 10px;
	border-radius: var(--as-radius-pill);
	background: var(--as-danger);
	color: var(--as-white);
	font-size: 11px;
	font-weight: 700;
	box-shadow: var(--as-shadow-sm);
}

.home-hero__product-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-width: 340px;
	margin: 16px auto 0;
	padding: 12px 16px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(4px);
}

.home-hero__product-info {
	min-width: 0;
}

.home-hero__product-name {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--as-white);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.home-hero__product-price {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-top: 2px;
	font-size: 14px;
	font-weight: 700;
	color: var(--as-primary);
}

.home-hero__product-price del {
	font-size: 12px;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.4);
}

.home-hero__product-price ins {
	text-decoration: none;
	color: var(--as-primary);
}

.home-hero__product-add {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--as-primary);
	color: var(--as-white);
	box-shadow: var(--as-shadow-lg);
	transition: background 180ms ease, transform 180ms ease;
}

.home-hero__product-add:hover {
	background: var(--as-primary-dark);
	color: var(--as-white);
	transform: scale(1.1);
}

.home-hero__product-placeholder {
	width: 100%;
	max-width: 340px;
	margin-inline: auto;
	aspect-ratio: 1 / 1;
	border-radius: var(--as-radius-card);
	background: rgba(255, 255, 255, 0.05);
}

/* ── Dots and arrows ── */
.home-hero__dots {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
}

.home-hero__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: var(--as-radius-pill);
	background: rgba(255, 255, 255, 0.3);
	cursor: pointer;
	transition: width 300ms ease, background 300ms ease;
}

.home-hero__dot:hover {
	background: rgba(255, 255, 255, 0.5);
}

.home-hero__dot.is-active {
	width: 32px;
	background: var(--as-primary);
}

.home-hero__arrow {
	position: absolute;
	top: 50%;
	z-index: 10;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	transform: translateY(-50%);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(4px);
	color: var(--as-white);
	cursor: pointer;
	transition: background 180ms ease, border-color 180ms ease;
}

.home-hero__arrow:hover {
	border-color: rgba(255, 255, 255, 0.3);
	background: rgba(255, 255, 255, 0.2);
}

.home-hero__arrow--prev {
	left: 8px;
}

.home-hero__arrow--next {
	right: 8px;
}

/* ==========================================
   2. SHOP BY CATEGORY
   ========================================== */
.home-categories {
	padding: var(--home-section-padding);
	background: var(--as-white);
}

/* Narrow payment panel + wide category column.
   Single column until there is room for both side by side. */
.home-categories-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}

.home-categories-main {
	min-width: 0;
}

.home-payment-panel {
	min-width: 0;
	padding: 12px;
	border: 1px solid var(--as-border-light);
	border-radius: var(--as-radius-card);
	background: var(--as-white);
	box-shadow: var(--as-shadow-sm);
	/* On small screens the artwork would stretch edge to edge. */
	max-width: 360px;
	margin-inline: auto;
}

.home-payment-panel__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--as-radius-control);
}

.home-categories-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-top: 20px;
}

.home-category-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 16px;
	background: var(--as-white);
	border: 1px solid var(--as-border-light);
	border-radius: var(--as-radius-card);
	text-align: center;
	text-decoration: none;
	transition: box-shadow 200ms ease;
}

.home-category-card:hover {
	box-shadow: var(--as-shadow-md);
}

.home-category-badge {
	position: relative;
	display: grid;
	place-items: center;
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--as-soft);
	overflow: hidden;
}

.home-category-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.home-category-card:hover .home-category-image {
	transform: scale(1.1);
}

.home-category-title {
	display: block;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--as-ink);
	transition: color 150ms ease;
}

.home-category-card:hover .home-category-title {
	color: var(--as-primary);
}

.home-category-count {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--as-gray-400);
}

/* Product carousel styles live in components.css so the single-product
   "Related Products" row can reuse them. */

/* ==========================================
   3. RESPONSIVE
   ========================================== */
@media (min-width: 640px) {
	.home-categories-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.home-hero__title {
		font-size: 36px;
	}
}

@media (min-width: 768px) {
	/* Payment panel and categories sit side by side from here up */
	.home-categories-layout.has-payment-panel {
		grid-template-columns: 240px minmax(0, 1fr);
		gap: 28px;
	}

	.home-payment-panel {
		position: sticky;
		top: 96px;
		max-width: none;
		margin-inline: 0;
	}

	.home-hero {
		padding: 24px;
	}

	.home-hero__card {
		border-radius: 20px;
	}

	.home-hero__inner {
		padding: 64px 0;
	}

	.home-hero__slide {
		min-height: 460px;
	}

	.home-hero__title {
		font-size: 48px;
	}

	.home-hero__desc {
		font-size: 16px;
	}

	.home-hero__arrow--prev {
		left: 16px;
	}

	.home-hero__arrow--next {
		right: 16px;
	}

	.home-categories-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	:root {
		--home-section-padding: 56px 0;
	}

	.home-hero__product-media {
		max-width: 380px;
		max-height: 380px;
	}

	.home-hero__product-card {
		max-width: 380px;
	}
}

@media (min-width: 1024px) {
	.home-categories-layout.has-payment-panel {
		grid-template-columns: 280px minmax(0, 1fr);
		gap: 32px;
	}

	/* Five across only when the grid has the full container to itself */
	.home-categories-layout.has-payment-panel .home-categories-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.home-hero__slide {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 64px;
	}

	.home-categories-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}
