/* ==========================================================================
   Sections page d'accueil — Le Royaume de Brindille
   Port fidèle de src/routes/index.tsx (prototype d'origine)
   ========================================================================== */

/* ==========================================================================
   0. Apparition au scroll (.reveal), déclenchée par gsap_call.js
   ========================================================================== */

.reveal {
	opacity: 0;
	transform: translateY(40px);
	transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.reveal--visible {
	opacity: 1;
	transform: translateY(0);
}

/* ==========================================================================
   1. Bandeau "Univers" (cartes pilules)
   ========================================================================== */

.home-univers {
	position: relative;
	background: var(--forest);
	padding-block: 2.5rem;
}

.home-univers__row {
	display: flex;
	gap: 0.625rem;
	overflow-x: auto;
	max-width: 1280px;
	margin-inline: auto;
	padding-inline: 1.25rem;
	padding-bottom: 1rem;
	scroll-snap-type: x proximity;
	scroll-padding-inline: 1.25rem;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	/* Fine barre de défilement arrondie, crème sur fond forêt. */
	scrollbar-width: thin;
	scrollbar-color: var(--cream) rgba(255, 255, 255, 0.15);
}

.home-univers__row::-webkit-scrollbar {
	height: 4px;
}

.home-univers__row::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 999px;
	margin-inline: 1.25rem;
}

.home-univers__row::-webkit-scrollbar-thumb {
	background: var(--cream);
	border-radius: 999px;
}

.home-univers__tile {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 0.75rem;
	scroll-snap-align: start;
	border: 1px solid transparent;
	background: var(--card);
	border-radius: 999px;
	padding: 0.375rem 1.25rem 0.375rem 0.375rem;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	transition: border-color var(--transition-normal), transform var(--transition-fast);
}

.home-univers__tile:active {
	transform: scale(0.97);
}

.home-univers__tile:hover {
	border-color: var(--primary);
}

.home-univers__thumb {
	display: block;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 50%;
	width: 3rem;
	height: 3rem;
}

.home-univers__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.5);
	transition: transform var(--transition-slow);
}

.home-univers__tile:hover .home-univers__thumb img {
	transform: scale(1.65);
}

.home-univers__label {
	font-family: var(--font-display);
	font-size: 0.875rem;
	line-height: 1.2;
	color: var(--forest);
	white-space: nowrap;
}

.home-univers__wave {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 1;
	width: 100%;
	line-height: 0;
	transform: translateY(99%) scaleX(-1);
}

.home-univers__wave svg {
	display: block;
	height: 40px;
	width: 100%;
}

/* ==========================================================================
   2. Section "Valeurs"
   ========================================================================== */

.home-valeurs {
	position: relative;
	overflow: hidden;
	background: var(--forest);
	padding-block: 3rem 6rem;
}

.home-valeurs__grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	text-align: center;
}

.home-valeurs__item h3 {
	margin-top: 1rem;
	font-family: var(--font-display);
	font-size: 1.125rem;
	color: var(--cream);
}

.home-valeurs__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-inline: auto;
	width: 5rem;
	height: 5rem;
}

.home-valeurs__icon svg {
	width: 4rem;
	height: 4rem;
}

.home-valeurs__wave {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 0;
	width: 100%;
	line-height: 0;
	transform: translateY(1px) rotate(180deg);
}

.home-valeurs__wave svg {
	display: block;
	height: 40px;
	width: 100%;
}

/* ==========================================================================
   3. Section "Histoire" (fond forêt)
   ========================================================================== */

.home-histoire {
	position: relative;
	background: var(--forest);
}

.home-histoire__wave {
	position: absolute;
	left: 0;
	z-index: 1;
	width: 100%;
	line-height: 0;
}

.home-histoire__wave svg {
	display: block;
	height: 40px;
	width: 100%;
}

.home-histoire__wave--top {
	top: 0;
	transform: translateY(-90%);
}

.home-histoire__wave--bottom {
	bottom: 0;
	transform: translateY(90%);
}

.home-histoire__grid {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 3rem;
	align-items: center;
	padding-block: 4rem;
}

.home-histoire__media {
	position: relative;
}

.home-histoire__img {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 1.5rem;
	object-fit: cover;
	box-shadow: var(--shadow-lift);
}

.home-histoire__couronne {
	position: absolute;
	left: -1.5rem;
	top: -1.5rem;
	z-index: 2;
	width: 4.5rem;
	height: auto;
	transform: rotate(-12deg) scaleX(-1);
	pointer-events: none;
}

.home-histoire__badge {
	position: absolute;
	bottom: -1rem;
	right: -0.5rem;
	z-index: 2;
	display: none;
	align-items: center;
	gap: 0.5rem;
	background: var(--cream);
	color: var(--primary);
	border-radius: 1rem;
	padding: 1rem 1.5rem;
	font-family: var(--font-display);
	font-size: 1.25rem;
	box-shadow: var(--shadow-lift);
}

.home-histoire__badge svg {
	width: 1.75rem;
	height: 1.75rem;
	flex-shrink: 0;
}

.home-histoire__content .script {
	font-size: 1.5rem;
	color: var(--sunny);
}

.home-histoire__content h2 {
	margin-top: 0.5rem;
	font-size: 1.875rem;
	line-height: 1.2;
	color: var(--cream);
}

.home-histoire__content p:not(.script) {
	margin-top: 1.25rem;
	color: color-mix(in oklch, var(--cream) 80%, transparent);
	line-height: 1.6;
}

/* ==========================================================================
   4. Section "Produits"
   ========================================================================== */

.home-produits {
	background: var(--background);
	padding-block: 3.5rem;
}

