/* ---------------------------------------------------------------------------
 * Pharmalp Loyalty — styles front
 *
 * Aligné sur la charte RÉELLE du thème, relevée dans dist/assets/main-*.css et
 * assets/css/styles.css. Quatre règles non négociables, qui expliquent la
 * plupart des choix ci-dessous :
 *
 *   1. RAYONS — les boutons de marque sont à angles vifs (le thème force
 *      `border-radius:0!important` sur tous les CTA WooCommerce et pose
 *      `!rounded-none` dans les gabarits). Les conteneurs sont à 4px
 *      (`rounded-sm`, 34 usages). Seuls les badges, les puces et les barres de
 *      progression sont en pilule (`rounded-full`, 21 usages), et les cercles
 *      pleins en 50 %. Aucun 12px ni 16px n'existe dans le thème.
 *
 *   2. COULEURS — l'indigo #515581 (`primary`) est la couleur AMBIANTE de la
 *      marque : texte courant, prix, symbole du favicon. Le bordeaux #941B49
 *      (`secondary`) est la couleur d'ACTION, réservée aux boutons. On respecte
 *      ce partage : l'identité du programme est indigo, ses boutons bordeaux.
 *
 *   3. AUCUN DÉGRADÉ, AUCUNE OMBRE AU REPOS — le thème n'emploie ni l'un ni
 *      l'autre sur ses couleurs de marque ; le relief passe par une bordure 1px.
 *
 *   4. AUCUN INTERLETTRAGE — le thème ne contient pas une seule déclaration
 *      `letter-spacing`, y compris sur ses nombreux libellés en majuscules.
 *
 * Les teintes viennent des réglages et sont injectées par
 * PLY_Frontend::inline_css().
 * ------------------------------------------------------------------------- */

.ply-scope {
	/* La famille est déclarée explicitement : le <body> du thème ne porte pas
	   .font-body, donc `inherit` retomberait sur la police système. */
	font-family: var(--ply-font);
	font-weight: 300;
	color: var(--ply-ink);
	box-sizing: border-box;
}

.ply-scope *,
.ply-scope *::before,
.ply-scope *::after {
	box-sizing: border-box;
}

/* --- Le jeton ------------------------------------------------------------
 * Reprend le patron de puce du thème : `rounded-full bg-primary_light
 * text-primary px-3 py-2 text-xs font-semibold`.
 * ------------------------------------------------------------------------- */

.ply-token {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 12px 5px 5px;
	border-radius: 9999px;
	background-color: var(--ply-soft);
	background-image: none;
	color: var(--ply-ink);
	font-family: var(--ply-font);
	font-weight: 600;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	vertical-align: middle;
}

.ply-token-n {
	font-variant-numeric: tabular-nums;
}

.ply-token-u {
	font-weight: 500;
	font-size: 0.9em;
}

.ply-coin {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-color: var(--ply-main);
	overflow: hidden;
}

.ply-coin-mark {
	display: block;
	width: 12px;
	height: auto;
	color: #fff;
}

.ply-coin-letter {
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
}

.ply-token--sm {
	padding: 4px 10px 4px 4px;
	font-size: 11px;
	gap: 6px;
}

.ply-token--sm .ply-coin {
	width: 17px;
	height: 17px;
}

.ply-token--sm .ply-coin-mark {
	width: 10px;
}

.ply-token--lg {
	padding: 8px 16px 8px 8px;
	font-size: 17px;
	gap: 9px;
}

.ply-token--lg .ply-coin {
	width: 28px;
	height: 28px;
}

.ply-token--lg .ply-coin-mark {
	width: 17px;
}

/* Variante pleine, pour les contextes clairs qui demandent du contraste. */
.ply-token--solid {
	background-color: var(--ply-main);
	color: #fff;
}

.ply-token--solid .ply-coin {
	background-color: rgba(255, 255, 255, 0.22);
}

/* --- Le sceau du programme ---------------------------------------------- */

.ply-seal {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: var(--ply-main);
	overflow: hidden;
	flex: 0 0 auto;
}

.ply-seal .ply-coin-mark {
	width: 60%;
	height: auto;
}

.ply-seal .ply-coin-letter {
	font-size: 1.5em;
}

/* --- Puce de solde dans l'en-tête ----------------------------------------
 * Copie du patron de chip du thème, survol compris.
 * ------------------------------------------------------------------------- */

.ply-navchip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 12px 5px 5px;
	border-radius: 9999px;
	background-color: var(--ply-soft);
	color: var(--ply-main);
	font-family: var(--ply-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
}

