/**
 * Homepage sections. Loaded on the front page only.
 */

/* ==========================================================================
   Hero — full-bleed image, copy on the inline-start side (right in RTL)
   ========================================================================== */

.site-main--home {
	padding-block-start: 0;
}

.hero {
	position: relative;
	background: var(--c-surface);
}

.hero__track {
	display: flex;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.hero__track::-webkit-scrollbar {
	display: none;
}

.hero__slide {
	position: relative;
	display: grid;
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.hero__media img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.hero__content {
	padding: 1.5rem var(--gutter) 3rem;
}

.hero__eyebrow {
	margin: 0 0 0.5rem;
	font-size: var(--fs-sm);
	font-weight: 500;
	color: var(--c-text-muted);
}

.hero__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.5rem, 1rem + 2.4vw, 3rem);
	font-weight: 800;
	line-height: 1.5;
}

.hero__text {
	max-width: 44ch;
	margin: 0 0 1.5rem;
	color: var(--c-text-muted);
	line-height: 2;
}

.hero__button {
	padding-inline: 1.5rem;
}

.hero__slide--no-image .hero__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 320px;
}

@media (min-width: 768px) {
	.hero__media,
	.hero__content {
		grid-area: 1 / 1;
	}

	.hero__media {
		position: relative;
	}

	.hero__media img {
		aspect-ratio: auto;
		height: clamp(400px, 42vw, 680px);
	}

	/* Soft scrim on the text side so copy stays readable on any photo. */
	.hero__media::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(to left, rgba(246, 245, 243, 1) 0%, rgba(246, 245, 243, 0.56) 30%, rgba(246, 245, 243, 0) 55%);
		opacity: var(--scrim, 0.8);
	}

	html:not([dir="rtl"]) .hero__media::after {
		background: linear-gradient(to right, rgba(246, 245, 243, 1) 0%, rgba(246, 245, 243, 0.56) 30%, rgba(246, 245, 243, 0) 55%);
	}

	.hero__slide--light .hero__media::after {
		background: linear-gradient(to left, rgba(20, 19, 18, 0.875) 0%, rgba(20, 19, 18, 0.5) 35%, rgba(20, 19, 18, 0) 65%);
	}

	html:not([dir="rtl"]) .hero__slide--light .hero__media::after {
		background: linear-gradient(to right, rgba(20, 19, 18, 0.875) 0%, rgba(20, 19, 18, 0.5) 35%, rgba(20, 19, 18, 0) 65%);
	}

	/* Content box follows the site container so text aligns with the header. */
	.hero__content {
		position: relative;
		z-index: 1;
		align-self: center;
		width: 100%;
		max-width: calc(var(--container) + 2 * var(--gutter));
		margin-inline: auto;
		padding-block: 3rem;
	}

	.hero__content > * {
		max-width: 520px;
	}

	.hero__slide--light .hero__eyebrow,
	.hero__slide--light .hero__text {
		color: rgba(255, 255, 255, 0.85);
	}

	.hero__slide--light .hero__title {
		color: #fff;
	}

	.hero__slide--light .hero__button {
		background: #fff;
		border-color: #fff;
		color: var(--c-text);
	}

	.hero__text {
		font-size: var(--fs-md);
	}
}

/* Dots sit on the slide, bottom centre. */
.hero__controls {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0.75rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.1rem;
	pointer-events: none;
}

.hero__controls > * {
	pointer-events: auto;
}

@media (min-width: 768px) {
	.hero__controls {
		inset-block-end: 1.25rem;
	}
}

.hero__dot,
.hero__pause {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--c-text);
	cursor: pointer;
}

.hero__dot::before {
	content: "";
	width: 9px;
	height: 9px;
	border: 1.5px solid var(--c-text-muted);
	border-radius: 50%;
	transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.hero__dot[aria-current="true"]::before {
	border-color: var(--c-text);
	background: var(--c-text);
}

.hero__pause .icon {
	width: 0.9rem;
	height: 0.9rem;
}

.hero__pause[aria-pressed="true"] {
	color: var(--c-accent-strong);
}

/* Poster slides: the image carries its own text and button, so it is
   shown with no shade and is itself the link. Every poster gets the
   first poster's shape (--hero-poster-ratio, set in hero.php), so all
   slides are the same size; a poster of another shape is shown whole
   inside that frame (never cut) instead of making the slider jump. */
.hero .hero__slide--poster .hero__poster {
	display: block;
	width: 100%;
	background: var(--c-surface);
}

.hero .hero__slide--poster .hero__media img {
	width: 100%;
	height: auto;
	aspect-ratio: var(--hero-poster-ratio, 1920 / 850);
	object-fit: contain;
}

.hero .hero__slide--poster .hero__media::after {
	content: none;
}

/* Dots go under posters instead of on top of their text. */
.hero:has(.hero__slide--poster) .hero__controls {
	position: static;
	padding-block: 0.4rem 0;
}

/* ==========================================================================
   Categories
   ========================================================================== */

.category-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.category-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 1rem;
	}
}

