/* Le Lautrec : coffrets de macarons à composer */
:root {
	--lm-cream: #FFF9F4;
	--lm-sand: #FAE8D6;
	--lm-ink: #130505;
	--lm-muted: #6b5c55;
	--lm-line: rgba(19, 5, 5, 0.14);
	--lm-accent: #FF7B3B;
	--lm-title: 'BrandonGrotesque-Bold', 'Poppins', sans-serif;
}

/* L'ancien champ PPOM « Composition du coffret » est remplacé par ce bloc */
.lm-coffret form.cart .ppom-rendering-fields,
.lm-coffret form.cart .ppom-price-container {
	display: none !important;
}

/* ===== Bloc de choix sur la fiche produit ===== */
.lm-choice {
	width: 100%;
	margin: 0 0 24px;
}

.lm-choice__title {
	margin: 0 0 12px;
	font-family: var(--lm-title);
	font-size: 18px;
	color: var(--lm-ink);
}

.lm-choice__modes {
	display: grid;
	gap: 10px;
}

.lm-mode {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
}

.lm-mode input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.lm-mode__box {
	display: block;
	padding: 14px 16px 14px 48px;
	border: 1px solid var(--lm-line);
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.lm-mode__box::before {
	content: '';
	position: absolute;
	top: 17px;
	left: 16px;
	width: 18px;
	height: 18px;
	border: 1px solid var(--lm-ink);
	border-radius: 50%;
	background: #fff;
}

.lm-mode input:checked + .lm-mode__box {
	border-color: var(--lm-ink);
	box-shadow: inset 0 0 0 1px var(--lm-ink);
}

.lm-mode input:checked + .lm-mode__box::before {
	background: var(--lm-ink);
	box-shadow: inset 0 0 0 4px #fff;
}

.lm-mode input:focus-visible + .lm-mode__box {
	outline: 2px solid var(--lm-accent);
	outline-offset: 2px;
}

.lm-mode__name {
	display: block;
	font-weight: 600;
	font-size: 15px;
	color: var(--lm-ink);
}

.lm-mode__hint {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--lm-muted);
}

.lm-choice__panel {
	margin-top: 14px;
}

.lm-avoid__label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
	font-size: 14px;
}

.lm-avoid__label span {
	font-weight: 400;
	color: var(--lm-muted);
}

.lm-choice textarea {
	width: 100%;
	min-height: 64px;
	padding: 12px 14px;
	border: 1px solid var(--lm-line);
	background: #fff;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
}

/* Récapitulatif de la composition */
.lm-recap {
	padding: 16px;
	border: 1px solid var(--lm-line);
	background: var(--lm-sand);
}

.lm-recap__status {
	margin: 12px 0 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--lm-ink);
}

.lm-recap__status.is-ok {
	color: #2f7a3e;
}

.lm-recap__list {
	margin: 8px 0 14px;
	padding: 0;
	list-style: none;
	font-size: 14px;
	line-height: 1.6;
}

.lm-recap__list:empty {
	display: none;
}

.lm-recap__list span {
	display: inline-block;
	min-width: 30px;
	font-weight: 600;
}

/* ===== Cases du coffret ===== */
.lm-slots {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.lm-slot {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px dashed rgba(19, 5, 5, 0.3);
	background: rgba(255, 255, 255, 0.6) center / cover no-repeat;
	transition: transform 0.2s;
}

.lm-slot.is-filled {
	border: 0;
	box-shadow: 0 1px 2px rgba(19, 5, 5, 0.18);
	animation: lm-pop 0.25s ease;
}

.lm-slots--small .lm-slot {
	width: 22px;
	height: 22px;
}

@keyframes lm-pop {
	from { transform: scale(0.6); }
	to { transform: scale(1); }
}

/* ===== Boutons ===== */
.lm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 24px;
	border: 1px solid var(--lm-ink);
	border-radius: 30px;
	background: transparent;
	color: var(--lm-ink);
	font: 500 14px/1 'Poppins', sans-serif;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.lm-btn:hover:not(:disabled) {
	background: var(--lm-ink);
	color: #fff;
}

.lm-btn--outline {
	width: 100%;
	background: #fff;
}

.lm-btn--primary {
	background: var(--lm-ink);
	color: #fff;
}

.lm-btn--primary:hover:not(:disabled) {
	background: var(--lm-accent);
	border-color: var(--lm-accent);
}

.lm-btn--ghost {
	border-color: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.lm-btn--ghost:hover:not(:disabled) {
	background: transparent;
	color: var(--lm-ink);
}

.lm-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* ===== Panneau de composition ===== */
html.lm-locked,
html.lm-locked body {
	overflow: hidden !important;
}

.lm-panel {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lm-panel[hidden] {
	display: none;
}

.lm-panel__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(19, 5, 5, 0.45);
	opacity: 0;
	transition: opacity 0.25s;
}

.lm-panel__sheet {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1180px, calc(100vw - 48px));
	height: min(900px, calc(100vh - 48px));
	background: var(--lm-cream);
	transform: translateY(24px);
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.lm-panel.is-open .lm-panel__backdrop { opacity: 1; }
.lm-panel.is-open .lm-panel__sheet { transform: none; opacity: 1; }

.lm-panel__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 24px;
	padding: 28px 32px 20px;
	border-bottom: 1px solid var(--lm-line);
}

.lm-panel__kicker {
	margin: 0 0 4px;
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--lm-muted);
}

