/* ==========================================================================
   CuisineMax 1.9.2 : gabarit « grid », refonte visuelle
   Chargé après style.css et le CSS inline du plugin (dépendance « cmxshop »).
   Ne s'applique ni au carrousel (afx-carousel-wrap) ni à la petite grille
   (afx-sst). Les valeurs par défaut sont posées en :where(), sans
   spécificité : le champ « Custom CSS » du plugin les surcharge toujours.
   ========================================================================== */

:where(.cmxshop.cmxshop-grid) {
	--cmx-accent: var(--cmx-color, #7f1418); /* couleur du plugin (réglage Color) */
	--cmx-price: #212529;         /* couleur du meilleur prix */
	--cmx-ink: #212529;           /* texte principal */
	--cmx-muted: #5f6368;         /* noms des marchands secondaires */
	--cmx-line: #ece7df;          /* filets et bordure de carte */
	--cmx-soft: #faf8f5;          /* survol des lignes d'offre */
	--cmx-footer: #f6f3ee;        /* fond de la zone des offres */
	--cmx-label: #8a7550;         /* libellé « Meilleur prix » */
	--cmx-title-font: inherit;    /* police des titres du site */
	--cmx-radius: 10px;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) {
	font-family: inherit;         /* abandon de Century Gothic, étranger aux deux thèmes */
}

/* --- Grille : colonnes égales, cartes de même hauteur --- */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 16px;
	margin: 1.25em 0;
	align-items: stretch;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	background: #fff;
	border: 1px solid var(--cmx-line);
	border-radius: var(--cmx-radius);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 12px rgba(0, 0, 0, .06);
	overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item:hover {
	box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 12px 28px rgba(0, 0, 0, .12);
	transform: translateY(-2px);
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item:focus { box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 12px rgba(0, 0, 0, .06); }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item:focus-visible {
	outline: 2px solid var(--cmx-accent);
	outline-offset: 2px;
}

/* --- En-tête : image sur fond doux, titre sur deux lignes fixes --- */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-header { padding: 0; flex: 0 0 auto; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item .cmxshop-header a { display: block !important; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-image {
	height: 190px;
	padding: 0;
	margin: 0;
	max-width: none;
	background: #fff;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-image img {
	inset: 0;
	min-height: 0;
	padding: 14px;
	object-fit: contain;
	mix-blend-mode: multiply;     /* fond blanc des photos fondu dans le fond doux */
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-content { padding: 12px 14px 6px; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-title {
	font-family: var(--cmx-title-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	height: 2.6em;
	max-height: 2.6em;
	margin: 0;
	padding: 0;
	color: var(--cmx-ink);
	text-align: center;
	font-variant-numeric: lining-nums;  /* références lisibles en Playfair */
}

/* --- Offres : une ligne par marchand ---
   Ordre : pictogramme, nom du marchand, prix, bouton. Même alignement que le
   gabarit list. La zone des offres sert de conteneur : quand la carte est trop
   étroite pour tout afficher (grille à 3 colonnes), le nom est masqué à l'écran
   (conservé pour les lecteurs d'écran) et le logo identifie le marchand. */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer {
	flex: 1 0 auto;
	padding: 4px 12px 12px;
	border-top: 1px solid var(--cmx-line);
	background: var(--cmx-footer);
	container-type: inline-size;
	container-name: cmxoffres;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-offer {
	padding: 8px 4px;
	border: 0;
	border-top: 1px solid var(--cmx-line);
	border-radius: 0;
	background: none;
	text-align: left;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-offer:hover { background: rgba(255, 255, 255, .6); }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-wrap {
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	gap: 8px;
}
/* 1. pictogramme + 2. nom */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-merchant {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 22px;              /* le logo ne se fait jamais recouvrir */
	text-align: left;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-logo { flex: 0 0 22px; width: 22px; height: 22px; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-logo img { max-width: 22px; max-height: 22px; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-mname {
	min-width: 0;
	padding: 0;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: normal;
	color: var(--cmx-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
/* 3. prix. Dans grid.php, la remise (.cmxshop-discount, badge du code promo
   compris) et l'ancien prix (.cmxshop-old-price, prix catalogue) sont DANS
   .cmxshop-price : le span devient une colonne, remise au-dessus, montant,
   ancien prix barré dessous. Aucune règle ne dépend de .cmxshop-small, qui
   n'est posée que si l'option merge_price est active. */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-details {
	flex: 0 0 auto;
	padding: 0;
	text-align: right !important;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-price {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	margin: 0;
	padding: 0;
	background: transparent !important;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	opacity: 1;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--cmx-ink);
	font-variant-numeric: tabular-nums;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-price::after,
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-price svg { display: none; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-discount {
	order: -1;
	position: static;
	display: inline-block;
	width: auto;
	margin: 0 0 3px;
	line-height: 1.3;
	padding: 1px 5px;
	border-radius: 3px;
	transform: skew(-8deg);
	box-shadow: none;
	font-size: 10px;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-old-price {
	order: 1;
	display: block;
	position: static;
	width: auto;
	margin-top: 1px;
	font-size: 10.5px;
	line-height: 1.1;
	text-align: right;
	color: #999;
}
/* 4. bouton */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-btn {
	display: block;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-button {
	display: block;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--cmx-accent) !important;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .01em;
	text-shadow: none;
	white-space: nowrap;
	transition: filter .15s ease;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-button::after { display: none; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-button:hover { opacity: 1; box-shadow: none; filter: brightness(1.12); }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-offer:hover .cmxshop-button { filter: brightness(1.12); }
/* code promo ou ODR d'un marchand (Cmx_Promo::ligne, après le </a> de l'offre) :
   déclencheur aligné sous le nom du marchand ; le popover est déplacé dans <body>
   par script.js à l'ouverture, il échappe donc à l'overflow de la carte */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-offer .cmxshop-promo-ligne { padding: 5px 0 0 30px; margin: 0; line-height: 1; }
/* opération « tous marchands » (Cmx_Promo::bandeau, en tête de .cmxshop-footer) */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo {
	gap: 4px 8px;
	margin: 8px 0 2px;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	font-size: 12.5px;
	line-height: 1.35;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo * { line-height: 1.35; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo-type { font-size: 10px; letter-spacing: .02em; white-space: nowrap; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo-val { font-size: 13.5px; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo-code { font-size: 12px; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo-fin,
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo-cond { font-size: 11.5px; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-promo + .cmxshop-offer { border-top: 0; }
/* bouton « voir plus » (au-delà de max_merch) */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-offer.more_btn {
	padding: 7px 4px 0;
	background: none;
	font-size: 12.5px;
	font-weight: 600;
	text-align: center;
	color: var(--cmx-muted);
	line-height: 1.2;
}

/* --- Meilleure offre : même ligne, bordure couleur du CTA, pastille posée sur le bord --- */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer) {
	position: relative;
	margin: 6px 0 4px;
	padding: 10px;
	border: 1px solid var(--cmx-accent);
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer):hover { background: rgba(255, 255, 255, .6); }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer):has(~ .cmxshop-offer) { margin-top: 14px; padding-top: 13px; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer):has(~ .cmxshop-offer)::before {
	content: "Meilleur prix";
	position: absolute;
	top: -8px;
	left: 10px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--cmx-label);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer) .cmxshop-mname { font-weight: 700; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer) .cmxshop-price { font-size: 15px; font-weight: 700; color: var(--cmx-price); }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer) .cmxshop-promo-ligne { padding-left: 30px; }
/* Garde-fou : le plugin trie sur le prix catalogue, avant application des codes
   promo. Si une offre suivante porte un code promo, elle peut devenir moins chère
   que la première : on retire alors la mention « Meilleur prix » et la bordure
   d'accent, pour ne jamais désigner la mauvaise offre. */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer):has(~ .cmxshop-offer .cmxshop-promo-ligne-code) { border-color: var(--cmx-line); }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer):has(~ .cmxshop-offer .cmxshop-promo-ligne-code)::before { content: none; }
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer):has(~ .cmxshop-offer .cmxshop-promo-ligne-code) .cmxshop-price { color: var(--cmx-ink); }

/* --- Carte étroite : nom masqué visuellement, logo seul --- */
@container cmxoffres (max-width: 299px) {
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-merchant { flex: 1 1 auto; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-mname {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-offer .cmxshop-promo-ligne,
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer) .cmxshop-promo-ligne { padding-left: 0; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-wrap { gap: 5px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer) { padding-left: 8px; padding-right: 8px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-button { padding: 6px 7px; font-size: 12px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-logo { flex-basis: 20px; width: 20px; height: 20px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-logo img { max-width: 20px; max-height: 20px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-merchant { min-width: 20px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer { padding-left: 8px; padding-right: 8px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-price { font-size: 13.5px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-footer > .cmxshop-offer:not(.cmxshop-offer ~ .cmxshop-offer) .cmxshop-price { font-size: 14px; }
}

/* --- Sections neuf / reconditionné et promos, alignées sur la carte --- */
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-section {
	margin: 6px 0 0;
	padding: 6px 4px 2px;
	border-top: 0;
	background: none;
}
.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-section + .cmxshop-offer { border-top: 1px solid var(--cmx-line); }

/* --- Mobile : cartes horizontales, une par ligne --- */
@media only screen and (max-width: 560px) {
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-list { grid-template-columns: 1fr; gap: 12px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item { min-width: 0; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item:hover { transform: none; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-item .cmxshop-header a {
		display: flex !important;
		align-items: center;
	}
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-image {
		flex: 0 0 96px;
		width: 96px;
		height: 116px;
	}
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-image img { padding: 8px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-content { padding: 10px 14px; }
	.cmxshop.cmxshop-grid:not(.afx-carousel-wrap, .afx-sst) .cmxshop-title {
		height: auto;
		max-height: 3.9em;
		-webkit-line-clamp: 3;
		text-align: left;
	}
}

/* ==========================================================================
   Réglages par site : à coller dans le champ « Custom CSS » du plugin.
   --cmx-accent reprend déjà la couleur du plugin : inutile de la redéfinir.
   ========================================================================== */

/* cavexcellence.com : bordeaux, or, Playfair Display
.cmxshop.cmxshop-grid {
	--cmx-price: #7f1418;
	--cmx-line: #ece5d8;
	--cmx-soft: #faf7f2;
	--cmx-footer: #f7f2ea;
	--cmx-label: #8a7550;
	--cmx-title-font: "Playfair Display", Georgia, serif;
}
*/

/* cuisine-encastrable.com : orange, anthracite, KoHo
.cmxshop.cmxshop-grid {
	--cmx-price: #212529;
	--cmx-line: #e9ecef;
	--cmx-soft: #f8f9fa;
	--cmx-footer: #f3f4f6;
	--cmx-label: #a35400;
	--cmx-title-font: KoHo, system-ui, sans-serif;
}
*/