.ply-navchip:hover,
.ply-navchip:focus {
	background-color: var(--ply-cta);
	color: #fff;
}

.ply-navchip:hover .ply-coin,
.ply-navchip:focus .ply-coin {
	background-color: rgba(255, 255, 255, 0.24);
}

.ply-navchip b {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

/* --- Bandeau d'annonce ---------------------------------------------------
 * Patron `bg-primary_light` du bandeau haut de page du thème.
 * ------------------------------------------------------------------------- */

.ply-banner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 12px 44px 12px 16px;
	background-color: var(--ply-soft);
	color: var(--ply-main);
	font-family: var(--ply-font);
	font-size: 14px;
	font-weight: 300;
	line-height: 1.4;
	text-align: center;
	position: relative;
}

.ply-banner a {
	color: var(--ply-main);
	font-weight: 600;
	text-decoration: underline;
}

.ply-banner strong {
	font-weight: 600;
}

.ply-banner .ply-seal {
	width: 26px;
	height: 26px;
}

.ply-banner-close {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ply-main);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.ply-banner-close:hover {
	color: var(--ply-cta);
}

/* --- Encart « cette commande vous rapporte » ----------------------------- */

.ply-earn {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background-color: var(--ply-surface);
	border: 1px solid var(--ply-soft);
	border-radius: var(--ply-radius);
	color: var(--ply-ink);
	font-family: var(--ply-font);
	font-size: 14px;
	font-weight: 300;
	line-height: 1.45;
	margin: 16px 0;
}

/* Emboîté dans .ply-loy-slot, l'espacement vient de l'enveloppe. */
.ply-loy-slot > .ply-earn {
	margin: 0;
}

.ply-earn .ply-seal {
	width: 30px;
	height: 30px;
}

.ply-earn strong {
	font-weight: 600;
}

.ply-earn a {
	color: var(--ply-cta);
	font-weight: 600;
	text-decoration: underline;
}

/* --- Carte de solde et progression --------------------------------------
 * Aplat indigo, sans dégradé : c'est le patron `bg-primary text-white` que le
 * thème répète sur ses sept bandeaux sombres.
 * ------------------------------------------------------------------------- */

.ply-balance {
	padding: 24px;
	border-radius: var(--ply-radius);
	background-color: var(--ply-main);
	color: #fff;
}

.ply-balance-label {
	font-size: 12px;
	text-transform: uppercase;
	color: var(--ply-on-dark-soft);
	margin-bottom: 6px;
}

.ply-balance-value {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-size: 44px;
	font-weight: 500;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.ply-balance-value span {
	font-size: 15px;
	font-weight: 500;
	color: var(--ply-on-dark-soft);
}

.ply-balance-sub {
	font-size: 14px;
	color: var(--ply-on-dark-soft);
	margin-top: 8px;
	line-height: 1.4;
}

.ply-balance--light {
	background-color: var(--ply-surface);
	color: var(--ply-ink);
}

.ply-balance--light .ply-balance-value {
	color: var(--ply-main);
}

.ply-balance--light .ply-balance-label,
.ply-balance--light .ply-balance-sub {
	color: var(--ply-muted);
}

/* Progression — patron exact de la barre de notation du thème :
   piste `bg-primary_light rounded-full h-3`, remplissage `bg-primary`. */

.ply-progress {
	margin-top: 18px;
}

.ply-progress-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 13px;
	margin-bottom: 8px;
	color: var(--ply-on-dark-soft);
}

.ply-progress-top strong {
	color: #fff;
	font-weight: 600;
}

.ply-progress-track {
	height: 12px;
	border-radius: 9999px;
	background-color: var(--ply-soft);
	overflow: hidden;
}

.ply-progress-fill {
	height: 12px;
	border-radius: 9999px;
	background-color: #fff;
	transition: width 0.3s ease;
}

.ply-balance--light .ply-progress-fill,
.ply-next-reward .ply-progress-fill {
	background-color: var(--ply-main);
}

.ply-balance--light .ply-progress-top,
.ply-next-reward .ply-progress-top {
	color: var(--ply-muted);
}

.ply-balance--light .ply-progress-top strong,
.ply-next-reward .ply-progress-top strong {
	color: var(--ply-main);
}

/* --- Échelle de récompenses ---------------------------------------------- */

.ply-ladder {
	display: flex;
	flex-direction: column;
}

.ply-rung {
	display: grid;
	grid-template-columns: 76px 1fr auto;
	gap: 14px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--ply-line);
}

.ply-rung:last-child {
	border-bottom: none;
}