.home-produits__head {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.home-produits__title-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.home-produits__title-wrap h2 {
	position: relative;
	z-index: 1;
	font-size: 1.5rem;
	color: var(--forest);
}

.home-produits__couronne {
	position: absolute;
	right: -1rem;
	top: -1.5rem;
	z-index: 0;
	width: 4rem;
	height: auto;
	transform: rotate(12deg);
	pointer-events: none;
}

.home-produits__filters {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
	overscroll-behavior-x: contain;
	padding-bottom: 0.875rem;
	/* Fine barre de défilement arrondie aux couleurs du thème. */
	scrollbar-width: thin;
	scrollbar-color: var(--forest) color-mix(in srgb, var(--forest) 12%, transparent);
}

.home-produits__filters::-webkit-scrollbar {
	height: 4px;
}

.home-produits__filters::-webkit-scrollbar-track {
	background: color-mix(in srgb, var(--forest) 12%, transparent);
	border-radius: 999px;
}

.home-produits__filters::-webkit-scrollbar-thumb {
	background: var(--forest);
	border-radius: 999px;
}

.home-produits__filters button {
	flex-shrink: 0;
	scroll-snap-align: start;
	white-space: nowrap;
	border: 1px solid transparent;
	background: color-mix(in srgb, var(--forest) 8%, transparent);
	color: var(--forest);
	border-radius: 999px;
	padding: 0.5rem 1rem;
	font-family: var(--font-body);
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.home-produits__filters button:hover {
	border-color: var(--forest);
}

.home-produits__filters button.is-active {
	background: var(--forest);
	border-color: var(--forest);
	color: var(--cream);
}

.home-produits__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

.home-produits__cta {
	margin-top: 3rem;
	text-align: center;
}

.home-produits__cta .btn--primary {
	background: var(--primary);
	color: var(--primary-foreground);
}

.home-produits__cta .btn--primary:hover {
	background: var(--forest);
}

.home-produits__cta .btn--primary svg {
	transition: transform var(--transition-fast);
}

.home-produits__cta .btn--primary:hover svg {
	transform: translateX(3px);
}

/* ==========================================================================
   5. Composant partagé ".product-card" (produits + meilleures ventes)
   ========================================================================== */

.product-card {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
}

.product-card__media {
	position: relative;
	overflow: hidden;
	border-radius: 1rem;
	aspect-ratio: 1 / 1;
	background: var(--card);
	box-shadow: var(--shadow-soft);
}

.product-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.7s, transform 0.7s;
}

.product-card:hover .product-card__img:not(.has-hover) {
	transform: scale(1.05);
}

.product-card__img--hover {
	opacity: 0;
}

.product-card:hover .product-card__img.has-hover {
	opacity: 0;
}

.product-card:hover .product-card__img--hover {
	opacity: 1;
}

.product-card__info {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.product-card__info h3 {
	font-family: var(--font-display);
	font-size: 1.125rem;
	line-height: 1.3;
	color: var(--foreground);
}

.product-card__price {
	flex-shrink: 0;
	font-family: var(--font-display);
	font-size: 1.125rem;
	color: var(--foreground);
}

.product-card__couronne {
	position: absolute;
	right: -0.75rem;
	top: -2rem;
	z-index: 0;
	width: 3.5rem;
	height: auto;
	pointer-events: none;
	transform: rotate(12deg);
}

/* ==========================================================================
   6. Section "Trouver le cadeau idéal"
   ========================================================================== */

.home-cadeau {
	position: relative;
	overflow: hidden;
	background: var(--forest);
	padding-block: 3.5rem;
}

.home-cadeau__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.home-cadeau__overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(
		to right,
		color-mix(in oklch, var(--forest) 70%, transparent),
		color-mix(in oklch, var(--forest) 40%, transparent) 55%,
		color-mix(in oklch, var(--forest) 10%, transparent)
	);
}

.home-cadeau__inner {
	position: relative;
	z-index: 1;
}

.home-cadeau__form-wrap {
	width: 100%;
	max-width: 100%;
	margin-right: auto;
}

.home-cadeau__form {
	display: flex;
	flex-direction: column;
	gap: 1.125rem;
	background: var(--card);
	border-radius: 1.5rem;
	padding: 1.5rem;
	box-shadow: var(--shadow-lift);
}

.home-cadeau__form h2 {
	font-size: 1.625rem;
	color: var(--forest);
	text-align: center;
	margin-bottom: 0.25rem;
}

.home-cadeau__form label {
	font-family: var(--font-display);
	font-size: 1rem;
	color: var(--foreground);
}

.home-cadeau__form select {
	margin-top: 0.375rem;
	width: 100%;
	border: 1px solid var(--input);
	border-radius: 999px;
	background: var(--background);
	color: var(--foreground);
	padding: 0.75rem 1.25rem;
	font-family: var(--font-body);
	font-size: 0.875rem;
}

.home-cadeau__form select:focus {
	outline: none;
	border-color: var(--primary);
}

.home-cadeau__form button[type="submit"] {
	margin-top: 0.25rem;
	border: none;
	border-radius: 999px;
	background: var(--primary);
	color: var(--primary-foreground);
	padding: 0.875rem 1.75rem;
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	cursor: pointer;
	transition: background-color var(--transition-normal);
}

.home-cadeau__form button[type="submit"]:hover {
	background: var(--forest);
}

/* ==========================================================================
   7. Section "Meilleures ventes"
   ========================================================================== */

.home-ventes {
	background: var(--background);
	padding-block: 3.5rem;
}

.home-ventes h2 {
	text-align: center;
	font-size: 1.5rem;
	color: var(--forest);
	margin-bottom: 2rem;
}

.home-ventes__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

.home-ventes .product-card__info h3,
.home-ventes .product-card__price {
	color: var(--forest);
}
