/**
 * Offres partenaires : Mon compte → Mes offres (liste, formulaire, prolongation) et affichage dans la boutique
 * (badge Avantage, conditions, mention légale, image recadrée sur le point choisi).
 * Données : mu-plugins/mpe-offres-partenaires/. Variables de couleur : celles de mon-compte.css (--mpe-*).
 */

:root {
	--mpe-op-rose: #FF00A3;
	--mpe-op-bleu: #1F53F3;
	--mpe-op-navy: #000034;
	--mpe-op-texte: #334155;
	--mpe-op-bord: #d1d5db;
	--mpe-op-doux: #f0f5fa;
}

/* -------------------------------------------------------------------------
 * Boutique : cartes et fiche
 * ---------------------------------------------------------------------- */

.mpe-badge-avantage {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	max-width: calc(100% - 24px);
	padding: .4em .85em;
	border-radius: 999px;
	background-color: var(--mpe-op-rose);
	color: #fff;
	font-size: .82rem;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}
/* « Nouveau » passe sous le badge Avantage (même coin). */
.mpe-offre .mpe-badge-avantage ~ .mpe-badge-nouveau,
.astra-shop-thumbnail-wrap:has(.mpe-badge-avantage) .mpe-badge-nouveau { top: calc(12px + 2.6em); }
.single-product div.product > .mpe-badge-avantage { top: 20px; left: 20px; z-index: 9; font-size: .875rem; padding: .45em .95em; }

/* « Réservé aux abonnés » hors des pages boutique (fiche partenaire, page d'abonnement) : mêmes styles que reserve-fanplus.css. */
.mpe-offre .mpe-badge-fanplus {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	padding: .4em .85em;
	border-radius: 999px;
	background-color: var(--mpe-op-navy);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	line-height: 1.2;
	pointer-events: none;
}
/* Fiche : sur l'image, en haut à gauche, sous le badge Avantage (en haut à droite, il passait sur le titre). */
.single-product div.product.mpe-offre > .mpe-badge-fanplus { top: 20px; right: 20px; left: auto; z-index: 9; font-size: .875rem; padding: .45em .95em; } /* 29/11 : en haut à droite de l'image */

/* Badge « Promo ! » (WooCommerce / Astra) remplacé par le badge Avantage. */
.mpe-offre .onsale,
.mpe-offre .ast-onsale-card { display: none !important; }

