/*
 * Smilemood – Avis clients pour WooCommerce : bloc d'avis.
 * Langage repris de la fiche de l'annuaire Smilemood (carte blanche, note en grand, barres de répartition,
 * avis séparés par un filet, réponse en retrait reliée par un coude). Toutes les classes portent le préfixe
 * « sma- » et la police est celle du thème de la boutique. Les règles partent de « .sma[data-sma] » pour passer
 * devant les règles de contenu des thèmes (liens soulignés, marges de listes) sans recourir à !important.
 */

.sma {
	--sma-accent: #5b4bc4;
	--sma-accent-texte: #5b4bc4;
	--sma-etoile: #f5b400;
	--sma-rayon: 22px;
	--sma-rayon-bouton: 10px;
	--sma-rayon-puce: 22px;
	--sma-rayon-photo: 8px;
	--sma-encre: #1c1c45;
	--sma-texte: #2b2b3a;
	--sma-gris: #5e5e6e;
	--sma-trait: #ececf2;
	--sma-bord: #cfcbe6;
	--sma-vide: #d9d8e3;
	--sma-vert: #1e6b3a;
	--sma-vert-pale: #e3f5e9;
	--sma-pale: #f3f2f8;
	--sma-ease: cubic-bezier(.23, 1, .32, 1);
	container-type: inline-size;
	container-name: sma;
	position: relative;
	display: block;
	clear: both;
	margin: 0 0 24px;
	font-size: 16px;
	line-height: 1.5;
	text-align: start;
	-webkit-text-size-adjust: 100%;
}

