/* Protéalpes – Cadeaux unidose (front). Couleurs reprises du panier latéral : noir, angles droits. */

/* ---------- Alerte sous le produit ---------- */
.pug-offer { display: block; margin-top: 6px; }

.pug-alert {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: #000;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}
.pug-alert:hover span,
.pug-alert:focus-visible span { text-decoration: underline; }
.pug-alert:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

.pug-icon { width: 20px; height: 20px; flex: none; transform-origin: 50% 15%; }

/* Petite cloche : le cadeau se balance, puis marque une pause. */
.pug-alert:not(.pug-alert--done) .pug-icon { animation: pug-ring 3s ease-in-out infinite; }
.pug-alert--done { font-weight: 500; opacity: .75; }

@keyframes pug-ring {
	0%, 40%, 100% { transform: rotate(0); }
	4%  { transform: rotate(-16deg) translateX(-1px); }
	8%  { transform: rotate(14deg) translateX(1px); }
	12% { transform: rotate(-12deg); }
	16% { transform: rotate(10deg); }
	20% { transform: rotate(-6deg); }
	24% { transform: rotate(4deg); }
	28% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
	.pug-alert:not(.pug-alert--done) .pug-icon { animation: none; }
}

/* ---------- Lignes cadeau dans le panier ---------- */
.pug-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 6px;
	background: #000;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	vertical-align: middle;
}
.pug-free { font-weight: 700; }

/* ---------- Pop-up ---------- */
html.pug-lock { overflow: hidden; }

