/*
 * MFD — Home page styles
 *
 * Covers: paged hero carousel, brand block, product sections.
 * Design tokens and base utilities come from design-system.css.
 * Responsive breakpoints: 960px (tablet) + 640px (phone).
 *
 * NO JavaScript is written here.
 * Interactions (slide transitions, dot state) are handled by main.js
 * and toggled via is-* state classes and CSS custom properties.
 */

/* ============================================================
 * 1. PAGED HERO CAROUSEL
 * ============================================================ */

/* Container -------------------------------------------------- */
.mfd-hero-carousel {
	position: relative;
	overflow: hidden;
	background: var(--mfd-ink);
	/* Reserve height while images load to prevent layout shift. */
	min-height: clamp(240px, 46vw, 600px);
}

/* Viewport: clips the moving track */
.mfd-hero-carousel__viewport {
	overflow: hidden;
	width: 100%;
}

/* Track: flex row — width = tiles * tile-width
 * The JS sets --mfd-page on [data-mfd-track] and the transform follows.
 * At rest (no JS), show the first page only. */
.mfd-hero-carousel__track {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	/* CSS-driven slide: JS writes style="--mfd-page:N" on the track. */
	transform: translateX(calc(var(--mfd-page, 0) * -100%));
	transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
	/* Pause animation when :hover is set on the section via JS class. */
	will-change: transform;
}

/* Tile ------------------------------------------------------- */
.mfd-hero-carousel__tile {
	/* Each tile is exactly 1/perPage of the track width.
	 * CSS custom property --mfd-per-page is set per breakpoint below
	 * and also used by JS to determine layout. */
	flex: 0 0 calc(100% / var(--mfd-per-page, 3));
	min-width: 0;
	position: relative;
	/* Hero agrandi un peu : +~80px en moyenne. */
	height: clamp(440px, 60vw, 600px);
	overflow: hidden;
	/* Tile separator: 2px white right border (last tile has none via CSS) */
	border-right: 2px solid var(--mfd-white);
}

.mfd-hero-carousel__tile:last-child {
	border-right: 0;
}

/* Image wrapper — fills the tile */
.mfd-hero-carousel__link {
	display: block;
	position: absolute;
	inset: 0;
}

.mfd-hero-carousel__image-wrap {
	width: 100%;
	height: 100%;
}

/* Sélectivité relevée (img. + .elementor) pour BATTRE la règle Elementor
   `.elementor img { height: auto }` quand la home rend son contenu Elementor
   — sinon l'image reprend sa hauteur naturelle et le recadrage voulu est perdu. */
.mfd-hero-carousel__image,
img.mfd-hero-carousel__image,
.elementor .mfd-hero-carousel__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 1.2s ease;
}

.mfd-hero-carousel__tile:hover .mfd-hero-carousel__image {
	transform: scale(1.04);
}

/* Gradient overlay — bottom-up dark vignette */
.mfd-hero-carousel__gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 30%, rgba(0, 0, 0, 0.55) 100%);
	pointer-events: none;
}

/* Content block — bottom-left, above gradient */
.mfd-hero-carousel__content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: clamp(16px, 3vw, 28px);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	/* Staggered fade-up on page-enter (driven by JS adding .is-entering) */
}

/* Anton overlay title */
.mfd-hero-carousel__title {
	/* Montserrat est plus large qu'Anton : taille réduite pour que le mot
	   le plus long (« PERSONNALISEZ ») tienne sur une ligne dans une diapo. */
	font-size: clamp(24px, 3vw, 44px);
	hyphens: none;
	overflow-wrap: normal;
	/* .mfd-overlay provides display font, uppercase, letter-spacing, text-shadow */
	animation: mfdFadeUp 0.7s ease both;
}

/* Lora italic sub-line */
.mfd-hero-carousel__sub {
	font-style: italic;
	font-size: clamp(14px, 1.8vw, 22px);
	color: var(--mfd-white);
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	animation: mfdFadeUp 0.8s 0.1s ease both;
}

/* CTA pill button */
.mfd-hero-carousel__cta {
	animation: mfdFadeUp 0.9s 0.2s ease both;
	/* Override default .mfd-btn margins */
	margin-top: 4px;
}

.mfd-hero-carousel__cta:hover {
	transform: scale(1.03);
}

/* Arrows ---------------------------------------------------- */
.mfd-hero-carousel__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: var(--mfd-ink);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: 0;
	transition: background var(--mfd-transition), opacity var(--mfd-transition);
}