.lm-panel__title {
	margin: 0;
	font-family: var(--lm-title);
	font-size: clamp(24px, 3vw, 34px);
	line-height: 1.1;
	color: var(--lm-ink);
}

.lm-panel__sub {
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--lm-muted);
}

.lm-panel__close {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--lm-line);
	border-radius: 50%;
	background: #fff;
	color: var(--lm-ink);
	cursor: pointer;
}

.lm-panel__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 28px 32px;
}

/* Gammes */
.lm-group + .lm-group {
	margin-top: 44px;
}

.lm-group__title {
	margin: 0 0 20px;
	font-family: var(--lm-title);
	font-size: 22px;
	color: var(--lm-ink);
}

/* Grille des parfums */
.lm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 28px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lm-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	margin: 0;
}

.lm-card__visual {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	padding: 14%;
	border: 1px solid transparent;
	background: var(--lm-sand);
	cursor: pointer;
	transition: border-color 0.2s;
}

/* Le thème donne un fond noir à tous les boutons au survol : on l'annule dans le panneau */
.lm-panel .lm-card__visual,
.lm-panel .lm-card__visual:hover,
.lm-panel .lm-card__visual:focus,
.lm-panel .lm-card__visual:active {
	background: var(--lm-sand) !important;
	box-shadow: none !important;
	color: inherit !important;
}

.lm-panel .lm-stepper button,
.lm-panel .lm-stepper button:hover,
.lm-panel .lm-stepper button:focus,
.lm-panel .lm-stepper button:active {
	background: transparent !important;
	box-shadow: none !important;
	color: var(--lm-ink) !important;
}

.lm-panel .lm-panel__close:hover,
.lm-panel .lm-panel__close:focus {
	background: #fff !important;
	border-color: var(--lm-ink) !important;
	color: var(--lm-ink) !important;
}

/* Survol : fine bordure noire */
.lm-card__visual:hover:not(:disabled) {
	border-color: var(--lm-ink);
}

.lm-card__visual:focus-visible {
	outline: 2px solid var(--lm-accent);
	outline-offset: 2px;
}

.lm-card__visual:disabled {
	cursor: default;
}

.lm-card__visual img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.3s;
}

.lm-card__visual:hover:not(:disabled) img {
	transform: scale(1.05);
}

.lm-card__dot {
	width: 72%;
	aspect-ratio: 1;
	border-radius: 50%;
	box-shadow: 0 6px 14px rgba(19, 5, 5, 0.15);
}

.lm-card.is-selected .lm-card__visual {
	border-color: var(--lm-ink);
}

.lm-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 8px;
	background: var(--lm-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.lm-card__qty {
	position: absolute;
	top: 10px;
	right: 10px;
	display: none;
	min-width: 26px;
	height: 26px;
	padding: 0 6px;
	border-radius: 13px;
	background: var(--lm-ink);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 26px;
}

.lm-card.is-selected .lm-card__qty {
	display: block;
}

.lm-card__name {
	margin: 12px 0 0;
	font-family: var(--lm-title);
	font-size: 17px;
	line-height: 1.2;
	color: var(--lm-ink);
}

.lm-card__desc {
	display: -webkit-box;
	margin: 4px 0 0;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.45;
	color: var(--lm-muted);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Le dernier texte avant le compteur garde un espace, le compteur se cale en bas : alignés sur toute la ligne */
.lm-card > :nth-last-child(2) {
	margin-bottom: 12px;
}

.lm-stepper {
	display: inline-flex;
	align-items: center;
	height: 38px;
	margin-top: auto;
	border: 1px solid var(--lm-ink);
	border-radius: 30px;
	overflow: hidden;
	background: #fff;
}

.lm-stepper button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--lm-ink);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.lm-stepper button:disabled {
	opacity: 0.25;
	cursor: not-allowed;
}

.lm-stepper__val {
	min-width: 26px;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
}

/* Pied fixe : le coffret qui se remplit */
.lm-panel__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 18px 32px;
	border-top: 1px solid var(--lm-line);
	background: #fff;
}

.lm-panel__box {
	min-width: 0;
}

.lm-panel__count {
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--lm-muted);
}

.lm-panel__count strong {
	margin-right: 6px;
	color: var(--lm-ink);
	font-size: 16px;
}

.lm-panel__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
	.lm-panel__sheet {
		width: 100vw;
		height: 100%;
		height: 100dvh;
	}

	.lm-panel__head {
		padding: 18px 16px 14px;
	}

	.lm-panel__body {
		padding: 18px 16px;
	}

	.lm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 12px;
	}

	.lm-card__name {
		font-size: 15px;
	}

	.lm-panel__foot {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
	}

	.lm-slot {
		width: 24px;
		height: 24px;
	}

	.lm-panel__actions .lm-btn--primary {
		flex: 1 1 auto;
	}
}