.pug-modal { position: fixed; inset: 0; z-index: 1000010; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pug-modal[hidden] { display: none; }
.pug-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.pug-modal__box {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 28px 24px 24px;
	background: #fff;
	color: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.pug-modal__box:focus { outline: none; }
.pug-modal__x {
	position: absolute; top: 6px; right: 10px;
	width: 36px; height: 36px;
	border: 0; background: none; color: #000;
	font-size: 28px; line-height: 1; cursor: pointer;
}

.pug-title { margin: 0 24px 8px 0; font-size: 20px; line-height: 1.2; font-style: italic; font-weight: 800; }
.pug-message { margin: 0 0 14px; font-size: 14px; }
.pug-loading { text-align: center; }

.pug-slot { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.pug-slot legend { padding: 0; margin-bottom: 8px; font-weight: 700; }

.pug-step { margin: 16px 0 10px; font-weight: 700; font-size: 15px; line-height: 1.3; }
.pug-level:first-of-type .pug-step { margin-top: 0; }

.pug-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.pug-opt { position: relative; cursor: pointer; }
.pug-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pug-opt span { display: block; padding: 10px 16px; border: 1px solid #ccc; font-size: 15px; line-height: 1.2; }
.pug-opt:hover span { border-color: #000; }
.pug-opt input:checked + span { background: #000; border-color: #000; color: #fff; }
.pug-opt input:focus-visible + span { outline: 2px solid #000; outline-offset: 2px; }
.pug-opt__sub { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; opacity: .75; }

/* Avec photo : cartes. */
.pug-opts--cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pug-opts--cards .pug-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border: 1px solid #ccc; text-align: center; }
.pug-opts--cards .pug-opt img { width: 64px; height: 64px; object-fit: contain; }
.pug-opts--cards .pug-opt span { padding: 0; border: 0; background: none; color: inherit; }
.pug-opts--cards .pug-opt input:checked + span { background: none; color: inherit; font-weight: 700; }
.pug-opts--cards .pug-opt:has(input:checked) { border-color: #000; box-shadow: inset 0 0 0 1px #000; }

/* Un seul choix possible : l'étape est franchie d'office. Seule reste visible la dernière (le cadeau lui-même), en simple récapitulatif. */
.pug-level[hidden] { display: none !important; }
.pug-auto:not(.pug-final) { display: none; }
.pug-final .pug-opt { cursor: default; }
.pug-final .pug-opt span,
.pug-final .pug-opt input:checked + span { border: 0; padding: 0; background: none; color: inherit; font-weight: 700; }
.pug-final .pug-opts--cards { display: block; }
.pug-final .pug-opts--cards .pug-opt { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 0; border: 0; box-shadow: none; text-align: left; }

.pug-error { margin: 0 0 10px; color: #b00020; font-size: 14px; }
.pug-error[hidden] { display: none; }

.pug-confirm {
	display: block; width: 100%;
	padding: 14px 20px; border: 1px solid #000; border-radius: 0;
	background: #000; color: #fff;
	font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	cursor: pointer;
}
.pug-confirm:disabled { opacity: .4; cursor: not-allowed; }
.pug-confirm:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* ---------- Apparition en fondu ---------- */
.pug-modal:not([hidden]) .pug-modal__backdrop { animation: pug-fade .25s ease-out both; }
.pug-modal:not([hidden]) .pug-modal__box { animation: pug-pop .3s cubic-bezier(.2, .8, .2, 1) both; }
.pug-level:not([hidden]) { animation: pug-fade .25s ease-out both; }

@keyframes pug-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pug-pop {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.pug-modal:not([hidden]) .pug-modal__backdrop,
	.pug-modal:not([hidden]) .pug-modal__box,
	.pug-level:not([hidden]) { animation: none; }
}

/* Étape « saveur » : photo du produit à gauche. */
.pug-level--media { display: flex; align-items: flex-start; gap: 16px; }
.pug-level--media[hidden] { display: none !important; }
.pug-level__img { flex: none; width: 110px; height: 110px; object-fit: contain; background: #f5f5f5; }
.pug-level__main { flex: 1; min-width: 0; }
.pug-level--media .pug-step { margin-top: 0; }
@media (max-width: 420px) { .pug-level__img { width: 80px; height: 80px; } }

/* ================================================================
 * Pop-up — mise en page soignée (surcharge les règles ci-dessus)
 * ================================================================ */
.pug-modal__box { max-width: 520px; padding: 0; }
.pug-modal__body { padding: 28px 28px 24px; }
@media (min-width: 768px) {
	.pug-modal__box { max-width: 660px; }
	.pug-modal__body { padding: 36px 40px 32px; }
}
.pug-modal__x { top: 10px; right: 12px; transition: transform .2s ease; }
.pug-modal__x:hover { transform: rotate(90deg); }

/* En-tête : pastille noire avec le cadeau, titre, sous-titre. */
.pug-head { display: flex; align-items: center; gap: 16px; margin: 0 32px 22px 0; padding-bottom: 20px; border-bottom: 1px solid #e6e6e6; }
.pug-head__icon {
	flex: none; display: flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; background: #000; color: #fff;
}
.pug-head__icon .pug-icon { width: 28px; height: 28px; transform-origin: 50% 15%; }
.pug-modal:not([hidden]) .pug-head__icon .pug-icon { animation: pug-ring 1.6s .35s ease-in-out 1 both; }
.pug-head__text { min-width: 0; }
.pug-head .pug-title { margin: 0; font-size: 24px; }
.pug-sub { margin: 4px 0 0; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #6b6b6b; }
.pug-message { margin: -6px 0 18px; font-size: 15px; line-height: 1.45; }

/* Étape saveur : grande photo du produit dans un encart clair. */
.pug-level--media { gap: 24px; align-items: center; }
.pug-level__img { width: 150px; height: 150px; padding: 10px; box-sizing: border-box; background: #f4f4f4; }
@media (min-width: 768px) { .pug-level__img { width: 200px; height: 200px; } }
@media (max-width: 480px) {
	.pug-level--media { flex-direction: column; align-items: flex-start; gap: 14px; }
	.pug-level__img { width: 100%; height: 160px; }
}
.pug-level--media .pug-step { font-size: 16px; }

/* Pastilles de saveur : plus grandes, coche à la sélection. */
.pug-opts { gap: 10px; }
.pug-opt span { position: relative; min-width: 96px; padding: 12px 18px; text-align: center; transition: background-color .15s, border-color .15s, color .15s; }
.pug-opt input:checked + span { padding-left: 34px; }
.pug-opt input:checked + span::before {
	content: ""; position: absolute; left: 14px; top: 50%;
	width: 10px; height: 5px; margin-top: -4px;
	border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
}
.pug-opts--cards .pug-opt input:checked + span { padding-left: 0; }
.pug-opts--cards .pug-opt input:checked + span::before,
.pug-final .pug-opt input:checked + span::before { content: none; }
.pug-opts--cards .pug-opt span { min-width: 0; }
.pug-opts--cards .pug-opt { transition: border-color .15s, box-shadow .15s; }
.pug-opts--cards .pug-opt:hover { border-color: #000; }

/* Bouton : noir plein, plus présent. */
.pug-confirm { margin-top: 26px; padding: 16px 20px; font-size: 15px; transition: opacity .2s, transform .1s; }
/* Survol : le thème peut éclaircir le fond des boutons ; la bordure noire reste toujours visible. */
.pug-modal .pug-confirm:not(:disabled):hover { opacity: 1; border: 1px solid #000; }
.pug-confirm:not(:disabled):active { transform: translateY(1px); }
.pug-confirm:disabled { background: #bdbdbd; border-color: #bdbdbd; opacity: 1; }
/* Les photos produit ont déjà leur fond : pas de second cadre. */
.pug-level__img { padding: 0; background: none; object-fit: cover; }

/* Espace entre une étape et la suivante. */
.pug-level + .pug-level:not([hidden]) { margin-top: 20px; }

/* ---------- Parcours numéroté : 1. protéine, 2. gamme, 3. saveur ---------- */
.pug-slot { counter-reset: pug-step; }
.pug-level:not([hidden]):not(.pug-auto) .pug-step::before,
.pug-level.pug-final:not([hidden]) .pug-step::before {
	counter-increment: pug-step;
	content: counter(pug-step);
	display: inline-flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; margin-right: 10px;
	background: #000; color: #fff;
	font-size: 12px; font-style: normal; vertical-align: 1px;
}
.pug-level__name { margin: 0 0 6px; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; color: #6b6b6b; }

/* Étapes protéine / gamme : grandes cartes avec photo. */
.pug-opts--cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pug-opts--cards .pug-opt { padding: 14px 12px 12px; gap: 10px; }
.pug-opts--cards .pug-opt img { width: 100%; height: 120px; object-fit: contain; }
.pug-opts--cards .pug-opt span { font-size: 15px; font-weight: 700; }

/* ================================================================
 * Assistant pas à pas : une seule étape visible à la fois
 * ================================================================ */
.pug-slot .pug-level:not(.pug-current) { display: none !important; }
.pug-level.pug-current { animation: pug-step-in .28s ease-out both; }
@keyframes pug-step-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* Numéro d'étape posé par le script (data-n). */
.pug-level:not([hidden]):not(.pug-auto) .pug-step::before,
.pug-level.pug-final:not([hidden]) .pug-step::before { counter-increment: none; content: attr(data-n); }

/* Progression : « Étape 2 sur 3 » + segments. */
.pug-progress:empty { display: none; }
.pug-progress { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.pug-progress__text { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: #6b6b6b; white-space: nowrap; }
.pug-progress__bar { display: flex; gap: 6px; flex: 1; max-width: 220px; }
.pug-progress__bar span { flex: 1; height: 4px; background: #e2e2e2; transition: background-color .3s; }
.pug-progress__bar span.is-done { background: #000; }

/* Retour à l'étape précédente. */
.pug-back { display: inline-flex; align-items: center; margin: 0 0 12px; padding: 0; border: 0; background: none; color: #000; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.pug-back[hidden] { display: none; }
.pug-back:hover { text-decoration: underline; }
.pug-back:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* Le bouton de confirmation n'apparaît qu'à la dernière étape. */
.pug-form:not(.pug-at-end) .pug-confirm { display: none; }

/* Étape saveur : grande image qui suit la saveur choisie. */
@media (min-width: 768px) { .pug-level__img { width: 240px; height: 240px; } }
.pug-level__img.is-swapping { animation: pug-fade .3s ease-out both; }

@media (prefers-reduced-motion: reduce) {
	.pug-level.pug-current, .pug-level__img.is-swapping { animation: none; }
}

/* Cadeau unique : récapitulatif (photo à gauche, nom, saveur en gras). */
.pug-final .pug-opt span:empty { display: none; }
.pug-final .pug-opts { display: block; }
.pug-final .pug-opt span { font-size: 18px; min-width: 0; text-align: left; }
.pug-final .pug-level__name { font-size: 15px; color: #000; font-weight: 700; text-transform: none; letter-spacing: 0; }

/* Pastilles de saveur : largeur fixe, sélectionnée ou non. La coche se loge dans la marge gauche
 * déjà réservée (marges symétriques) : rien ne bouge et rien ne passe à la ligne au clic. */
.pug-opt span,
.pug-opt input:checked + span { padding: 12px 26px; }
.pug-opt input:checked + span::before { left: 9px; }
.pug-opt span { border-width: 1px; }
.pug-opt input:checked + span { font-weight: inherit; }

/* Grand écran : pop-up plus large pour aligner plus de saveurs sur une ligne. */
@media (min-width: 900px) {
	.pug-modal__box { max-width: 820px; }
}

/* Pastilles de saveur : à la sélection, la coche apparaît et le texte glisse vers la droite.
 * La marge gauche grandit d'autant que la marge droite diminue (22+22 = 32+12) : largeur inchangée. */
.pug-opt span { padding: 12px 22px; transition: padding .22s ease, background-color .15s, border-color .15s, color .15s; }
.pug-opt input:checked + span { padding: 12px 12px 12px 32px; }
.pug-opt span::before {
	content: ""; position: absolute; left: 13px; top: 50%;
	width: 10px; height: 5px; margin-top: -4px;
	border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
	opacity: 0; transform: rotate(-45deg) scale(.3);
	transition: opacity .2s ease, transform .22s ease;
}
.pug-opt input:checked + span::before { opacity: 1; transform: rotate(-45deg) scale(1); }
/* Pas de coche sur les cartes avec photo ni sur le récapitulatif. */
.pug-opts--cards .pug-opt span,
.pug-opts--cards .pug-opt input:checked + span { padding: 0; }
.pug-final .pug-opt span,
.pug-final .pug-opt input:checked + span { padding: 0; }
.pug-opts--cards .pug-opt span::before,
.pug-final .pug-opt span::before { content: none; }
@media (prefers-reduced-motion: reduce) {
	.pug-opt span, .pug-opt span::before { transition: none; }
}

/* ================================================================
 * Croix de fermeture : SVG centré, rotation sur place (plus de décalage)
 * ================================================================ */
.pug-modal .pug-modal__x {
	display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; padding: 0; margin: 0;
	border: 0; background: none; color: #000;
	font-size: 0; line-height: 0;
	transform-origin: 50% 50%;
	transition: transform .2s ease;
}
.pug-modal .pug-modal__x svg { display: block; width: 22px; height: 22px; flex: none; }
.pug-modal .pug-modal__x:hover,
.pug-modal .pug-modal__x:focus-visible { transform: rotate(90deg); background: none; padding: 0; }

/* ================================================================
 * Bandeau « Vous avez droit à … cadeau(x) », au-dessus des produits
 * ================================================================ */
.pug-banner-wrap { margin: 0 0 18px; }
.pug-banner__btn {
	display: flex; align-items: center; gap: 14px; width: 100%;
	padding: 14px 18px; margin: 0;
	border: 2px solid #000; border-radius: 0; background: #fff; color: #000;
	font: inherit; text-align: left; cursor: pointer;
	transition: background-color .2s, color .2s;
}
.pug-banner__btn:hover { background: #000; color: #fff; }
.pug-banner__btn:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
.pug-banner__icon {
	flex: none; display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; background: #000; color: #fff;
	transition: background-color .2s, color .2s;
}
.pug-banner__btn:hover .pug-banner__icon { background: #fff; color: #000; }
.pug-banner__icon .pug-icon { width: 22px; height: 22px; animation: pug-ring 3s ease-in-out infinite; }
.pug-banner__text { flex: 1; font-size: 16px; font-weight: 800; font-style: italic; line-height: 1.25; }
.pug-banner__cta { flex: none; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; }
.pug-banner--done .pug-banner__btn { border-width: 1px; }
.pug-banner--done .pug-banner__icon .pug-icon { animation: none; }
.pug-banner--done .pug-banner__text { font-weight: 700; font-style: normal; font-size: 15px; }
@media (max-width: 520px) {
	.pug-banner__btn { flex-wrap: wrap; }
	.pug-banner__cta { width: 100%; padding-left: 54px; }
}
/* Panier latéral : bandeau plus compact. */
.ppsc-products > .pug-banner-wrap, .ppsc-body .pug-banner-wrap { margin: 0 0 12px; }
@media (prefers-reduced-motion: reduce) { .pug-banner__icon .pug-icon { animation: none; } }

/* Pop-up : numéro du cadeau, confirmation d'ajout entre deux cadeaux. */
.pug-sub__num { color: #000; }
.pug-added {
	display: flex; align-items: center; justify-content: center; gap: 12px;
	min-height: 160px; margin: 0; font-size: 18px; font-weight: 800; font-style: italic;
	animation: pug-fade .25s ease-out both;
}
.pug-added .pug-icon { width: 28px; height: 28px; }

/* Rappel sur la validation de commande : même bandeau, teinte d'attention. */
.pug-banner--notice .pug-banner__btn { background: #fff8e1; border-color: #000; }
.pug-banner--notice .pug-banner__btn:hover { background: #000; }
.pug-banner--notice .pug-banner__text { font-style: normal; }
.pug-banner-wrap:empty { display: none; }