.mfd-hero-carousel__arrow:hover {
	background: var(--mfd-white);
}

.mfd-hero-carousel__arrow--prev {
	left: 12px;
}

.mfd-hero-carousel__arrow--next {
	right: 12px;
}

/* Dots ------------------------------------------------------ */
.mfd-hero-carousel__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 14px 0;
	background: var(--mfd-white);
}

.mfd-hero-carousel__dot {
	width: 10px;
	height: 10px;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.18);
	border: 0;
	padding: 0;
	cursor: pointer;
	transition: width 0.3s ease, background 0.3s ease;
}

.mfd-hero-carousel__dot.is-active {
	width: 28px;
	background: var(--mfd-tan);
}

/* Per-page CSS custom property — drives tile flex-basis */
.mfd-hero-carousel {
	--mfd-per-page: 3; /* desktop default */
}

@media (max-width: 959px) {
	.mfd-hero-carousel {
		--mfd-per-page: 2;
	}
}

@media (max-width: 639px) {
	.mfd-hero-carousel {
		--mfd-per-page: 1;
	}

	/* On single-tile mobile, hide arrows — swipe handles navigation via JS */
	.mfd-hero-carousel__arrow {
		display: none;
	}

	.mfd-hero-carousel__tile {
		border-right: 0;
	}
}

/* Paused state is set by JS on mouseenter — no style reset needed. */

/* ============================================================
 * 2. KEYFRAME ANIMATIONS
 * (mfdFadeUp is used by hero carousel content)
 * ============================================================ */
@keyframes mfdFadeUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Respect reduced-motion: override is already in design-system.css */

/* ============================================================
 * 3. BRAND BLOCK
 * ============================================================ */
/* Section padding: clamp(40px,6vw,72px) 24px */
.mfd-brand-block.mfd-section {
	padding-block: clamp(40px, 6vw, 72px);
}

.mfd-brand-block__inner {
	display: grid;
	grid-template-columns: 0.85fr 1.5fr;
	gap: 32px;
	align-items: center;
}