@media (min-width: 1200px) {
	.category-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

.category-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding: 0.9rem 0.5rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--c-surface);
	text-align: center;
	text-decoration: none;
	transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.category-card:hover {
	border-color: var(--c-border-strong);
	background: var(--c-surface-2);
	color: inherit;
}

.category-card__media {
	display: block;
	width: 100%;
	max-width: 130px;
	margin-block-end: 0.6rem;
}

.category-card__media img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	mix-blend-mode: multiply;
	transition: transform 0.3s var(--ease);
}

.category-card:hover .category-card__media img {
	transform: translateY(-3px);
}

.category-card__name {
	font-size: var(--fs-sm);
	font-weight: 700;
	line-height: 1.5;
}

.category-card__more {
	display: none;
	align-items: center;
	gap: 0.3rem;
	margin-block-start: 0.25rem;
	font-size: var(--fs-xs);
	color: var(--c-text-muted);
}

.category-card__more .icon {
	width: 0.9rem;
	height: 0.9rem;
}

.category-card:hover .category-card__more {
	color: var(--c-accent-strong);
}

@media (min-width: 768px) {
	.category-card {
		padding: 1.25rem 0.75rem;
	}

	.category-card__name {
		font-size: var(--fs-base);
	}

	.category-card__more {
		display: inline-flex;
	}
}

/* ==========================================================================
   Product sections — swipeable row on phones, grid from tablet up
   ========================================================================== */

.home-products ul.products {
	margin-block-end: 0;
}

@media (max-width: 767.98px) {
	.home-products ul.products {
		grid-auto-flow: column;
		grid-template-columns: none;
		grid-auto-columns: 64%;
		margin-inline: calc(-1 * var(--gutter));
		padding: 0 var(--gutter) 0.5rem;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--gutter);
		scrollbar-width: none;
	}

	.home-products ul.products::-webkit-scrollbar {
		display: none;
	}

	.home-products ul.products li.product {
		scroll-snap-align: start;
	}
}

/* ==========================================================================
   Product rows (collections) — one swipeable line with arrow buttons
   ========================================================================== */

.product-row {
	position: relative;
}

.home-products--row ul.products {
	grid-auto-flow: column;
	grid-template-columns: none;
	grid-auto-columns: 64%;
	padding-block: 0.25rem 0.75rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.home-products--row ul.products::-webkit-scrollbar {
	display: none;
}

.home-products--row ul.products > li {
	scroll-snap-align: start;
}

@media (min-width: 768px) {
	.home-products--row ul.products {
		grid-auto-columns: calc((100% - 2 * 1.25rem) / 3);
	}
}

@media (min-width: 1200px) {
	.home-products--row ul.products {
		grid-auto-columns: calc((100% - 3 * 1.25rem) / 4);
	}
}

.product-row__nav {
	position: absolute;
	inset-block-start: 40%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--c-border);
	border-radius: 50%;
	background: #fff;
	box-shadow: var(--shadow);
	color: var(--c-text);
	cursor: pointer;
}

.product-row__nav:hover {
	border-color: var(--c-accent);
	color: var(--c-accent-strong);
}

.product-row__nav--prev {
	inset-inline-start: -14px;
}

.product-row__nav--next {
	inset-inline-end: -14px;
}

.product-row__nav[hidden] {
	display: none;
}

@media (max-width: 767.98px) {
	.product-row__nav {
		display: none;
	}
}

/* ==========================================================================
   Brands
   ========================================================================== */

.brands-panel {
	padding: 1.75rem 1.25rem;
	border-radius: var(--radius-lg);
	background: var(--c-surface);
	text-align: center;
}

.brands-panel .section-title {
	margin-block-end: 1.5rem;
	font-size: var(--fs-lg);
}

.brand-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: center;
	gap: 1.25rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.brands-panel {
		padding: 2.25rem 2rem;
	}

	.brand-list {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 1.5rem 3.5rem;
	}
}

.brand-list__link {
	display: grid;
	place-items: center;
	min-height: 48px;
	text-decoration: none;
}

.brand-list__link img {
	width: auto;
	max-width: 130px;
	max-height: 40px;
	object-fit: contain;
	filter: grayscale(1);
	opacity: 0.75;
	mix-blend-mode: multiply;
	transition: filter 0.2s var(--ease), opacity 0.2s var(--ease);
}

.brand-list__link:hover img,
.brand-list__link:focus-visible img {
	filter: none;
	opacity: 1;
}