/* Image de l'offre : entière dans le cadre carré, sur fond gris-bleu, comme les autres produits (boutique.css). */
.woocommerce ul.products li.product.mpe-offre .astra-shop-thumbnail-wrap img.mpe-offre-img,
.mpe-offre img.mpe-offre-img { object-fit: contain; background-color: #f2f5ff; }

.mpe-offre-conditions--carte {
	margin: .2rem 0 0;
	overflow: hidden;
	color: var(--mpe-op-texte);
	font-size: .82em;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.mpe-offre-fin { margin: .15rem 0 0; color: var(--mpe-op-texte); font-size: .78em; opacity: .8; }

.mpe-offre-infos { margin: .75rem 0 1rem; }
.mpe-offre .mpe-badge-fanplus:not(.mpe-badge-fanplus--membre) { background-color: #1f53f3; } /* « Réservé Fan+ » */
/* Fiche : « Encore mieux pour les Fan+ » (avantage Fan+ d'une offre ouverte à tous les abonnés). */
.mpe-offre-fanplus {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .35rem .5rem;
	margin: 0 0 1rem;
	padding: .6rem .85rem;
	border-radius: 12px;
	background: #eef2ff;
	color: var(--mpe-op-navy, #0b1033);
	font-size: .92rem;
	line-height: 1.4;
}
.mpe-offre-fanplus__tag { padding: .15em .55em; border-radius: 999px; background: #1f53f3; color: #fff; font-size: .75rem; font-weight: 800; }
.mpe-offre-fanplus a { margin-left: auto; font-weight: 700; color: #1f53f3; text-decoration: underline; text-underline-offset: 3px; }
.mpe-offre-infos .mpe-offre-conditions { margin: 0 0 .35rem; font-size: .95rem; }
.mpe-offre-infos .mpe-offre-fin { font-size: .88rem; }
.mpe-offre-mention { margin: .5rem 0 0; color: var(--mpe-op-texte); font-size: .8rem; opacity: .8; }

/* Fiche : bouton vers le partenaire / « Abonnez-vous pour en profiter ». */
.mpe-offre-cta .mpe-offre-cta__connexion { flex-basis: 100%; margin: .5rem 0 0; font-size: .88rem; }
/* 25/11 : lien « Se connecter » souligné, comme les autres liens dans le texte. */
.mpe-offre-cta .mpe-offre-cta__connexion a { font-weight: 600; text-decoration: underline !important; text-underline-offset: 3px; }
.mpe-offre-cta .mpe-offre-cta__note { flex-basis: 100%; margin: .5rem 0 0; color: var(--mpe-op-texte); font-size: .82rem; opacity: .8; }

/* -------------------------------------------------------------------------
 * Mon compte → Mes offres
 * ---------------------------------------------------------------------- */

.woocommerce-MyAccount-content .mpe-pill--danger { border-color: color-mix(in srgb, var(--mpe-danger, #b42318) 30%, #fff); color: var(--mpe-danger, #b42318); background: #fff; }
.woocommerce-MyAccount-content .mpe-pill--danger:hover { border-color: var(--mpe-danger, #b42318); background: color-mix(in srgb, var(--mpe-danger, #b42318) 8%, #fff); color: var(--mpe-danger, #b42318); }
.mpe-op-inline { display: inline; margin: 0; }
.mpe-op-badge {
	display: inline-flex;
	align-items: center;
	padding: .3em .75em;
	border-radius: 999px;
	background: var(--mpe-op-rose);
	color: #fff;
	font-size: .78rem;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
}

/* État vide (26/11 : exemples présentés comme les cartes d'offre de la boutique) */
.mpe-op-vide { display: grid; gap: 20px; padding: 0; border: 0; background: none; }
.woocommerce-MyAccount-content .mpe-op-vide__titre { margin: 0 0 .5rem; color: var(--mpe-op-navy); font-size: 1.15rem; font-weight: 700; }
.woocommerce-MyAccount-content .mpe-op-vide__texte { margin: 0; max-width: 640px; }
.woocommerce-MyAccount-content .mpe-op-vide__exemples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 620px; margin: 0; padding: 0; list-style: none; }
.woocommerce-MyAccount-content .mpe-op-vide__exemples .mpe-op-exemple { display: block; margin: 0; padding: 0 0 14px; border-radius: 4px; font-size: inherit; }
.mpe-op-vide__exemples .mpe-op-apercu__img { aspect-ratio: 4 / 3; }
.mpe-op-vide__exemples .mpe-op-apercu__img img { object-fit: contain; padding: 4%; box-sizing: border-box; }
.woocommerce-MyAccount-content .mpe-op-vide__exemples .mpe-op-apercu__nom { font-size: 14px; }
.woocommerce-MyAccount-content .mpe-op-vide__legende { margin: -8px 0 0; color: #64748b; font-size: 13px; }
.mpe-op-vide__action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 4px; }
.woocommerce-MyAccount-content .mpe-op-vide__action > p { margin: 0; }
.woocommerce-MyAccount-content .mpe-op-vide__gains { flex: 1 1 260px; margin: 0; color: #64748b; font-size: 13px; line-height: 1.5; }
@media (max-width: 700px) { .woocommerce-MyAccount-content .mpe-op-vide__exemples { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mpe-op-vide__exemples li:nth-child(3) { display: none; } }

/* Liste */
.mpe-op-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1rem; }
.woocommerce-MyAccount-content .mpe-op-entete .mpe-intro { margin: 0; }
.woocommerce-MyAccount-content .mpe-op-plein,
.woocommerce-MyAccount-content .mpe-op-alerte { margin: 0 0 1rem; padding: 12px 16px; border-radius: 10px; background: #fff4e5; color: #9a5b00; font-size: .9rem; }
.mpe-op-liste { display: grid; gap: 1rem; }
.mpe-op-carte {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 1.25rem;
	padding: 16px;
	border: 1px solid var(--mpe-op-bord);
	border-radius: 16px;
	background: #fff;
}
.mpe-op-carte--expiree, .mpe-op-carte--pause, .mpe-op-carte--refusee { background: #f8fafc; }
.mpe-op-carte__img { position: relative; width: 150px; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #f2f5ff; }
.mpe-op-carte__img img { display: block; width: 100%; height: 100%; object-fit: contain; background-color: #f2f5ff; }
.mpe-op-carte__img .mpe-op-badge { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; }
.woocommerce-MyAccount-content .mpe-op-carte__titre { margin: 0 0 .35rem; color: var(--mpe-op-navy); font-size: 1.1rem; }
.woocommerce-MyAccount-content .mpe-op-carte__badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem; }
/* Titre à gauche, statut à droite (sous le titre si la place manque). */
.mpe-op-carte__tete { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .4rem 1rem; margin: 0 0 .5rem; }
.woocommerce-MyAccount-content .mpe-op-carte__tete .mpe-op-carte__titre { margin: 0; }
.woocommerce-MyAccount-content .mpe-op-carte__tete .mpe-op-carte__badges { justify-content: flex-end; margin: 0; }
.woocommerce-MyAccount-content .mpe-op-carte__info { margin: 0 0 .4rem; font-size: .88rem; }
.woocommerce-MyAccount-content .mpe-op-carte__info--alerte { color: #b42318; }
.mpe-op-statut--en_ligne { background: #e8f7ee; color: #15803d; } /* = statuts « ok » des commandes / abonnements (mon-compte.css) */
.mpe-op-statut--en_attente { background: #fff4e5; color: #9a5b00; }
.mpe-op-statut--refusee { background: color-mix(in srgb, var(--mpe-danger, #b42318) 10%, #fff); color: var(--mpe-danger, #b42318); }
.mpe-op-statut--pause { background: color-mix(in srgb, var(--mpe-op-bleu) 12%, #fff); color: var(--mpe-op-bleu); } /* = statuts « info » */
.mpe-op-statut--expiree, .mpe-op-statut--brouillon { background: var(--mpe-op-doux); color: var(--mpe-op-texte); } /* = statuts « off » */
.mpe-op-clics { display: grid; gap: .2rem; margin: .5rem 0 .75rem; font-size: .82rem; }
.mpe-op-clics div { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.mpe-op-clics dt { color: var(--mpe-op-navy); font-weight: 600; }
.mpe-op-clics dd { margin: 0; opacity: .85; }
.mpe-op-carte__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.mpe-op-export { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--mpe-op-bord); }
.woocommerce-MyAccount-content .mpe-op-export__titre { margin: 0 0 .75rem; color: var(--mpe-op-navy); font-size: 1.05rem; }
.mpe-op-export__form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.mpe-op-export__form select, .mpe-op-export__form input[type="date"] { padding: .45em .6em; border: 1px solid var(--mpe-op-bord); border-radius: 8px; }
.mpe-op-export .mpe-pform__aide { margin-top: .35rem; }

@media (max-width: 600px) {
	.mpe-op-carte { grid-template-columns: 1fr; }
	.mpe-op-carte__img { width: 100%; max-width: 260px; }
}

/* Formulaire */
.mpe-op-edition { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; align-items: start; }
.mpe-op-apercu { position: sticky; top: 108px; } /* sous l'en-tête collant (84 px) + 24 px */
.admin-bar .mpe-op-apercu { top: 140px; } /* + barre d'administration (32 px) */
@media (max-width: 1000px) {
	.mpe-op-edition { grid-template-columns: 1fr; }
	.mpe-op-apercu { position: static; order: -1; max-width: 280px; }
}
.mpe-op-vis { display: inline-block; margin-left: .35rem; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600; vertical-align: middle; }
.mpe-op-vis--public { background: var(--mpe-op-doux); color: var(--mpe-op-texte); }
.mpe-op-vis--abonnes { background: color-mix(in srgb, var(--mpe-op-bleu) 12%, #fff); color: var(--mpe-op-bleu); }
.mpe-op-form input[type="date"] { max-width: 220px; padding: .6em .75em; border: 1px solid var(--mpe-op-bord); border-radius: 10px; }
.mpe-op-image { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 600px) { .mpe-op-image { grid-template-columns: 1fr; } }
.mpe-op-cadre { position: relative; width: 220px; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #f2f5ff; cursor: crosshair; }
.mpe-op-cadre img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 26/11 : zone de dépôt */
.mpe-op-image { padding: 14px; border: 2px dashed #d6dcef; border-radius: 16px; transition: border-color .15s, background-color .15s; }
.mpe-op-image.is-survol { border-color: var(--mpe-op-accent, #1F53F3); background: var(--mpe-op-doux); }
.mpe-op-cadre:has(img[hidden]) { cursor: pointer; }
.mpe-op-cadre__vide { padding: 0 1rem; text-align: center; }
.mpe-op-cadre__zone { position: absolute; inset: 10%; border: 1.5px dashed rgba(255, 255, 255, .9); border-radius: 6px; box-shadow: 0 0 0 1px rgba(0, 0, 52, .25); pointer-events: none; }
.mpe-op-cadre__point { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 3px solid #fff; border-radius: 50%; background: var(--mpe-op-rose); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.mpe-op-cadre__vide { position: absolute; inset: 0; display: grid; place-items: center; color: #64748b; font-size: .85rem; }
.woocommerce-MyAccount-content .mpe-op-avert { margin: .5rem 0 0; color: #9a5b00; font-size: .85rem; }
.mpe-op-certif { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--mpe-op-doux); }
.mpe-op-certif .mpe-pform__check { align-items: flex-start; margin: 0; }

/* Aperçu */
.woocommerce-MyAccount-content .mpe-op-apercu__titre { margin: 0 0 .5rem; color: var(--mpe-op-navy); font-size: .9rem; font-weight: 700; }
/* Aperçu : mêmes tailles et mêmes écarts que la carte de la boutique (mesurés sous l'image : marque à 13 px,
   titre à 31 px, prix ou code à 66 px). */
.mpe-op-apercu__carte { overflow: hidden; margin-bottom: .5rem; padding-bottom: 14px; border: 1px solid var(--mpe-op-bord); border-radius: 16px; background: #fff; }
.mpe-op-apercu__carte p { margin: 0 14px; }
.mpe-op-apercu__img { position: relative; aspect-ratio: 1; background: #f2f5ff; }
.mpe-op-apercu__img img { display: block; width: 100%; height: 100%; object-fit: contain; background-color: #f2f5ff; }
.mpe-op-apercu__img .mpe-op-badge { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.woocommerce-MyAccount-content .mpe-op-apercu__carte .mpe-op-apercu__partenaire { margin-top: 13px; color: #334155; font-size: 12.8px; line-height: 16.64px; letter-spacing: .04em; text-transform: uppercase; }
.woocommerce-MyAccount-content .mpe-op-apercu__carte .mpe-op-apercu__nom { margin-top: 2px; color: var(--mpe-op-navy); font-family: Toroka, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 700; line-height: 1.3; }
.woocommerce-MyAccount-content .mpe-op-apercu__carte .mpe-op-apercu__prix { margin-top: 14px; font-size: 14.4px; line-height: 1.4; }
.woocommerce-MyAccount-content .mpe-op-apercu__carte .mpe-op-apercu__prix:empty { display: none; }
.mpe-op-apercu__prix del { opacity: .6; }
.mpe-op-apercu__prix strong { color: var(--mpe-op-navy); }
.woocommerce-MyAccount-content .mpe-op-apercu__carte .mpe-op-apercu__code { display: flex; flex-wrap: wrap; align-items: center; gap: 6.4px; margin-top: 14px; color: var(--mpe-op-navy); font-size: 14.4px; line-height: 23.76px; letter-spacing: .03em; }
.woocommerce-MyAccount-content .mpe-op-apercu__carte .mpe-op-apercu__prix:not(:empty) + .mpe-op-apercu__code { margin-top: 6px; }
.mpe-op-apercu__code strong { padding: 4px 9.6px; border: 1px dashed var(--mpe-op-bleu); border-radius: 6px; font-family: monospace; font-size: 14.4px; line-height: 14.4px; letter-spacing: normal; }

/* Raccourci « Mes offres » sur les cartes partenaire (Espace partenaire). */
.mpe-pcarte__offres { margin: .35rem 0 0; font-size: .85rem; }

/* L'attribut hidden doit l'emporter sur les display ci-dessus (images vides, badge vide, blocs masqués). */
.mpe-op-cadre [hidden],
.mpe-op-apercu [hidden],
.mpe-op-carte [hidden],
.mpe-pform [hidden] { display: none !important; }

/* Champs côte à côte : contenu en haut, sans étirer le libellé. */
.mpe-pform .mpe-pform__champ { align-content: start; }

/* Export : listes à leur largeur naturelle (le thème impose une largeur fixe). */
.mpe-op-export__form select { width: auto; min-width: 9.5rem; padding-right: 2.2em; }

/* Offre sans catégorie (« Non classé » masqué) : ni étiquette vide ni séparateur devant le partenaire. */
.mpe-offre--sans-categorie .ast-woo-product-category { display: none; }
.mpe-offre--sans-categorie .ast-woo-product-category + .mpe-partner::before { content: none; display: none; }

/* Type d'offre : boutons radio côte à côte (ligne entière), l'un sous l'autre si la place manque. */
.mpe-op-radios { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; padding-top: .35rem; }
.mpe-op-radios .mpe-pform__check { align-items: center; margin-top: 0; font-size: .95rem; cursor: pointer; } /* 26/11 : rond centré sur le texte */
.mpe-op-radios .mpe-pform__check input { flex: none; margin: 0; vertical-align: middle; }

/* Image, description (hors grille) : même écart qu'entre les champs de la grille (1,5rem). */
.woocommerce-MyAccount-content .mpe-pform .mpe-pform__grille + .mpe-pform__champ { margin-top: 1.5rem; }

/* « + Ajouter une offre » sous la liste. */
.woocommerce-MyAccount-content .mpe-op-ajouter { margin: 1rem 0 0; }
.mpe-op-ajouter .mpe-pill { display: inline-flex; align-items: center; gap: .45rem; }
.mpe-op-ajouter .mpe-pill { padding-left: .45em; }
.mpe-op-ajouter__plus { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.6em; height: 1.6em; border-radius: 50%; background: #fff; color: var(--mpe-op-bleu); transition: transform .2s; }
.mpe-op-ajouter__plus svg { display: block; width: .8em; height: .8em; }
.mpe-op-ajouter .mpe-pill:hover .mpe-op-ajouter__plus { transform: rotate(90deg); }
.woocommerce-MyAccount-content .mpe-op-plein--bas { margin: 1rem 0 0; }

/* Cartes d'offres : « Réservé aux abonnés » en bas à gauche de l'image, pour ne jamais recouvrir le badge Avantage
   ni « Nouveau » (en haut à gauche), surtout sur les cartes étroites (mobile, 2 colonnes). La fiche produit garde sa place. */
li.product.mpe-offre .mpe-badge-fanplus { top: auto !important; right: auto !important; bottom: 12px; left: 12px !important; }
@media (max-width: 544px) {
	li.product.mpe-offre .mpe-badge-fanplus { bottom: 10px; left: 10px !important; }
}
/* 29/11 : texte complet par défaut (fiche, cartes étroites) ; version courte « cadenas Abonnés » en haut à droite
   quand la carte fait au moins 250 px (place pour un avantage long : 12 + 120 + 8 + ~85 + 12 px). */
.mpe-badge-fanplus__court { display: none; }
.mpe-badge-fanplus { gap: .4em; } /* 29/11 : cadenas partout (fiche, cartes) */
.mpe-badge-fanplus .mpe-badge-fanplus__cadenas { display: block; flex: none; width: 1em; height: 1em; }
li.product.mpe-offre .woocommerce-loop-product__link { container-type: inline-size; }
@container (min-width: 250px) {
	li.product.mpe-offre .mpe-badge-fanplus { top: 12px !important; right: 12px !important; bottom: auto; left: auto !important; font-size: .82rem; padding: .4em .85em; line-height: 1.2; } /* même gélule que l'avantage à côté */
	li.product.mpe-offre .mpe-badge-fanplus .mpe-badge-fanplus__court { display: inline; }
	li.product.mpe-offre .mpe-badge-fanplus .mpe-badge-fanplus__long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* lu par les lecteurs d'écran */
}

/* Mes offres : badge Fan+ (avantage Fan+ ou « Réservé Fan+ »), sous le badge Avantage. */
.mpe-op-carte__img .mpe-op-badge--fan { top: calc(8px + 2em); background: #1f53f3; }

/* Fiche offre : note « Vous allez être redirigé… » / « Déjà abonné ? » plus près du bouton (37 → 12 px). */
.single-product .summary .mpe-offre-cta .single_add_to_cart_button { margin-bottom: 0 !important; } /* Astra ajoute 17 px */
.single-product .summary .mpe-offre-cta .mpe-offre-cta__note,
.single-product .summary .mpe-offre-cta .mpe-offre-cta__connexion { margin-top: 0; }

/* 26/11 : site du partenaire sur la fiche de l'offre (mu-plugins/mpe-offres-partenaires/public.php) */
.mpe-offre-site { margin: .5rem 0 0; font-size: .9rem; }
.mpe-offre-site a { color: var(--mpe-op-accent, #1F53F3); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mpe-offre-site a:hover { text-decoration-thickness: 2px; }

/* Mention légale sous le bouton de la fiche (29/11) : petites lignes, filet au-dessus */
.single-product .summary .mpe-offre-mention { margin: 20px 0 0 !important; padding-top: 14px; border-top: 1px solid #D9D9D9; color: #6b6f8a !important; font-size: 12.5px !important; line-height: 1.5 !important; opacity: 1; }