.ply-rung-cost {
	font-size: 20px;
	font-weight: 500;
	line-height: 1.05;
	color: var(--ply-main);
	font-variant-numeric: tabular-nums;
}

.ply-rung-cost span {
	display: block;
	font-size: 12px;
	font-weight: 300;
	text-transform: uppercase;
	color: var(--ply-muted);
}

.ply-rung-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--ply-ink);
}

.ply-rung-type {
	font-size: 12px;
	text-transform: uppercase;
	color: var(--ply-muted);
	margin-top: 2px;
}

.ply-rung-ic {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: var(--ply-soft);
	color: var(--ply-main);
	flex: 0 0 auto;
}

.ply-rung-ic svg {
	width: 17px;
	height: 17px;
}

.ply-rung.is-reachable {
	background-color: var(--ply-surface);
	border-radius: var(--ply-radius);
	border-bottom-color: transparent;
	margin: 0 -12px;
	padding: 14px 12px;
}

.ply-rung.is-reachable .ply-rung-ic {
	background-color: var(--ply-main);
	color: #fff;
}

/* --- Boutons -------------------------------------------------------------
 * Patron CTA du thème, relevé à l'identique sur le bouton d'ajout au panier :
 * angles vifs, hauteur 48px, majuscules, semi-gras, et surtout SURVOL INVERSÉ
 * — le fond devient blanc, la couleur passe en bordure et en texte.
 *
 * Sélecteurs doublés à dessein : le preflight Tailwind du thème se charge après
 * cette feuille et remettrait `button{background-color:transparent}`.
 * ------------------------------------------------------------------------- */

.ply-scope .ply-btn,
.ply-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	height: 48px;
	padding: 0 32px;
	border: 1px solid transparent;
	border-radius: 0;
	background-color: var(--ply-cta);
	background-image: none;
	color: #fff;
	font-family: var(--ply-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: normal;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	opacity: 1;
	transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border-color 0.1s ease-in-out;
}

.ply-scope .ply-btn:hover:not(:disabled),
.ply-btn:hover:not(:disabled) {
	background-color: #fff;
	border-color: var(--ply-cta);
	color: var(--ply-cta);
}

.ply-scope .ply-btn:disabled,
.ply-scope .ply-btn.is-disabled,
.ply-btn:disabled,
.ply-btn.is-disabled {
	background-color: var(--ply-line);
	border-color: transparent;
	color: #fff;
	cursor: not-allowed;
}

.ply-scope .ply-btn--sm,
.ply-btn--sm {
	height: 40px;
	padding: 0 18px;
	font-size: 12px;
}

.ply-scope .ply-btn--block,
.ply-btn--block {
	width: 100%;
}

/* Bouton secondaire : contour indigo, remplissage au survol. */
.ply-scope .ply-btn--ghost,
.ply-btn--ghost {
	background-color: #fff;
	border-color: var(--ply-main);
	color: var(--ply-main);
}

.ply-scope .ply-btn--ghost:hover:not(:disabled),
.ply-btn--ghost:hover:not(:disabled) {
	background-color: var(--ply-main);
	border-color: var(--ply-main);
	color: #fff;
}

/* Bouton posé sur un aplat indigo. */
.ply-scope .ply-btn--on-dark,
.ply-btn--on-dark {
	background-color: #fff;
	border-color: #fff;
	color: var(--ply-main);
}

.ply-scope .ply-btn--on-dark:hover:not(:disabled),
.ply-btn--on-dark:hover:not(:disabled) {
	background-color: var(--ply-cta);
	border-color: var(--ply-cta);
	color: #fff;
}

.ply-scope .ply-btn.is-busy,
.ply-btn.is-busy {
	position: relative;
	color: transparent;
}

.ply-btn.is-busy::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ply-spin 0.7s linear infinite;
}

@keyframes ply-spin {
	to {
		transform: rotate(360deg);
	}
}

/* --- Pop-in d'adhésion --------------------------------------------------- */

