/* Mauboussin finder — "Trouver votre pièce". See finder.php. */

.mbf {
	--mbf-display: "Baskervville", Georgia, "Times New Roman", serif;
	--mbf-body: "Century Gothic", Futura, "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mbf-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--iw: clamp(150px, min(32vh, 56vw), 320px); /* side of one piece */
	--R: calc(var(--iw) * 2.05);                /* radius of the showcase */

	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: clamp(660px, 100vh, 920px);
	overflow: hidden;
	background: #fff;
	color: #333;
	font-family: var(--mbf-body);
	font-size: 14px;
	line-height: 20px;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
@supports (height: 100svh) {
	.mbf { height: clamp(660px, 100svh, 920px); }
}
/* On its own page the header and the page's top margin take the first 210px. */
.mbf--page { height: clamp(600px, calc(100vh - 215px), 860px); }
@supports (height: 100svh) {
	.mbf--page { height: clamp(600px, calc(100svh - 215px), 860px); }
}
/* Where the browser allows it, a piece is sized on the stage itself. */
@supports (width: 1cqh) {
	.mbf-stage { container-type: size; }
	.mbf { --iw: clamp(150px, min(58cqh, 56cqw), 380px); }
}

.mbf *, .mbf *::before, .mbf *::after { box-sizing: border-box; }
.mbf [hidden] { display: none !important; }

/* The theme styles every button, heading and paragraph: start from nothing. */
.mbf.mbf button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.mbf.mbf button:focus-visible, .mbf.mbf a:focus-visible { outline: 1px solid #000; outline-offset: 3px; }
.mbf.mbf h2, .mbf.mbf h3, .mbf.mbf p {
	margin: 0;
	padding: 0;
	font-family: var(--mbf-display);
	font-weight: 400;
	font-style: normal;
	text-transform: none;
	color: #000;
}

/* --- Stage --- */
.mbf-stage {
	position: relative;
	flex: 1 1 0;
	min-height: 240px;
	overflow: hidden;
	background: #fff;
	perspective: 1400px;
	perspective-origin: 50% 36%;
	touch-action: pan-y;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}
.mbf-stage:active { cursor: grabbing; }
.mbf-3d { position: absolute; inset: 0; transform-style: preserve-3d; }
.mbf-3d[data-mbf-cam] { transition: transform 1200ms var(--mbf-ease); }
.mbf-3d[data-mbf-tilt] { transition: transform 500ms cubic-bezier(0.2, 0, 0, 1); }
.mbf-ring {
	position: absolute;
	left: 50%;
	top: 46%;
	width: 0;
	height: 0;
	transform-style: preserve-3d;
	transform: translateZ(calc(var(--R) * -1));
}

.mbf.mbf button.mbf-item {
	position: absolute;
	left: calc(var(--iw) / -2);
	top: calc(var(--iw) / -2);
	width: var(--iw);
	height: var(--iw);
	background: #fff;
	cursor: pointer;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	transition: opacity 600ms var(--mbf-ease);
	animation: mbf-in 500ms var(--mbf-ease);
}
.mbf-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
	-webkit-user-drag: none;
}
@keyframes mbf-in { from { opacity: 0; } }

.mbf.mbf button.mbf-nav {
	position: absolute;
	top: 46%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: #000;
	transform: translateY(-50%);
	transition: opacity 160ms var(--mbf-ease);
}
.mbf-prev { left: clamp(4px, 2vw, 32px); }
.mbf-next { right: clamp(4px, 2vw, 32px); }
.mbf.mbf button.mbf-nav:hover { opacity: 0.6; }
.mbf.mbf button.mbf-nav:disabled { opacity: 0.2; cursor: default; }

.mbf-caption {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
	pointer-events: none;
}
.mbf-cap-name { font-family: var(--mbf-display); font-size: clamp(17px, 2vw, 22px); line-height: 1.2; color: #000; text-wrap: balance; }
.mbf-cap-price { font-size: 13px; line-height: 18px; letter-spacing: 0.7px; color: #555; }

/* --- Console --- */
.mbf-console {
	flex: 0 0 auto;
	min-height: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px clamp(12px, 3vw, 40px);
	background: #faf6f2;
	border-top: 1px solid #e8e8e8;
}
.mbf-pane { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mbf-intro { width: min(680px, 100%); gap: 16px; }
.mbf-find { width: min(1200px, 100%); gap: 14px; }
.mbf-result { width: min(680px, 100%); gap: 12px; }

.mbf-eyebrow { font-size: 12px; line-height: 1.4; letter-spacing: 1px; text-transform: uppercase; color: #555; }
.mbf.mbf h2.mbf-title { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.08; letter-spacing: 0; text-wrap: balance; }
.mbf.mbf p.mbf-lead { max-width: 470px; font-family: var(--mbf-body); font-size: 14px; line-height: 22px; color: #555; text-wrap: pretty; }
.mbf.mbf h3.mbf-question { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.15; letter-spacing: 0.5px; }
.mbf.mbf h3.mbf-name { font-size: clamp(24px, 3.4vw, 35px); line-height: 1.1; letter-spacing: 0.5px; text-wrap: balance; }
.mbf-price { font-size: 14px; line-height: 20px; letter-spacing: 0.7px; color: #000; }

.mbf.mbf button.mbf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 30px;
	background: #000;
	border: 1px solid #000;
	color: #fff;
	font-family: var(--mbf-body);
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	transition: background 160ms var(--mbf-ease);
}
.mbf.mbf button.mbf-btn:hover { background: #333; }
.mbf.mbf button.mbf-btn--sm { padding: 10px 20px; }

.mbf.mbf .mbf-cta {
	display: inline-block;
	padding: 0 0 4px;
	border-bottom: 0.7px solid #000;
	color: #000;
	font-family: var(--mbf-body);
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	text-decoration: none;
	transition: opacity 160ms var(--mbf-ease);
}
.mbf.mbf .mbf-cta--plain { border-bottom-color: transparent; }
.mbf.mbf .mbf-cta:hover { opacity: 0.6; }
.mbf-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 32px; margin-top: 12px; }

/* --- Answers --- */
.mbf-q { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; }
.mbf-tray {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 4px;
	max-width: 100%;
	padding: 8px;
	background: #fff;
	border: 1px solid #e8e8e8;
}
.mbf.mbf button.mbf-opt {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 56px;
	padding: 4px 14px;
	background: #fff;
	border: 1px solid transparent;
	color: #000;
	font-family: var(--mbf-display);
	font-size: 18px;
	line-height: 1.2;
	white-space: nowrap;
	transition: border-color 160ms var(--mbf-ease), opacity 160ms var(--mbf-ease);
}
.mbf-opt img { display: block; width: 44px; height: 44px; margin-left: -10px; object-fit: contain; }
.mbf.mbf button.mbf-opt:hover { opacity: 0.6; }
.mbf.mbf button.mbf-opt[aria-pressed="true"] { border-color: #000; opacity: 1; }
.mbf.mbf button.mbf-clear {
	flex: 0 0 auto;
	align-self: center;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: #000;
	transition: opacity 160ms var(--mbf-ease);
}
.mbf.mbf button.mbf-clear:hover { opacity: 0.6; }

/* --- The five questions --- */
.mbf-dock { width: min(760px, 100%); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mbf.mbf button.mbf-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
	min-height: 54px;
	padding: 10px 4px 6px;
	border-top: 1px solid #d8d2cc;
	transition: opacity 160ms var(--mbf-ease), border-color 280ms var(--mbf-ease);
}
.mbf.mbf button.mbf-tab:hover { opacity: 0.6; }
.mbf.mbf button.mbf-tab[aria-current="true"] { border-top-color: #000; opacity: 1; }
.mbf-tab-l, .mbf-tab-v { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbf-tab-l { font-family: var(--mbf-body); font-size: 11px; line-height: 16px; letter-spacing: 0.7px; text-transform: uppercase; color: #555; }
.mbf-tab-v { font-family: var(--mbf-display); font-size: 15px; line-height: 20px; color: #000; }

.mbf-foot { width: min(760px, 100%); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.mbf-count { font-size: 13px; line-height: 18px; color: #555; }
.mbf-count:empty { display: none; }
.mbf-count:empty + .mbf-btn { margin-left: auto; }

/* Phones: the stage keeps a fixed height and the console is as tall as its
   fullest question, so the section never changes height under the reader. */
@media (max-width: 600px) {
	.mbf, .mbf--page { height: auto; }
	.mbf-stage { flex: 0 0 auto; height: clamp(250px, 40vh, 340px); }
	.mbf-console { min-height: 384px; padding: 16px 10px; }
	.mbf-find { gap: 12px; }
	.mbf-q { gap: 10px; width: 100%; }
	.mbf-tray { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; padding: 6px; }
	.mbf.mbf button.mbf-opt { justify-content: flex-start; min-height: 48px; padding: 4px 10px; font-size: 15px; white-space: normal; text-align: left; }
	.mbf-opt img { width: 36px; height: 36px; margin-left: -4px; flex: 0 0 auto; }
	.mbf.mbf button.mbf-clear { grid-column: 1 / -1; justify-self: center; height: 36px; }
	.mbf-tab-l { font-size: 10px; letter-spacing: 0.2px; }
	.mbf-tab-v { font-size: 13px; }
	.mbf-foot { flex-wrap: nowrap; gap: 12px; }
	.mbf-count { flex: 1 1 0; min-width: 0; font-size: 12px; line-height: 16px; text-align: left; }
	.mbf.mbf button.mbf-btn--sm { flex: 0 0 auto; padding: 9px 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.mbf-3d, .mbf-ring, .mbf.mbf button.mbf-item { transition-duration: 1ms !important; animation: none; }
}