@supports (color: color-mix(in srgb, red, blue)) {
	.sma { --sma-pale: color-mix(in srgb, var(--sma-accent) 9%, #fff); }
}

.sma[data-sma] *,
.sma[data-sma] *::before,
.sma[data-sma] *::after { box-sizing: border-box; }

.sma[data-sma] ::selection { background: var(--sma-pale); color: var(--sma-encre); }

/* Repère « #reviews » : c'est lui que visent le lien du thème sous le titre et la pagination sans script. */
.sma[data-sma] .sma-repere { position: absolute; top: 0; width: 0; height: 0; scroll-margin-top: 120px; }

.sma[data-sma] .sma-lecteur {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sma[data-sma] .sma-carte {
	padding: 26px;
	color: var(--sma-texte);
	background: #fff;
	border-radius: var(--sma-rayon);
	box-shadow: 0 0 15px rgba(0, 0, 0, .08);
}

.sma[data-sma] .sma-titre {
	margin: 0 0 14px;
	padding: 0;
	color: var(--sma-encre);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	text-wrap: balance;
}

.sma[data-sma] p { margin: 0; padding: 0; }

.sma[data-sma] a:focus-visible,

.sma[data-sma] .sma-liste:focus-visible {
	outline: 2px solid var(--sma-accent-texte);
	outline-offset: 2px;
}

.sma[data-sma] .sma-liste:focus { outline: 0; }

/* Synthèse : note moyenne, nombre d'avis, répartition. */
.sma[data-sma] .sma-tete {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 28px;
	align-items: center;
	margin: 0 0 18px;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--sma-trait);
}

.sma[data-sma] .sma-chiffre {
	margin: 0 0 6px;
	color: var(--sma-encre);
	font-size: 52px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.03em;
	font-variant-numeric: tabular-nums;
}

.sma[data-sma] .sma-chiffre small {
	color: var(--sma-gris);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0;
}

.sma[data-sma] .sma-compte { margin: 6px 0 0; color: var(--sma-gris); font-size: 14px; }

.sma[data-sma] .sma-etoiles {
	position: relative;
	display: inline-flex;
	flex: none;
	vertical-align: middle;
	line-height: 0;
}

.sma[data-sma] .sma-etoiles-fond,
.sma[data-sma] .sma-etoiles-plein { display: inline-flex; gap: 3px; flex: none; }

.sma[data-sma] .sma-etoiles-fond { color: var(--sma-vide); }

.sma[data-sma] .sma-etoiles-plein {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	overflow: hidden;
	color: var(--sma-etoile);
}

.sma[data-sma] .sma-etoiles svg,
.sma[data-sma] .sma-repartition-note svg {
	display: block;
	flex: none;
	width: var(--sma-t, 18px);
	height: var(--sma-t, 18px);
	max-width: none;
	fill: currentColor;
}

.sma[data-sma] .sma-repartition {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sma[data-sma] .sma-repartition li {
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) 40px;
	gap: 10px;
	align-items: center;
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.3;
	list-style: none;
}

.sma[data-sma] .sma-repartition li::before,
.sma[data-sma] .sma-photos li::before { content: none; }

.sma[data-sma] .sma-repartition-note {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	color: var(--sma-gris);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.sma[data-sma] .sma-repartition-note svg { --sma-t: 13px; color: var(--sma-etoile); }

.sma[data-sma] .sma-barre {
	display: block;
	height: 10px;
	overflow: hidden;
	background: #edebf5;
	border-radius: 5px;
}

.sma[data-sma] .sma-barre span {
	display: block;
	height: 100%;
	background: var(--sma-accent);
	border-radius: 5px;
}

.sma[data-sma] .sma-repartition-nombre {
	color: var(--sma-encre);
	font-weight: 700;
	text-align: end;
	font-variant-numeric: tabular-nums;
}

/* Tri : des puces, comme les filtres de l'annuaire. Aucun tri ne retire d'avis. */
.sma[data-sma] .sma-tri {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
}

.sma[data-sma] .sma-tri a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	color: var(--sma-encre);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--sma-bord);
	border-radius: var(--sma-rayon-puce);
	box-shadow: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--sma-ease);
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

.sma[data-sma] .sma-tri a[aria-current] {
	color: #fff;
	background: var(--sma-encre);
	border-color: var(--sma-encre);
}

.sma[data-sma] .sma-tri a:active,
.sma[data-sma] .sma-bouton:active,
.sma[data-sma] .sma-photo:active { transform: scale(.97); }

/* Liste des avis. */
.sma[data-sma] .sma-zone { transition: opacity .15s ease; }
.sma[data-sma] .sma-zone[aria-busy="true"] { opacity: .55; }

.sma[data-sma] .sma-liste { display: flex; flex-direction: column; }

.sma[data-sma] .sma-avis {
	position: relative;
	margin: 0;
	padding: 18px 0;
	border-top: 1px solid var(--sma-trait);
}

.sma[data-sma] .sma-avis:first-child { padding-top: 0; border-top: 0; }

.sma[data-sma] .sma-sujet {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	min-height: 44px;
	margin: 0 0 8px;
	color: var(--sma-encre);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.sma[data-sma] a.sma-sujet span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.sma[data-sma] .sma-sujet img {
	width: 40px;
	height: 40px;
	margin: 0;
	object-fit: cover;
	border-radius: var(--sma-rayon-photo);
}

.sma[data-sma] .sma-sujet svg {
	width: 40px;
	height: 40px;
	padding: 9px;
	color: var(--sma-accent-texte);
	background: var(--sma-pale);
	border-radius: var(--sma-rayon-photo);
}

.sma[data-sma] .sma-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	align-items: center;
	padding-inline-end: 150px;
}

.sma[data-sma] .sma-auteur { color: var(--sma-encre); font-size: 15px; font-weight: 700; }

.sma[data-sma] .sma-verifie {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	padding: 3px 10px 3px 8px;
	color: var(--sma-vert);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	background: var(--sma-vert-pale);
	border-radius: 14px;
}

.sma[data-sma] .sma-verifie svg { width: 14px; height: 14px; flex: none; }

/* Avis que la boutique avait avant Smilemood : pastille neutre, jamais la pastille verte de l'achat vérifié. */
.sma[data-sma] .sma-anterieur {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	color: var(--sma-gris);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	background: #f1f1f4;
	border-radius: 14px;
}

.sma[data-sma] .sma-compte-detail { display: block; }

.sma[data-sma] .sma-dates {
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	margin: 6px 0 0;
	color: var(--sma-gris);
	font-size: 14px;
	line-height: 1.5;
}

.sma[data-sma] .sma-dates span + span::before { content: "·"; margin-inline-end: 8px; }

.sma[data-sma] .sma-texte {
	max-width: 68ch;
	margin: 8px 0 0;
	color: var(--sma-texte);
	font-size: 16px;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

.sma[data-sma] .sma-sans-texte,
.sma[data-sma] .sma-masque { color: var(--sma-gris); font-style: italic; }

.sma[data-sma] .sma-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.sma[data-sma] .sma-photos li { margin: 0; padding: 0; list-style: none; }

.sma[data-sma] .sma-photo {
	display: block;
	overflow: hidden;
	background: var(--sma-pale);
	border-radius: var(--sma-rayon-photo);
	transition: transform .16s var(--sma-ease);
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
}

.sma[data-sma] .sma-photo img {
	display: block;
	width: 96px;
	height: 96px;
	max-width: none;
	margin: 0;
	padding: 0;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: transform .3s var(--sma-ease);
}

/* Réponse de la boutique : en retrait, reliée à l'avis par un coude, sans fond. */
.sma[data-sma] .sma-reponse {
	position: relative;
	margin: 14px 0 2px;
	margin-inline-start: 22px;
	padding: 0;
	padding-inline-start: 18px;
}

.sma[data-sma] .sma-reponse::before {
	content: "";
	position: absolute;
	top: -6px;
	inset-inline-start: 0;
	width: 12px;
	height: 22px;
	border: 0 solid var(--sma-bord);
	border-block-end-width: 2px;
	border-inline-start-width: 2px;
	border-end-start-radius: 8px;
}

.sma[data-sma] .sma-reponse-tete {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	align-items: center;
	margin: 0;
	color: var(--sma-gris);
	font-size: 14px;
}

.sma[data-sma] .sma-reponse-tete b { color: var(--sma-encre); font-weight: 700; }

.sma[data-sma] .sma-reponse-texte {
	max-width: 66ch;
	margin: 6px 0 0;
	font-size: 15px;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

/* « Signaler cet avis » : en haut à droite de l'avis quand la place le permet, sous l'avis sinon. */
.sma[data-sma] .sma-actions {
	position: absolute;
	top: 8px;
	inset-inline-end: 0;
	margin: 0;
}

.sma[data-sma] .sma-avis:first-child .sma-actions { top: -10px; }

.sma[data-sma] .sma-signaler {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--sma-gris);
	font-size: 14px;
	font-weight: 400;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	box-shadow: none;
}

/* Pagination et boutons d'action : 44 px de haut, 10 px de rayon. */
.sma[data-sma] .sma-pages {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin: 6px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--sma-trait);
}

.sma[data-sma] .sma-pages-ou {
	color: var(--sma-gris);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.sma[data-sma] .sma-pages .sma-bouton[rel~="next"] { margin-inline-start: auto; }

.sma[data-sma] .sma-bouton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	color: var(--sma-encre);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--sma-bord);
	border-radius: var(--sma-rayon-bouton);
	box-shadow: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--sma-ease);
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