.ply-popin-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background-color: rgba(30, 41, 59, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ply-popin-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.ply-popin {
	position: relative;
	width: 100%;
	max-width: 430px;
	max-height: 92vh;
	overflow-y: auto;
	border-radius: var(--ply-radius);
	background-color: #fff;
	/* Seule ombre tolérée : celle des panneaux flottants du thème
	   (`.menu-list ... ul.sub-menu`), reprise à l'identique. */
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	transform: translateY(12px);
	transition: transform 0.25s ease;
}

.ply-popin-overlay.is-open .ply-popin {
	transform: translateY(0);
}

.ply-popin-head {
	padding: 28px 28px 24px;
	background-color: var(--ply-main);
	color: #fff;
	text-align: center;
	border-radius: var(--ply-radius) var(--ply-radius) 0 0;
}

.ply-popin-head .ply-seal {
	margin: 0 auto 14px;
	width: 60px;
	height: 60px;
	background-color: #fff;
}

.ply-popin-head .ply-seal .ply-coin-mark {
	color: var(--ply-main);
}

.ply-popin-eyebrow {
	font-size: 12px;
	text-transform: uppercase;
	color: var(--ply-on-dark-soft);
	margin-bottom: 6px;
}

.ply-popin-head h3 {
	margin: 0;
	font-family: var(--ply-font);
	font-size: 26px;
	font-weight: 500;
	line-height: 1.15;
	text-transform: uppercase;
	color: #fff;
}

.ply-popin-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.ply-popin-body {
	padding: 24px 28px 26px;
}

.ply-popin-perks {
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
}

.ply-popin-perks li {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 8px 0;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.45;
	color: var(--ply-ink);
}

.ply-popin-perks .ply-tick {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border-radius: 50%;
	background-color: var(--ply-soft);
	color: var(--ply-main);
	overflow: hidden;
}

.ply-popin-perks .ply-tick svg {
	width: 12px;
	height: auto;
}

.ply-popin-perks strong {
	font-weight: 600;
}

.ply-popin-note {
	margin: 14px 0 0;
	font-size: 12px;
	font-weight: 300;
	line-height: 1.45;
	color: var(--ply-muted);
	text-align: center;
}

.ply-popin-skip {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 4px;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--ply-muted);
	font-family: var(--ply-font);
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.ply-popin-message {
	margin: 0 0 14px;
	padding: 12px 14px;
	border-radius: var(--ply-radius);
	font-size: 14px;
	line-height: 1.4;
}

.ply-popin-message.is-error {
	background-color: var(--ply-error-bg);
	border: 1px solid var(--ply-error);
	color: var(--ply-error);
}

.ply-popin-message.is-success {
	background-color: var(--ply-success-bg);
	border: 1px solid var(--ply-success);
	color: var(--ply-success);
}

/* --- Confirmation de commande -------------------------------------------- */

.ply-credited {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 22px 24px;
	margin: 0 0 20px;
	border-radius: var(--ply-radius);
	background-color: var(--ply-main);
	color: #fff;
}

.ply-credited-big {
	font-size: 40px;
	font-weight: 500;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ply-credited-big span {
	font-size: 15px;
	font-weight: 500;
	color: var(--ply-on-dark-soft);
}

.ply-credited-text {
	font-size: 14px;
	font-weight: 300;
	line-height: 1.5;
}

.ply-credited-text strong {
	font-weight: 600;
}

.ply-credited-text a {
	color: #fff;
	text-decoration: underline;
}

.ply-next-reward {
	padding: 18px 20px;
	margin: 0 0 20px;
	border: 1px solid var(--ply-soft);
	border-radius: var(--ply-radius);
	background-color: var(--ply-surface);
	color: var(--ply-ink);
}

.ply-next-reward .ply-progress {
	margin-top: 12px;
}

.ply-next-reward-line {
	font-size: 14px;
	font-weight: 300;
	line-height: 1.45;
}

.ply-next-reward-line strong {
	color: var(--ply-main);
	font-weight: 600;
}

/* --- Tableau de bord de l'espace compte ---------------------------------- */

.ply-dash-hero {
	padding: 28px 32px 32px;
	border-radius: var(--ply-radius);
	background-color: var(--ply-main);
	color: #fff;
}

.ply-dash-hero-top {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 22px;
}

.ply-dash-hero-top .ply-seal {
	width: 46px;
	height: 46px;
	background-color: #fff;
}

.ply-dash-hero-top .ply-seal .ply-coin-mark {
	color: var(--ply-main);
}

.ply-dash-hero-name {
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
	text-transform: uppercase;
}

.ply-dash-hero-eyebrow {
	font-size: 12px;
	text-transform: uppercase;
	color: var(--ply-on-dark-soft);
}

.ply-dash-hero-body {
	display: flex;
	align-items: flex-end;
	gap: 36px;
	flex-wrap: wrap;
}

.ply-dash-balance {
	font-size: 56px;
	font-weight: 500;
	line-height: 0.92;
	font-variant-numeric: tabular-nums;
}

.ply-dash-progress {
	flex: 1 1 240px;
	padding-bottom: 6px;
}

.ply-section-title {
	margin: 32px 0 14px;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--ply-main);
}

.ply-rewards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 16px;
}