.brand-list__name {
	font-size: var(--fs-md);
	font-weight: 800;
	letter-spacing: 0.02em;
	color: var(--c-text-muted);
}

.brand-list__link:hover .brand-list__name {
	color: var(--c-text);
}

/* ==========================================================================
   Service / trust band
   ========================================================================== */

.home-trust {
	margin-block-start: var(--section-space);
	padding-block: 2.5rem;
	background: var(--c-surface);
}

.trust-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.75rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 992px) {
	.trust-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 2rem;
	}
}

.trust-item {
	text-align: center;
}

.trust-item__icon {
	display: inline-grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin-block-end: 0.75rem;
	border: 1px solid var(--c-border-strong);
	border-radius: 50%;
	background: #fff;
	color: var(--c-accent-strong);
}

.trust-item__icon .icon {
	width: 1.5rem;
	height: 1.5rem;
}

.trust-item__title {
	margin: 0 0 0.25rem;
	font-size: var(--fs-base);
}

.trust-item__text {
	max-width: 26ch;
	margin: 0 auto;
	font-size: var(--fs-sm);
	color: var(--c-text-muted);
	line-height: 1.8;
}

/* ==========================================================================
   Installment banner
   ========================================================================== */

/* Text only (no image): dark box. */
.cta-banner {
	position: relative;
	display: grid;
	overflow: hidden;
	border-radius: var(--radius-lg);
	background: #1f1e1c;
	color: #fff;
}

.cta-banner__content {
	padding: 2rem 1.5rem;
}

.cta-banner__icon {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-block-end: 1rem;
	border-radius: 50%;
	background: var(--c-accent-tint);
	color: var(--c-accent);
}

.cta-banner__title {
	margin: 0 0 0.5rem;
	font-size: var(--fs-xl);
	color: #fff;
}

.cta-banner__text {
	max-width: 48ch;
	margin: 0 0 1.5rem;
	color: rgba(255, 255, 255, 0.8);
	line-height: 2;
}

.cta-banner__content > :last-child {
	margin-block-end: 0;
}

@media (min-width: 992px) {
	.cta-banner__content {
		padding: 3rem 3.5rem;
	}
}

/* Hero style: photo fills the banner, copy on the inline-start side. */
.cta-banner__media img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.cta-banner--text-dark {
	background: var(--c-surface);
	color: var(--c-text);
}

.cta-banner--text-dark .cta-banner__title {
	color: var(--c-text);
}

.cta-banner--text-dark .cta-banner__text {
	color: var(--c-text-muted);
}

@media (min-width: 768px) {
	.cta-banner--overlay .cta-banner__media,
	.cta-banner--overlay .cta-banner__content {
		grid-area: 1 / 1;
	}

	.cta-banner--overlay .cta-banner__media {
		position: relative;
	}

	.cta-banner--overlay .cta-banner__media img {
		aspect-ratio: auto;
		height: clamp(280px, 30vw, 420px);
	}

	.cta-banner--overlay .cta-banner__media::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(to left, rgba(20, 19, 18, 0.94) 0%, rgba(20, 19, 18, 0.56) 35%, rgba(20, 19, 18, 0) 65%);
		opacity: var(--scrim, 0.8);
	}

	html:not([dir="rtl"]) .cta-banner--overlay .cta-banner__media::after {
		background: linear-gradient(to right, rgba(20, 19, 18, 0.94) 0%, rgba(20, 19, 18, 0.56) 35%, rgba(20, 19, 18, 0) 65%);
	}

	.cta-banner--text-dark .cta-banner__media::after {
		background: linear-gradient(to left, rgba(246, 245, 243, 1) 0%, rgba(246, 245, 243, 0.62) 35%, rgba(246, 245, 243, 0) 60%);
	}

	html:not([dir="rtl"]) .cta-banner--text-dark .cta-banner__media::after {
		background: linear-gradient(to right, rgba(246, 245, 243, 1) 0%, rgba(246, 245, 243, 0.62) 35%, rgba(246, 245, 243, 0) 60%);
	}

	.cta-banner--overlay .cta-banner__content {
		position: relative;
		z-index: 1;
		align-self: center;
		max-width: 560px;
	}
}

/* Shade strength behind banner/slide text (none | light | medium | strong). */
.overlay-none {
	--scrim: 0;
}

.overlay-light {
	--scrim: 0.45;
}

.overlay-strong {
	--scrim: 1;
}

/* Image only: a finished banner, never cropped. */
.cta-image {
	display: block;
	overflow: hidden;
	border-radius: var(--radius-lg);
}

.cta-image__img {
	width: 100%;
	height: auto;
	transition: transform 0.3s var(--ease);
}

a.cta-image:hover .cta-image__img {
	transform: scale(1.01);
}