.sma[data-sma] .sma-suite { margin: 4px 0 0; padding: 18px 0 0; border-top: 1px solid var(--sma-trait); }

/* Mentions : comment les avis sont collectés, par qui. */
.sma[data-sma] .sma-pied {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 12px;
	align-items: center;
	margin: 18px 0 0;
	padding: 16px 0 0;
	color: var(--sma-gris);
	font-size: 14px;
	line-height: 1.5;
	border-top: 1px solid var(--sma-trait);
}

.sma[data-sma] .sma-lien {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--sma-accent-texte);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	box-shadow: none;
}

.sma[data-sma] .sma-marque { margin-inline-start: auto; color: var(--sma-gris); }

/* Aucun avis. */
.sma[data-sma] .sma-vide {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 4px 0 2px;
}

.sma[data-sma] .sma-vide-rond {
	display: grid;
	flex: none;
	width: 44px;
	height: 44px;
	place-items: center;
	color: var(--sma-accent-texte);
	background: var(--sma-pale);
	border-radius: 50%;
}

.sma[data-sma] .sma-vide-rond svg { width: 22px; height: 22px; }
.sma[data-sma] .sma-vide-titre { margin: 0; color: var(--sma-encre); font-size: 16px; font-weight: 700; }
.sma[data-sma] .sma-vide-texte { max-width: 60ch; margin: 2px 0 0; color: var(--sma-gris); font-size: 15px; }

/* Survol : seulement avec une souris. */
@media (hover: hover) and (pointer: fine) {
	.sma[data-sma] .sma-tri a:not([aria-current]):hover,
	.sma[data-sma] .sma-bouton:hover {
		color: var(--sma-accent-texte);
		background: var(--sma-pale);
		border-color: var(--sma-accent-texte);
	}
	.sma[data-sma] .sma-photo:hover img { transform: scale(1.04); }
	.sma[data-sma] .sma-signaler:hover { color: var(--sma-encre); }
	.sma[data-sma] .sma-lien:hover,
	.sma[data-sma] a.sma-sujet:hover span { text-decoration-thickness: 2px; }
}