/* Left: stacked logo */
.mfd-brand-block__logo {
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

/* Sélectivité relevée (.elementor) : sans elle, `.elementor img { max-width:
   100% }` bat notre max-width 360px quand la home rend son contenu Elementor
   et le logo grossit (~384px). */
.mfd-brand-block__logo-img,
.elementor .mfd-brand-block__logo-img {
	width: 85%;
	max-width: 360px;
	height: auto;
	object-fit: contain;
}

/* Right: badge + headline + diamond + tagline */
.mfd-brand-block__copy {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 20px;
}

.mfd-brand-block__badge {
	width: clamp(64px, 8vw, 96px);
	height: auto;
}

/* H1 headline — Montserrat 800, fluid size, "naturel certifié" in tan */
.mfd-brand-block__headline {
	font-family: var(--mfd-font-body);
	font-weight: 800;
	font-size: clamp(28px, 5.5vw, 56px);
	letter-spacing: -0.01em;
	line-height: 1.15;
	color: var(--mfd-ink);
	/* Le titre du bloc marque ne doit PAS être en majuscules
	   (annule le text-transform:uppercase groupé de design-system.css). */
	text-transform: none;
}

.mfd-brand-block__diamond {
	width: 80px;
	height: auto;
}

.mfd-brand-block__tagline {
	font-style: italic;
	font-size: clamp(14px, 1.4vw, 17px);
	line-height: 1.7;
	color: var(--mfd-ink);
}

/* Responsive */
@media (max-width: 960px) {
	.mfd-brand-block__inner {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.mfd-brand-block__logo {
		justify-content: center;
	}

	.mfd-brand-block__logo-img {
		width: 70%;
		max-width: 280px;
	}
}

@media (max-width: 640px) {
	.mfd-brand-block__inner {
		gap: 20px;
	}

	.mfd-brand-block__headline {
		font-size: clamp(24px, 6vw, 36px);
	}
}

/* ============================================================
 * 4. PRODUCT SECTIONS  (Best Sellers + par matières)
 * Aération : échelle visuelle réduite et plus de blanc —
 * titres de section contenus, cartes compactes, espacements élargis.
 * ============================================================ */
/* Respiration verticale accrue des deux sections d'accueil. */
.mfd-product-section.mfd-section {
	padding-block: clamp(48px, 7vw, 88px);
}

.mfd-product-section__eyebrow {
	margin-bottom: 8px;
}

/* Titres « Best Sellers » / « Bracelets par matières »
   réduits et uniformisés (même classe → même typo) pour aérer la home. */
.mfd-product-section__title {
	font-size: clamp(20px, 2.4vw, 26px);
	margin-bottom: clamp(24px, 3.2vw, 36px);
}

/* Product grid — reuses .mfd-grid-4 with framed cards via WooCommerce loop */
.mfd-product-section__grid.products {
	/* ul reset */
	list-style: none;
	margin: 0;
	padding: 0;
	/* BS airy: override default grid gap for more breathing room */
	gap: clamp(32px, 4vw, 40px);
}

/* WooCommerce product loop card overrides for the MFD style */
.mfd-product-section__grid .product {
	/* The WooCommerce <li class="product"> */
	display: flex;
	flex-direction: column;
}

/* Product image wrapper: square, framed, product-tile background */
.mfd-product-section__grid .product .woocommerce-loop-product__link,
.mfd-product-section__grid .product > a:first-child {
	display: block;
	position: relative;
}

.mfd-product-section__grid .product .attachment-woocommerce_thumbnail,
.mfd-product-section__grid .product img.wp-post-image {
	aspect-ratio: 1 / 1;
	width: 100%;
	height: auto;
	/* Carte compacte : borne la hauteur (utile en grille 1 colonne mobile). */
	max-height: 340px;
	object-fit: cover; /* L'image remplit le cadre (pas de bords blancs) */
	background: var(--mfd-product-tile);
	border: var(--mfd-frame); /* 1px solid tan — signature MFD frame */
	display: block;
	transition: transform 0.6s ease;
}

/* Hover: card lifts, image scales */
.mfd-product-section__grid .product:hover img {
	transform: scale(1.03);
}

.mfd-product-section__grid .product:hover {
	transform: translateY(-4px);
	transition: transform 0.3s ease;
}

/* Créa de référence : nom du produit en italique serif (Lora). */
.mfd-product-section__grid .product .woocommerce-loop-product__title,
.mfd-product-section__grid .product h2 {
	font-family: var(--mfd-font-serif);
	font-style: italic;
	font-size: 17px;
	font-weight: 600;
	text-align: center;
	margin-top: 14px;
	color: var(--mfd-ink);
}

/* Ligne descriptive courte sous le titre — gris doux, sans puces. */
.mfd-product-section__grid .product .woocommerce-product-details__short-description,
.mfd-product-section__grid .product .product-description,
.mfd-product-section__grid .mfd-product-card__desc {
	font-family: var(--mfd-font-body);
	font-size: 13px;
	line-height: 1.55;
	text-align: center;
	color: var(--mfd-muted);
	margin-top: 8px;
	/* Descriptions parfois longues (produits pro) : 2 lignes max. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Garde-fou : aucune puce de liste dans une description de carte
 * (content-product.php aplatit déjà le HTML — ceci protège tout chemin hérité). */
.mfd-product-section__grid .product .woocommerce-product-details__short-description ul,
.mfd-product-section__grid .product .product-description ul,
.mfd-product-section__grid .mfd-product-card__desc ul {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.mfd-product-section__grid .product .woocommerce-product-details__short-description li,
.mfd-product-section__grid .product .product-description li,
.mfd-product-section__grid .mfd-product-card__desc li {
	list-style: none;
	padding-left: 0;
}

.mfd-product-section__grid .mfd-product-card__desc p {
	margin: 0;
}

/* Créa de référence : prix gris doux en italique — « Dès 129,00€ ». */
.mfd-product-section__grid .product .price,
.mfd-product-section__grid .mfd-product-card__price,
.mfd-product-section__grid .mfd-product-card__price .price,
.mfd-product-section__grid .mfd-product-card__price .woocommerce-Price-amount {
	font-family: var(--mfd-font-body);
	font-weight: 500;
	font-size: 14px;
	font-style: italic;
	text-align: center;
	color: var(--mfd-muted);
}

.mfd-product-section__grid .mfd-product-card__price {
	margin-top: 10px;
}

/* Add-to-cart button — hidden on home product sections (no add-to-cart on home) */
.mfd-product-section__grid .product .add_to_cart_button,
.mfd-product-section__grid .product .button {
	display: none;
}

/* CTA button below the grid */
.mfd-product-section__cta-wrap {
	display: flex;
	justify-content: center;
	margin-top: clamp(24px, 4vw, 40px);
}

/* Empty / no-WooCommerce state */
.mfd-product-section__empty {
	padding: 48px 0;
	text-align: center;
	color: var(--mfd-muted);
}

/* ============================================================
 * 5. RESPONSIVE — product grid overrides for this page
 * (design-system.css already handles .mfd-grid-4 collapse;
 *  these rules target WooCommerce's own column class)
 * ============================================================ */
@media (max-width: 960px) {
	.mfd-product-section__grid.products {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.mfd-product-section__grid.products {
		grid-template-columns: repeat(2, 1fr);
		/* 2 colonnes étroites : resserrer l'écart horizontal, garder l'air vertical. */
		gap: 28px 16px;
	}

	.mfd-product-section__grid .product .woocommerce-loop-product__title,
	.mfd-product-section__grid .product h2 {
		font-size: 15px;
	}
}

/* Pas de règle 420px → 1 colonne (cassait Best-Sellers en pleine largeur
   ≤420px) : la grille reste 2-up via la règle ≤640px. */

/* ============================================================
 * 7. MATERIAL CARDS (Les bracelets par matières)
 * 4 category cards on one row — gold-framed image + Lora italic title.
 * ============================================================ */

/* Grid reset — override the default <ul> list styles */
.mfd-matieres-grid {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Défilement horizontal (carrousel) — 6 matières dont Argent & Silicone. */
.mfd-matieres-grid--scroll {
	display: flex;
	/* Aération : écart entre cartes élargi. */
	gap: clamp(28px, 3vw, 36px);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	/* Espace accru entre le bas des cartes et la scrollbar. */
	padding-bottom: 28px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

/* Individual card */
.mfd-matiere-card {
	display: flex;
	flex-direction: column;
}

.mfd-matieres-grid--scroll .mfd-matiere-card {
	flex: 0 0 clamp(200px, 24%, 260px);
	scroll-snap-align: start;
}

/* Full-block link */
.mfd-matiere-card__link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	transition: transform 0.3s ease;
}

.mfd-matiere-card__link:hover {
	transform: translateY(-4px);
}

/* Image wrapper — square, gold-framed, matches product tiles */
.mfd-matiere-card__image-wrap {
	overflow: hidden;
	line-height: 0; /* collapse inline gap */
}

/* Sélectivité relevée (.elementor) : sans elle, `.elementor img { border:
   none }` retire le cadre tan signature quand la home rend son contenu
   Elementor et l'image se redimensionne de 2px. */
.mfd-matiere-card__img,
.elementor .mfd-matiere-card__img {
	aspect-ratio: 1 / 1;
	width: 100%;
	height: auto;
	object-fit: cover; /* L'image remplit le cadre (pas de bords blancs) */
	background: var(--mfd-product-tile);
	border: var(--mfd-frame); /* 1px solid tan — signature MFD gold frame */
	display: block;
	transition: transform 0.6s ease;
}

.mfd-matiere-card__link:hover .mfd-matiere-card__img {
	transform: scale(1.03);
}

/* Placeholder when no image is set */
.mfd-matiere-card__img--placeholder {
	aspect-ratio: 1 / 1;
	width: 100%;
	background: var(--mfd-product-tile);
	border: var(--mfd-frame);
}

/* Titre + texte explicatif + prix sous chaque carte, en Montserrat. */
.mfd-matiere-card__body {
	text-align: center;
	padding: 18px 8px 0;
}

.mfd-matiere-card__title {
	font-family: var(--mfd-font-body); /* Montserrat */
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.01em;
	color: var(--mfd-ink);
	margin: 0 0 8px;
}

.mfd-matiere-card__desc {
	font-family: var(--mfd-font-body);
	font-size: 13px;
	line-height: 1.55;
	color: var(--mfd-muted);
	margin: 0 0 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Aligné sur les cartes produits : prix gris doux en italique. */
.mfd-matiere-card__price {
	font-family: var(--mfd-font-body);
	font-weight: 500;
	font-size: 14px;
	font-style: italic;
	color: var(--mfd-muted);
	margin: 0;
}

@media (max-width: 640px) {
	.mfd-matieres-grid--scroll .mfd-matiere-card {
		flex: 0 0 64%;
	}

	.mfd-matiere-card__title {
		font-size: 14px;
	}
}

/* ============================================================
 * 8. GAMME BLOCK — « Un concept unique et innovant »
 * Collage 4 photos portrait (2 colonnes, col. droite décalée vers
 * le bas) + 2 libellés Anton à gauche ; eyebrow doré + titre +
 * prix STATIQUE (aucune animation) + 3 paragraphes + CTA
 * pill noir à droite. Colonnes du collage en parallax opposé au
 * scroll (JS, desktop uniquement).
 * ============================================================ */
.mfd-gamme-block {
	background: var(--mfd-white);
}

.mfd-gamme-block__inner {
	display: grid;
	grid-template-columns: 45fr 55fr;
	gap: clamp(40px, 5vw, 80px);
	align-items: center;
}

/* — Collage gauche : 2 colonnes ~50/50, col. 2 décalée vers le bas — */
.mfd-gamme-block__collage {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(16px, 1.9vw, 28px);
	align-items: start;
}

.mfd-gamme-block__col--offset {
	padding-top: clamp(64px, 7.5vw, 116px);
}

/* Photos portrait 2:3 (600×900), coins droits */
.mfd-gamme-block__photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	background: var(--mfd-product-tile);
}

.mfd-gamme-block__photo + .mfd-gamme-block__photo {
	margin-top: clamp(16px, 1.9vw, 28px);
}

/* Libellés Anton entre les photos */
.mfd-gamme-block__label {
	font-family: var(--mfd-font-display);
	font-weight: 400;
	font-size: clamp(22px, 2.2vw, 30px);
	line-height: 1.2;
	letter-spacing: 0.01em;
	color: var(--mfd-ink);
	margin: clamp(16px, 1.9vw, 26px) 0;
}

/* Créa p.7 : « Adoptée par tous » (col. 2) se lit sur DEUX lignes
   (« Adoptée » / « par tous ») — largeur bridée en em pour suivre la
   taille de police à tous les points de rupture. « pour tous... »
   (col. 1) reste sur une ligne comme sur le live. */
.mfd-gamme-block__col--offset .mfd-gamme-block__label {
	max-width: 4em;
}

.mfd-gamme-block__label:last-child {
	margin-bottom: 0;
}

/* Parallax (module JS) : transform seul, composité sur le GPU */
@media (min-width: 1025px) {
	.mfd-gamme-block__col {
		will-change: transform;
	}
}

/* — Colonne texte — */
.mfd-gamme-block__copy {
	max-width: 560px;
	margin-inline: auto;
	text-align: center;
}

.mfd-gamme-block__eyebrow {
	letter-spacing: 0.3em;
	margin: 0 0 14px;
}

.mfd-gamme-block__eyebrow-mark {
	display: inline-block;
	margin-right: 6px;
	font-size: 14px;
	line-height: 1;
	vertical-align: -1px;
}

.mfd-gamme-block__title {
	font-family: var(--mfd-font-body); /* Montserrat */
	font-weight: 800;
	font-size: clamp(26px, 3vw, 38px);
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--mfd-ink);
	margin: 0 0 14px;
}

/* Ligne prix STATIQUE — DOCX : pas d'animation sur « à partir de ». */
.mfd-gamme-block__price {
	margin: 0 0 24px;
}

.mfd-gamme-block__price-prefix {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: var(--mfd-muted);
	margin-bottom: 2px;
}

.mfd-gamme-block__price-amount {
	display: block;
	font-family: var(--mfd-font-body);
	font-weight: 800;
	font-size: clamp(30px, 4vw, 44px);
	line-height: 1.1;
	color: var(--mfd-ink);
}

.mfd-gamme-block__text p {
	font-size: 14.5px;
	line-height: 1.7;
	color: #4A4747;
	text-align: justify;
	max-width: 58ch;
	margin: 0 auto 14px;
}

.mfd-gamme-block__text strong {
	font-weight: 700;
	color: var(--mfd-ink);
}

.mfd-gamme-block__cta {
	margin-top: 14px;
}

/* — Responsive : empilé, collage 2 colonnes serrées (latitude mobile) — */
@media (max-width: 960px) {
	.mfd-gamme-block__inner {
		grid-template-columns: 1fr;
		gap: 36px;
	}

	.mfd-gamme-block__collage {
		max-width: 520px;
		margin-inline: auto;
		gap: 16px;
	}

	.mfd-gamme-block__photo + .mfd-gamme-block__photo {
		margin-top: 16px;
	}

	.mfd-gamme-block__col--offset {
		padding-top: clamp(36px, 9vw, 56px);
	}
}

@media (max-width: 640px) {
	.mfd-gamme-block__label {
		font-size: 20px;
		margin: 12px 0;
	}

	.mfd-gamme-block__text p {
		font-size: 14px;
		text-align: left;
	}
}
