/* ==========================================================================
   Carrousel Produits de la Marque — CSS autonome, entièrement préfixé
   (aucune règle globale : n'impacte ni Woodmart ni WooCommerce)
   ========================================================================== */

.mcarousel {
	--mcar-gap: 12px;
	--mcar-accent: #83b735;          /* surchargé par les réglages du plugin */
	--mcar-radius: 10px;
	--mcar-border: #e8e8e8;
	--mcar-text: #1b1b1b;
	--mcar-cols-mobile: 2;
	--mcar-cols-tablet: 3;
	--mcar-cols-desktop: 4;

	position: relative;
	margin: 30px 0;
	clear: both;
}

/* ---------- En-tête ---------- */

.mcarousel .mcarousel__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}

.mcarousel .mcarousel__title {
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--mcar-text);
	text-align: left;
}

.mcarousel .mcarousel__view-all {
	flex-shrink: 0;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--mcar-accent);
	text-decoration: none;
	box-shadow: none;
}

.mcarousel .mcarousel__view-all::after {
	content: " →";
}

.mcarousel .mcarousel__view-all:hover {
	text-decoration: underline;
}

/* ---------- Viewport + piste ---------- */

.mcarousel .mcarousel__viewport {
	position: relative;
}

.mcarousel .mcarousel__track {
	display: flex;
	gap: var(--mcar-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;           /* Firefox */
	padding: 2px;
	margin: 0;
	list-style: none;
}

.mcarousel .mcarousel__track::-webkit-scrollbar {
	display: none;                   /* Chrome / Safari */
}

/* ---------- Cartes ---------- */

.mcarousel .mcarousel__card {
	/* Nombre de colonnes piloté par les réglages (variables injectées en inline) */
	flex: 0 0 calc((100% - (var(--mcar-cols-mobile) - 1) * var(--mcar-gap)) / var(--mcar-cols-mobile));
	scroll-snap-align: start;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid var(--mcar-border);
	border-radius: var(--mcar-radius);
	padding: 10px;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease;
	min-width: 0;
}

.mcarousel .mcarousel__card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
	.mcarousel .mcarousel__card {
		flex-basis: calc((100% - (var(--mcar-cols-tablet) - 1) * var(--mcar-gap)) / var(--mcar-cols-tablet));
	}
}

@media (min-width: 1025px) {
	.mcarousel .mcarousel__card {
		flex-basis: calc((100% - (var(--mcar-cols-desktop) - 1) * var(--mcar-gap)) / var(--mcar-cols-desktop));
	}
}

.mcarousel .mcarousel__media {
	display: block;
	border-radius: calc(var(--mcar-radius) - 4px);
	overflow: hidden;
	background: #f6f6f6;
	margin: 0 0 10px;
}

.mcarousel .mcarousel__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin: 0;
	border: 0;
	box-shadow: none;
	transition: transform 0.3s ease;
}

.mcarousel .mcarousel__card:hover .mcarousel__media img {
	transform: scale(1.04);
}

.mcarousel .mcarousel__name {
	margin: 0 0 6px;
	padding: 0;
	font-size: 14px;
	line-height: 1.35;
	font-weight: 500;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}

.mcarousel .mcarousel__name a {
	color: var(--mcar-text);
	text-decoration: none;
	box-shadow: none;
}

.mcarousel .mcarousel__name a:hover {
	color: var(--mcar-accent);
}

.mcarousel .mcarousel__price {
	font-size: 15px;
	font-weight: 700;
	color: var(--mcar-text);
	margin: 0 0 10px;
}

.mcarousel .mcarousel__price del {
	font-weight: 400;
	opacity: 0.55;
	margin-right: 6px;
}

.mcarousel .mcarousel__price ins {
	text-decoration: none;
}

.mcarousel .mcarousel__cta {
	display: block;
	text-align: center;
	margin-top: auto;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background: var(--mcar-accent);
	border-radius: 6px;
	text-decoration: none;
	box-shadow: none;
	transition: filter 0.15s ease;
}

.mcarousel .mcarousel__cta:hover {
	color: #fff;
	filter: brightness(0.92);
}

/* État « ajouté » : le script natif WC ajoute .added au bouton et .loading pendant la requête */
.mcarousel .mcarousel__cta.loading {
	opacity: 0.6;
	pointer-events: none;
}

.mcarousel .mcarousel__cta.added {
	background: #2e7d32;
}

.mcarousel .mcarousel__cta.added::after {
	content: " ✓";
}

/* Lien « Voir le panier » inséré par WooCommerce juste après le bouton */
.mcarousel .added_to_cart {
	display: block;
	margin-top: 8px;
	text-align: center;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--mcar-accent);
	text-decoration: none;
	box-shadow: none;
}

.mcarousel .added_to_cart:hover {
	text-decoration: underline;
}

/* ---------- Flèches (toujours visibles, y compris sur mobile) ---------- */

.mcarousel .mcarousel__arrow {
	position: absolute;
	top: 38%;                        /* centrée sur la zone image */
	transform: translateY(-50%);
	z-index: 5;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.08);
	background: #fff;
	color: var(--mcar-text);
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease, transform 0.2s ease;
	line-height: 1;
	font: inherit;
	min-width: 0;
	min-height: 0;
}

.mcarousel .mcarousel__arrow:hover {
	transform: translateY(-50%) scale(1.08);
}

.mcarousel .mcarousel__arrow svg {
	display: block;
}

.mcarousel .mcarousel__arrow--prev { left: 8px; }
.mcarousel .mcarousel__arrow--next { right: 8px; }

.mcarousel .mcarousel__arrow[disabled] {
	opacity: 0.3;
	cursor: default;
}

.mcarousel .mcarousel__arrow[disabled]:hover {
	transform: translateY(-50%);
}

/* ---------- Pastilles ---------- */

.mcarousel .mcarousel__dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding: 0;
	list-style: none;
}

.mcarousel .mcarousel__dots[hidden] {
	display: none;
}

.mcarousel .mcarousel__dot {
	width: 8px;
	height: 8px;
	min-width: 0;
	min-height: 0;                   /* annule le min-height global de Woodmart */
	max-width: none;
	max-height: none;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #cfcfcf;
	cursor: pointer;
	transition: width 0.2s ease, background 0.2s ease;
	font: inherit;
	line-height: 1;
}

.mcarousel .mcarousel__dot.is-active {
	width: 20px;
	height: 8px;
	border-radius: 4px;
	background: var(--mcar-accent);
}

/* ---------- Mode sombre éventuel du thème ---------- */

.mcarousel .mcarousel__card,
.mcarousel .mcarousel__title,
.mcarousel .mcarousel__name a,
.mcarousel .mcarousel__price {
	/* Les couleurs sont volontairement définies dans le scope ci-dessus
	   afin que les styles globaux de Woodmart ne les écrasent pas. */
}