/* Bloc étroit : téléphone, ou colonne étroite d'un thème. */
@container sma (max-width: 560px) {
	.sma[data-sma] .sma-carte { padding: 20px 16px; }
	.sma[data-sma] .sma-tete { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.sma[data-sma] .sma-moyenne { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
	.sma[data-sma] .sma-chiffre { grid-row: span 2; margin: 0; }
	.sma[data-sma] .sma-compte { margin: 2px 0 0; }
	.sma[data-sma] .sma-reponse { margin-inline-start: 10px; }
	.sma[data-sma] .sma-meta { padding-inline-end: 0; }
	.sma[data-sma] .sma-actions,
	.sma[data-sma] .sma-avis:first-child .sma-actions { position: static; margin: 4px 0 -12px; }
	.sma[data-sma] .sma-dates { flex-direction: column; }
	.sma[data-sma] .sma-dates span + span::before { content: none; }
	.sma[data-sma] .sma-photo img { width: 80px; height: 80px; }
	.sma[data-sma] .sma-marque { margin-inline-start: 0; }
	.sma[data-sma] .sma-pages { justify-content: center; }
	.sma[data-sma] .sma-pages-ou { order: -1; flex-basis: 100%; text-align: center; }
	.sma[data-sma] .sma-pages .sma-bouton { flex: 1 1 0; padding: 0 12px; }
	.sma[data-sma] .sma-pages .sma-bouton[rel~="next"] { margin-inline-start: 0; }
}

/* Visionneuse de photos (ajoutée par le script ; sans script, la photo s'ouvre dans l'onglet). */
.sma-visionneuse {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	color: #fff;
	font-size: 16px;
	line-height: 1.5;
	background: #0e0d1f;
	border: 0;
	overflow: hidden;
	overscroll-behavior: contain;
}

.sma-visionneuse::backdrop { background: #0e0d1f; }

.sma-visionneuse[open] {
	display: flex;
	flex-direction: column;
	animation: sma-apparition .2s ease;
}

@keyframes sma-apparition {
	from { opacity: 0; }
	to { opacity: 1; }
}

.sma-visionneuse *,
.sma-visionneuse *::before,
.sma-visionneuse *::after { box-sizing: border-box; }

.sma-visionneuse .sma-v-haut {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	padding-top: calc(12px + env(safe-area-inset-top, 0px));
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.sma-visionneuse figure {
	display: grid;
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 0 72px calc(24px + env(safe-area-inset-bottom, 0px));
	place-items: center;
	touch-action: pan-y;
}

.sma-visionneuse figure img {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 150px);
	margin: 0 auto;
	object-fit: contain;
	border-radius: 8px;
}

.sma-visionneuse figcaption {
	margin: 10px 0 0;
	color: #cfcde6;
	font-size: 14px;
	text-align: center;
}

.sma-visionneuse button {
	display: grid;
	flex: none;
	margin: 0;
	padding: 0;
	place-items: center;
	color: #fff;
	font: inherit;
	background: rgba(255, 255, 255, .12);
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, transform .16s cubic-bezier(.23, 1, .32, 1);
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

.sma-visionneuse button:active { transform: scale(.94); }
.sma-visionneuse button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sma-visionneuse button svg { width: 22px; height: 22px; }
.sma-visionneuse .sma-v-fermer { width: 44px; height: 44px; }

.sma-visionneuse .sma-v-fleche {
	position: absolute;
	top: 50%;
	width: 52px;
	height: 52px;
	margin-top: -26px;
}

.sma-visionneuse .sma-v-fleche[hidden] { display: none; }
.sma-visionneuse .sma-v-precedente { left: 12px; }
.sma-visionneuse .sma-v-suivante { right: 12px; }

@media (hover: hover) and (pointer: fine) {
	.sma-visionneuse button:hover { background: rgba(255, 255, 255, .22); }
}

@media (max-width: 700px) {
	.sma-visionneuse figure { padding-inline: 8px; }
	.sma-visionneuse .sma-v-fleche { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); margin-top: 0; }
	.sma-visionneuse figure { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
	.sma-visionneuse figure img { max-height: calc(100dvh - 220px); }
}

/* Mouvement réduit : plus de déplacement ni de zoom, les fondus restent. */
@media (prefers-reduced-motion: reduce) {
	.sma[data-sma] .sma-tri a,
	.sma[data-sma] .sma-bouton,
	.sma[data-sma] .sma-photo,
	.sma[data-sma] .sma-photo img,
	.sma-visionneuse button { transition: background-color .15s ease, border-color .15s ease, color .15s ease; transform: none !important; }
	.sma-visionneuse[open] { animation: none; }
}

/* Impression : la carte perd son ombre, les liens d'action disparaissent. */
@media print {
	.sma[data-sma] .sma-carte { box-shadow: none; border: 1px solid var(--sma-trait); }
	.sma[data-sma] .sma-tri,
	.sma[data-sma] .sma-pages,
	.sma[data-sma] .sma-actions { display: none; }
}
