/**
 * Home « Nouveautés & Tendances » — port DEV26.
 */

/* Trending accessories rail */
.rideon-trending-section {
	/* Aligné style.css DEV : --h2-size section marketing */
	--h2-size: clamp(1.8rem, 5vw, 3.5rem);
	--trending-gap: 18px;
	--trending-pad-start: 72px;
	--trending-full: 4; /* cards entièrement visibles */
	--trending-peek: 0.28; /* amorce du suivant */
	--trending-visible: 4.28; /* full + peek */
	--trending-img-ratio: 1.65; /* paysage (images produits horizontales) */
	width: 100%;
	background: var(--surface-mute, #dedede);
	/* Pas de padding-right : le rail de cards doit aller jusqu’au bord droit */
	padding: 42px 0 48px 40px;
	min-height: 0;
	display: flex;
	align-items: flex-start;
	gap: 28px;
	overflow: hidden;
	box-sizing: border-box;
}

.rideon-trending-sidebar {
	flex: 0 0 200px;
	max-width: 200px;
	padding-top: 16px;
	box-sizing: border-box;
}

/*
 * Titre = h2 marketing DEV (style.css h1–h3 + --h2-size).
 * Sur BF le h2 legacy (Poppins ~25px) fuit : on force le calque 2026 ici.
 */
.rideon-trending-title {
	margin: 0;
	padding: 0;
	color: #000;
	font-family: var(--font-headline, "mono45-headline", Impact, sans-serif);
	font-size: var(--h2-size);
	font-weight: 700;
	/* legacy style.css : h1–h6 { line-height: inherit !important } */
	line-height: 0.95 !important;
	letter-spacing: -0.02em;
	word-spacing: var(--headline-word-spacing, 0);
	text-transform: uppercase;
}

.rideon-trending-title-desktop {
	display: block;
}

.rideon-trending-title-mobile {
	display: none;
}

.rideon-trending-sidebar .btn-pill-inverse {
	margin-top: 18px;
}

.rideon-trending-carousel-wrap {
	flex: 1;
	min-width: 0;
	position: relative;
	/* visible : l’ombre des flèches ne doit pas être rognée */
	overflow: visible;
	container-type: inline-size;
	container-name: trending-rail;
}

.rideon-trending-carousel {
	display: flex;
	gap: var(--trending-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	/*
	 * Gutter hors zone de scroll (margin, pas padding) :
	 * les cards ne dépassent plus derrière la flèche prev au scroll.
	 */
	margin-left: var(--trending-pad-start);
	width: calc(100% - var(--trending-pad-start));
	padding: 0;
	box-sizing: border-box;
	scroll-snap-type: x mandatory;
	scroll-padding-left: 0;
}

.rideon-trending-carousel::-webkit-scrollbar {
	display: none;
}

/*
 * Spacer de fin : butée = bord gauche d’une card entière
 * (compense l’amorce --trending-peek pour ne pas cropper à gauche).
 */
.rideon-trending-carousel::after {
	content: "";
	flex: 0 0 calc(
		(
			var(--trending-peek)
			* ((100% - (var(--trending-gap) * 4)) / var(--trending-visible))
		)
		+ (var(--trending-gap) * (5 - var(--trending-full)))
	);
	width: calc(
		(
			var(--trending-peek)
			* ((100% - (var(--trending-gap) * 4)) / var(--trending-visible))
		)
		+ (var(--trending-gap) * (5 - var(--trending-full)))
	);
	pointer-events: none;
}

.rideon-trending-card {
	/* Largeur rail visible : N cards + amorce */
	flex: 0 0 calc((100% - (var(--trending-gap) * 4)) / var(--trending-visible));
	width: calc((100% - (var(--trending-gap) * 4)) / var(--trending-visible));
	color: #000;
	text-decoration: none;
	text-align: center;
	scroll-snap-align: start;
	scroll-snap-stop: normal;
}

.rideon-trending-image-panel {
	position: relative;
	width: 100%;
	height: auto;
	aspect-ratio: var(--trending-img-ratio);
	border-radius: 16px;
	background: var(--surface-light, #f5f5f5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-sizing: border-box;
	overflow: hidden;
}

.rideon-trending-image-panel img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.rideon-trending-image-panel .rideon-new-badge {
	position: absolute;
	top: 0.65rem;
	left: 0.65rem;
	z-index: 2;
	width: auto;
	height: auto;
	max-width: 88px;
	max-height: 28px;
	object-fit: contain;
}

.rideon-trending-product-title {
	margin: 20px 0 0;
	font-family: var(--font-main);
	font-size: 20px;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	color: #000;
}

.rideon-trending-price {
	margin-top: 6px;
	font-family: var(--font-main);
	font-size: 20px;
	line-height: 1.2;
	font-weight: 400;
	color: #000;
}

.rideon-trending-price del,
.rideon-trending-price ins {
	text-decoration-thickness: 1px;
}

.rideon-trending-arrow {
	position: absolute;
	/*
	 * Centré verticalement sur le panneau image.
	 * 100cqw = largeur du wrap (pas la hauteur : un % dans top serait faux).
	 */
	top: calc(
		(
			(100cqw - var(--trending-pad-start) - (var(--trending-gap) * 4))
			/ var(--trending-visible)
		) / var(--trending-img-ratio) / 2
	);
	transform: translateY(-50%);
	width: 60px;
	height: 60px;
	border-radius: var(--pill-radius, 100px);
	background: #fff;
	border: 0;
	box-shadow:
		0 18px 35px rgba(0, 0, 0, 0.16),
		0 4px 12px rgba(0, 0, 0, 0.08);
	z-index: 20;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		transform 0.25s ease,
		box-shadow 0.25s ease,
		opacity 0.25s ease;
}

.rideon-trending-arrow-next {
	right: 28px;
}

.rideon-trending-arrow-prev {
	/* Centré dans le gutter gauche (hors rail scrollable) */
	left: calc(var(--trending-pad-start) / 2);
	transform: translate(-50%, -50%);
}

.rideon-trending-arrow::before {
	content: "";
	width: 11px;
	height: 11px;
	border-top: 3px solid #8a8a8a;
	border-right: 3px solid #8a8a8a;
}

.rideon-trending-arrow-next::before {
	transform: rotate(45deg);
	margin-left: -3px;
}

.rideon-trending-arrow-prev::before {
	transform: rotate(-135deg);
	margin-right: -3px;
}

.rideon-trending-arrow[hidden] {
	display: none !important;
}

.rideon-trending-arrow:hover {
	box-shadow:
		0 22px 42px rgba(0, 0, 0, 0.18),
		0 6px 16px rgba(0, 0, 0, 0.1);
}

.rideon-trending-arrow-next:hover {
	transform: translateY(-50%) scale(1.04);
}

.rideon-trending-arrow-prev:hover {
	transform: translate(-50%, -50%) scale(1.04);
}

.rideon-trending-arrow-next:active {
	transform: translateY(-50%) scale(0.98);
}

.rideon-trending-arrow-prev:active {
	transform: translate(-50%, -50%) scale(0.98);
}

.rideon-trending-arrow:focus-visible {
	outline: 3px solid rgba(0, 0, 0, 0.18);
	outline-offset: 4px;
}

.rideon-trending-button-mobile {
	display: none;
}

@media (min-width: 769px) and (max-width: 1180px) {
	.rideon-trending-section {
		--trending-full: 3;
		--trending-peek: 0.2;
		--trending-visible: 3.2;
		--trending-pad-start: 64px;
		--trending-gap: 16px;
		padding: 40px 0 44px 28px;
		gap: 24px;
	}

	.rideon-trending-sidebar {
		flex: 0 0 180px;
		max-width: 180px;
	}

	.rideon-trending-arrow {
		width: 56px;
		height: 56px;
	}
}

@media (max-width: 768px) {
	.rideon-trending-section {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 52px 0 42px;
		min-height: auto;
		overflow: hidden;
		background: var(--surface-mute, #dedede);
	}

	.rideon-trending-sidebar {
		width: 100%;
		max-width: none;
		flex: none;
		padding: 0 18px;
		text-align: center;
		box-sizing: border-box;
	}

	.rideon-trending-title-desktop {
		display: none;
	}

	.rideon-trending-title-mobile {
		display: block;
		text-align: center;
	}

	.rideon-trending-button-desktop {
		display: none;
	}

	.rideon-trending-carousel-wrap {
		width: 100%;
		margin-top: 52px;
		overflow: visible;
		position: relative;
	}

	.rideon-trending-carousel {
		display: flex;
		gap: 28px;
		margin-left: 0;
		width: 100%;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 12vw;
		padding: 0 12vw;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	/* Mobile : padding latéral suffit, pas de spacer desktop. */
	.rideon-trending-carousel::after {
		content: none;
		flex: 0;
		width: 0;
	}

	.rideon-trending-carousel::-webkit-scrollbar {
		display: none;
	}

	.rideon-trending-card {
		flex: 0 0 78vw;
		width: 78vw;
		max-width: 360px;
		scroll-snap-align: center;
		text-align: center;
	}

	.rideon-trending-image-panel {
		height: auto;
		min-height: 0;
		max-height: none;
		aspect-ratio: 16 / 10;
		border-radius: 24px;
		padding: 0;
	}

	.rideon-trending-image-panel img {
		max-width: 100%;
		max-height: 100%;
		object-fit: cover;
		object-position: center;
	}

	.rideon-trending-product-title {
		margin-top: 14px;
		font-size: clamp(15px, 3.9vw, 18px);
		line-height: 1.2;
		font-weight: 700;
		letter-spacing: normal;
		word-spacing: normal;
		text-transform: none;
	}

	.rideon-trending-price {
		margin-top: 4px;
		font-size: clamp(14px, 3.8vw, 17px);
		line-height: 1.2;
		font-weight: 400;
	}

	.rideon-trending-arrow {
		display: none;
	}

	.rideon-trending-button-mobile {
		display: inline-flex;
		align-self: center;
		margin: 38px auto 0;
		width: min(320px, calc(100vw - 64px));
		max-width: 320px;
	}
}

@media (max-width: 390px) {
	.rideon-trending-card {
		flex-basis: 80vw;
		width: 80vw;
	}

	.rideon-trending-image-panel {
		aspect-ratio: 16 / 10;
	}
}