.ply-reward-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 22px 18px 20px;
	border: 1px solid var(--ply-line);
	border-radius: var(--ply-radius);
	background-color: #fff;
}

.ply-reward-card.is-reachable {
	border-color: var(--ply-soft);
	background-color: var(--ply-surface);
}

.ply-reward-card .ply-rung-ic {
	width: 44px;
	height: 44px;
	margin-bottom: 12px;
}

.ply-reward-card .ply-rung-ic svg {
	width: 20px;
	height: 20px;
}

.ply-reward-name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	margin-bottom: 4px;
	color: var(--ply-ink);
}

.ply-reward-desc {
	font-size: 13px;
	font-weight: 300;
	line-height: 1.4;
	color: var(--ply-muted);
	margin-bottom: 8px;
}

.ply-reward-cost {
	font-size: 20px;
	font-weight: 500;
	color: var(--ply-main);
	font-variant-numeric: tabular-nums;
	margin-bottom: 14px;
}

.ply-reward-card .ply-btn {
	width: 100%;
	margin-top: auto;
}

/* Bons obtenus */

.ply-vouchers {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ply-voucher {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 16px 18px;
	border: 1px solid var(--ply-soft);
	border-radius: var(--ply-radius);
	background-color: var(--ply-surface);
}

.ply-voucher.is-spent {
	border-color: var(--ply-line);
	background-color: #fff;
}

.ply-voucher-main {
	flex: 1 1 200px;
}

.ply-voucher-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--ply-ink);
}

.ply-voucher-meta {
	font-size: 13px;
	font-weight: 300;
	color: var(--ply-muted);
	margin-top: 3px;
}

.ply-voucher-code {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 9px 14px;
	border: 1px dashed var(--ply-main);
	border-radius: var(--ply-radius);
	background-color: #fff;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 14px;
	font-weight: 700;
	color: var(--ply-main);
}

.ply-copy {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--ply-cta);
	cursor: pointer;
	font-family: var(--ply-font);
	font-size: 12px;
	text-decoration: underline;
}

.ply-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
}

.ply-status--issued {
	background-color: var(--ply-main);
	color: #fff;
}

.ply-status--used {
	background-color: var(--ply-success-bg);
	color: var(--ply-success);
}

.ply-status--expired,
.ply-status--cancelled {
	background-color: var(--ply-soft);
	color: var(--ply-muted);
}

/* Historique */

.ply-history {
	border-top: 1px solid var(--ply-line);
}

.ply-history-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 14px;
	align-items: center;
	padding: 13px 0;
	border-bottom: 1px solid var(--ply-line);
}

.ply-history-label {
	font-size: 14px;
	font-weight: 300;
	color: var(--ply-ink);
}

.ply-history-date {
	font-size: 12px;
	color: var(--ply-muted);
	margin-top: 2px;
}

.ply-history-pts {
	font-size: 15px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ply-history-pts.is-plus {
	color: var(--ply-main);
}

.ply-history-pts.is-minus {
	color: var(--ply-muted);
}

.ply-empty {
	padding: 24px;
	border: 1px solid var(--ply-line);
	border-radius: var(--ply-radius);
	background-color: var(--ply-surface);
	text-align: center;
	font-size: 14px;
	font-weight: 300;
	color: var(--ply-muted);
}

.ply-notice {
	padding: 14px 16px;
	margin: 0 0 16px;
	border-radius: var(--ply-radius);
	font-size: 14px;
	font-weight: 300;
	line-height: 1.45;
}

.ply-notice.is-error {
	background-color: var(--ply-error-bg);
	border: 1px solid var(--ply-error);
	color: var(--ply-error);
}

.ply-notice.is-success {
	background-color: var(--ply-success-bg);
	border: 1px solid var(--ply-success);
	color: var(--ply-success);
}

.ply-optout {
	margin-top: 34px;
	padding-top: 18px;
	border-top: 1px solid var(--ply-line);
	font-size: 13px;
	color: var(--ply-muted);
}

.ply-optout button {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--ply-muted);
	font-family: var(--ply-font);
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.ply-optout button:hover {
	color: var(--ply-cta);
}

/* --- Panneau fidélité — panier & paiement (colonne de droite) -------------
 *
 * Le héros est l'écart ACTIONNABLE (« 6 points à gagner »), pas le gain passif :
 * au moment de payer, c'est le seul chiffre qui fasse encore agir. Tout le
 * reste — nom du programme, solde, apport du panier — est légende.
 *
 * Le panneau porte .ply-scope : famille, graisse 300 et couleur en sont
 * hérités. Le sceau vient de .ply-seal, le bouton de .ply-btn--ghost : aucun
 * composant n'est reforké. --ply-muted n'est employé sur aucun texte porteur
 * (2,43:1 sur --ply-surface, sous le seuil AA) ; la mise en retrait passe par
 * le corps et la graisse.
 * ------------------------------------------------------------------------- */

/* Enveloppe. WooCommerce Blocks impose `padding: 16px 0` au premier enfant du
   remplissage, par `.wc-block-components-totals-wrapper.slot-wrapper > * > *` :
   une classe simple ne peut pas la battre, et sans cet emboîtement le padding
   latéral du panneau tombe à zéro — le contenu vient alors se coller au filet.
   L'enveloppe encaisse la règle ; le panneau garde sa mise en page. */
.ply-loy-slot {
	margin: 0 0 16px;
}

/* Dans le panier en blocs, c'est WooCommerce qui donne le rythme vertical. */
.wc-block-components-totals-wrapper .ply-loy-slot,
.wc-block-components-order-meta .ply-loy-slot {
	margin: 0;
}

.ply-loy {
	container-type: inline-size;
	padding: 16px;
	background-color: var(--ply-surface);
	border: 1px solid var(--ply-soft);
	border-radius: var(--ply-radius);
}

/* Ligne 1 — ancre de marque, nom du programme, solde.
   Le nom se replie sur deux lignes plutôt que de s'élider : un `title` n'existe
   pas au tactile, et 320 px, c'est le mobile. */
.ply-loy__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 8px;
}

