/* Modulo Blocks — Modales et pop-up (site). */
.mmd {
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	max-width: none;
	max-height: none;
	overflow: visible;
}
.mmd:not([open]) { display: none; }
.mmd::backdrop { background: rgba(15, 23, 42, .55); }
.mmd__inner {
	position: relative;
	box-sizing: border-box;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #1e1e1e);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
	overflow: auto;
	overscroll-behavior: contain;
}
.mmd__content > :first-child { margin-top: 0; }
.mmd__content > :last-child { margin-bottom: 0; }

/* Fenêtre centrée */
.mmd--center { margin: auto; width: min(var(--mmd-w, 560px), calc(100vw - 32px)); }
.mmd--center .mmd__inner {
	border-radius: 12px;
	padding: 40px 28px 28px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
}

/* Tiroir sur le côté droit, toute la hauteur */
.mmd--drawer {
	margin: 0 0 0 auto;
	inset: 0 0 0 auto;
	width: min(var(--mmd-w, 400px), 100vw);
	height: 100vh;
	height: 100dvh;
}
.mmd--drawer .mmd__inner { height: 100%; padding: 56px 24px 24px; }

.mmd__close {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.mmd__close:hover { background: rgba(0, 0, 0, .07); }
.mmd__close:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

/* Bandeau et bulle (pop-up discrètes) : pas de fond grisé, la page reste utilisable. */
.mmd--soft { position: fixed; z-index: 99990; margin: 0; }
.mmd--bar_top, .mmd--bar_bottom { inset: auto 0; width: 100%; }
.mmd--bar_top { top: 0; }
.mmd--bar_bottom { bottom: 0; }
.mmd--bar_top .mmd__inner, .mmd--bar_bottom .mmd__inner { padding: 14px 56px 14px 20px; max-height: 50vh; max-height: 50dvh; }
.mmd--bar_top .mmd__inner > .mmd__content, .mmd--bar_bottom .mmd__inner > .mmd__content { max-width: var(--wp--style--global--wide-size, 1200px); margin: 0 auto; }
.mmd--bubble_right, .mmd--bubble_left { inset: auto; bottom: 20px; width: min(var(--mmd-w, 360px), calc(100vw - 32px)); }
.mmd--bubble_right { right: 20px; }
.mmd--bubble_left { left: 20px; }
.mmd--bubble_right .mmd__inner, .mmd--bubble_left .mmd__inner { border-radius: 12px; padding: 36px 20px 20px; max-height: 70vh; max-height: 70dvh; }
@media (max-width: 781px) {
	.mmd--bubble_right, .mmd--bubble_left { bottom: 16px; }
	.mmd--bubble_right { right: 16px; }
	.mmd--bubble_left { left: 16px; }
}

html.mmd-lock { overflow: hidden; }

/* Bouton « Poser une question » des fiches produits */
.mmp { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.mmp .mmp__btn--outline { background: transparent; color: inherit; border: 2px solid currentColor; }
.mmp .mmp__link { text-decoration: underline; cursor: pointer; }

/* Animations : seulement si la personne n'a pas demandé de réduire les animations. */
@media (prefers-reduced-motion: no-preference) {
	.mmd--center[open] .mmd__inner { animation: mmd-in .2s ease-out; }
	.mmd--drawer[open] .mmd__inner { animation: mmd-slide .25s ease-out; }
	.mmd[open]::backdrop { animation: mmd-fade .2s ease-out; }
	.mmd--bar_top[open] .mmd__inner { animation: mmd-down .25s ease-out; }
	.mmd--bar_bottom[open] .mmd__inner, .mmd--bubble_right[open] .mmd__inner, .mmd--bubble_left[open] .mmd__inner { animation: mmd-up .25s ease-out; }
}
@keyframes mmd-down { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes mmd-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes mmd-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes mmd-slide { from { transform: translateX(100%); } to { transform: none; } }
@keyframes mmd-fade { from { opacity: 0; } to { opacity: 1; } }