.ply-loy__head .ply-seal {
	width: 22px;
	height: 22px;
}

.ply-loy__program {
	flex: 1 1 120px;
	min-width: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--ply-main);
}

.ply-loy__balance {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ply-main);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Ligne 2 — le seul chiffre qui domine : ce qu'il reste à gagner. */
.ply-loy__lead {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 8px;
	margin: 10px 0 0;
}

.ply-loy__num {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--ply-main);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.ply-loy__unit {
	min-width: 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

/* Ligne 3 — la récompense visée. Le libellé est saisi en administration : on
   le borne à deux lignes pour que la hauteur du panneau ne dépende pas de sa
   longueur. */
.ply-loy__goal {
	margin: 2px 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
	font-size: 13px;
	font-weight: 300;
	line-height: 1.35;
}

/* Barre — deux segments : l'acquis, puis ce que ce panier ajoute. Le
   remplissage total est bridé à 94 % tant qu'il reste des points à gagner,
   sans quoi 98 % se lirait « c'est fait » juste sous une phrase qui dit
   le contraire. */
.ply-loy__track {
	display: flex;
	height: 6px;
	margin-top: 12px;
	background-color: var(--ply-soft);
	border-radius: 9999px;
	overflow: hidden;
}

.ply-loy__seg {
	display: block;
	width: 0;
	height: 100%;
}

.ply-loy__seg--own {
	background-color: var(--ply-main);
}

.ply-loy__seg--gain {
	background-color: var(--ply-dark);
}

/* Ligne 4 — ce que ce panier apporte, légende des segments. */
.ply-loy__foot {
	margin: 10px 0 0;
	font-size: 13px;
	font-weight: 300;
	line-height: 1.35;
}

.ply-loy__foot b {
	font-weight: 500;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Plus rien à débloquer : le créneau du grand chiffre disparaît plutôt que
   d'accueillir un nombre qui aurait un autre sens. */
.ply-loy__done {
	margin: 10px 0 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
}

.ply-loy__applied {
	margin: 8px 0 0;
	font-size: 12px;
	font-weight: 300;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

/* Échange immédiat. Le bouton reprend .ply-btn--ghost : le bordeaux d'action
   reste l'exclusivité de « Valider la commande », qu'il ne doit pas concurrencer.
   text-transform:none est une dérogation assumée — le libellé est un nom saisi
   en administration, pas un libellé maison. */
.ply-loy__redeem {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--ply-line);
}

/* Contenu centré et non réparti aux extrémités : sur une colonne de 356 px,
   `space-between` creusait une centaine de pixels de vide entre le libellé et
   le coût, et le bouton se lisait comme un cadre vide. Centré, il reprend le
   patron plein-largeur des CTA du thème (h-12, contenu centré).

   Les deux axes se règlent séparément, et c'est le point à ne pas manquer :
   `align-items: baseline` pose le coût sur la ligne de base du libellé — deux
   corps différents, il le faut — mais n'a aucun effet sur la place du groupe
   dans les 48 px du bouton, qui restait collé en haut sous le padding. C'est
   `align-content` qui centre les lignes elles-mêmes ; il n'agit qu'avec
   `flex-wrap: wrap`, présent ici pour le repli à 320 px. */
.ply-scope .ply-btn--redeem,
.ply-btn--redeem {
	display: flex;
	align-items: baseline;
	align-content: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 2px 8px;
	width: 100%;
	height: auto;
	min-height: 48px;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	text-transform: none;
}

.ply-scope .ply-btn--redeem:focus-visible,
.ply-btn--redeem:focus-visible {
	outline: 2px solid var(--ply-dark);
	outline-offset: 2px;
}

/* Le survol inversé est réservé au pointeur fin : au tactile il resterait collé
   après l'appui et se lirait « déjà appliqué ». */
@media (hover: none) {
	.ply-scope .ply-btn--redeem:hover:not(:disabled),
	.ply-btn--redeem:hover:not(:disabled) {
		background-color: #fff;
		border-color: var(--ply-main);
		color: var(--ply-main);
	}
}

.ply-scope .ply-btn--redeem:active:not(:disabled),
.ply-btn--redeem:active:not(:disabled) {
	background-color: var(--ply-soft);
	border-color: var(--ply-main);
	color: var(--ply-main);
}

.ply-scope .ply-btn--redeem:disabled,
.ply-btn--redeem:disabled {
	background-color: transparent;
	border-color: var(--ply-line);
	color: var(--ply-muted);
	cursor: not-allowed;
}

.ply-loy__btn-label {
	min-width: 0;
	overflow-wrap: anywhere;
}

.ply-loy__btn-cost {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 300;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.ply-loy__more {
	display: inline-block;
	margin-top: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ply-main);
	text-decoration: underline;
}

.ply-loy__error {
	margin: 8px 0 0;
	padding: 8px 10px;
	background-color: var(--ply-error-bg);
	border-radius: var(--ply-radius);
	color: var(--ply-error);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.35;
}

/* Requête de CONTENEUR et non de fenêtre : la colonne tombe à 320 px sur un
   écran de 1440 px, un media query ne se déclencherait jamais. */
@container (max-width: 360px) {
	.ply-loy__num {
		font-size: 24px;
	}

	.ply-loy__unit {
		font-size: 14px;
	}
}

/* --- Adaptations mobiles -------------------------------------------------- */

@media (max-width: 640px) {
	.ply-dash-hero {
		padding: 22px 20px 24px;
	}

	.ply-dash-balance {
		font-size: 44px;
	}

	.ply-dash-hero-body {
		gap: 20px;
	}

	.ply-credited {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.ply-rung {
		grid-template-columns: 66px 1fr auto;
		gap: 10px;
	}

	.ply-banner {
		font-size: 13px;
		padding: 10px 40px 10px 12px;
	}

	.ply-scope .ply-btn,
	.ply-btn {
		padding: 0 20px;
	}
}

/* --- Bloc de conversion du tunnel -----------------------------------------
 *
 * Le décompte est une addition : chaque ligne y ajoute un montant, et le
 * grand chiffre se recalcule quand le client coche. Les lignes reflètent
 * l'état des cases natives de WooCommerce sans les dupliquer — cliquer une
 * ligne amène à la case, elle ne la coche pas à distance.
 * ------------------------------------------------------------------------- */

.ply-conv {
	container-type: inline-size;
	padding: 16px;
	background-color: var(--ply-surface);
	border: 1px solid var(--ply-soft);
	border-radius: var(--ply-radius);
	font-family: var(--ply-font);
	color: var(--ply-ink);
}

.ply-conv__rows {
	margin-top: 14px;
	border-top: 1px solid var(--ply-line);
}

.ply-scope .ply-conv__row,
.ply-conv__row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 9px 0;
	border: 0;
	border-bottom: 1px solid var(--ply-line);
	border-radius: 0;
	background: none;
	background-image: none;
	color: inherit;
	font-family: inherit;
	font-size: 13px;
	font-weight: 300;
	line-height: 1.35;
	text-align: left;
	text-transform: none;
	height: auto;
}

.ply-scope .ply-conv__row--action,
.ply-conv__row--action {
	cursor: pointer;
}

.ply-scope .ply-conv__row--action:hover,
.ply-conv__row--action:hover {
	background: none;
	color: var(--ply-main);
}

.ply-scope .ply-conv__row--action:focus-visible,
.ply-conv__row--action:focus-visible {
	outline: 2px solid var(--ply-main);
	outline-offset: 2px;
}

.ply-conv__box {
	position: relative;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	border: 1px solid var(--ply-main);
	border-radius: 2px;
	background: #fff;
}

.ply-conv__box.is-on {
	background: var(--ply-main);
}

.ply-conv__box.is-on::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(43deg);
}

.ply-conv__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.ply-conv__hint {
	display: block;
	margin-top: 1px;
	font-size: 12px;
	color: var(--ply-main);
	opacity: 0.75;
}

.ply-conv__amount {
	flex: 0 0 auto;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.ply-conv__foot {
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 300;
	line-height: 1.35;
}

.ply-conv__foot b {
	font-weight: 500;
}

@container (max-width: 360px) {
	.ply-conv__row {
		font-size: 12px;
	}
}

/* --- Confirmation d'une commande passée en invité -------------------------
 * Même carte que le bloc de conversion : c'est la suite du même parcours,
 * elle doit se reconnaître. Seul le bouton change — il devient plein, parce
 * qu'ici il n'y a plus qu'une chose à faire.
 * ------------------------------------------------------------------------- */

.ply-claim {
	container-type: inline-size;
	max-width: 520px;
	margin: 20px 0;
	padding: 16px;
	background-color: var(--ply-surface);
	border: 1px solid var(--ply-soft);
	border-radius: var(--ply-radius);
}

.ply-claim .ply-conv__row {
	cursor: default;
}

.ply-claim__cta {
	margin: 14px 0 0;
}

.ply-claim__deadline {
	margin: 8px 0 0;
	font-size: 12px;
	font-weight: 300;
	color: var(--ply-main);
	opacity: 0.8;
}

/* --- Bloc de conversion rendu dans l'étape « Coordonnées » -----------------
 *
 * Les deux règles ci-dessous sont commandées par une classe que le composant
 * pose sur <body> AU MONTAGE, jamais par le PHP. La différence compte : si le
 * script échoue ou si WooCommerce change de structure, rien n'est masqué et le
 * client garde ses cases. Un masquage inconditionnel laisserait un tunnel sans
 * commande à cocher.
 * ------------------------------------------------------------------------- */

/* Le bloc s'est monté dans la colonne de gauche : le récapitulatif n'affiche
   pas le même décompte une seconde fois. */
body.ply-conv-in-contact .ply-conv-fallback {
	display: none;
}

/* Le bloc commande réellement les deux cases : les natives s'effacent. Le champ
   « mot de passe » n'est pas concerné — WooCommerce le rend dans
   .wc-block-checkout__contact-fields, un conteneur frère de la case. */
body.ply-drives-checkout .wc-block-checkout__create-account,
body.ply-drives-checkout .pharmalp-newsletter-block-optin,
body.ply-drives-checkout .wc-block-components-address-form__pharmalp-newsletter_optin {
	display: none;
}

/* Dans l'étape Coordonnées, le bloc s'aligne sur la largeur du formulaire et
   se sépare des champs par un blanc, pas par un filet de plus : la colonne en
   compte déjà assez. */
.wc-block-woocommerce-checkout-contact-information-block .ply-conv {
	margin-top: 16px;
}

/* --- Encart du panier, visiteur sans compte -------------------------------
   Aucun lien, aucun bouton : la seule action possible depuis cet écran doit
   rester celle qu'on veut, continuer vers le paiement. Le contraste vient
   donc de la surface et du poids, jamais du bordeaux — couleur d'action du
   thème, réservée aux boutons. Un encart non cliquable en bordeaux se lirait
   comme un bouton, et affaiblirait « Valider la commande » juste en dessous.
   ------------------------------------------------------------------------ */
/* L'encart invité reprend la carte du panneau : il faut donc désactiver la
   mise en page horizontale que .ply-earn portait pour sa forme d'origine —
   un jeton suivi d'une ligne de texte. */
.ply-earn--guest {
	display: block;
	padding: 16px;
}

.ply-earn__detail {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.5;
}

.ply-earn__hint {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--ply-muted, #6b6e8c);
}

.ply-earn__goal {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--ply-line, #cbd5e1);
	font-size: 13px;
}

.ply-earn__goal p {
	margin: 8px 0 0;
}

.ply-earn__track {
	height: 6px;
	border-radius: 9999px;
	background: var(--ply-soft, #dadcf2);
	overflow: hidden;
}

.ply-earn__fill {
	height: 100%;
	background: var(--ply-main, #515581);
	transition: width 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
	.ply-earn__fill {
		transition: none;
	}
}
