/*
 * Good Act 2 — bas de la fiche produit en sections empilées (inc/product-sections.php).
 * Chargé seulement sur les fiches produits quand les sections sont actives.
 */

.s-product-bottom:has(.gb-sections) {
	padding-top: 0;
	background: #f7f4ec;
}

.gb-sections {
	--gb-cream: #f7f4ec;
	--gb-line: #e4dfd2;
	--gb-line-soft: #efebe1;
	--gb-green: #1f5c45;
	--gb-green-dark: #123a2b;
	--gb-mint: #e6f4ee;
	--gb-yellow: #e9c93a;
	--gb-muted: #5f5b52;
	--gb-text: #3d3a33;
	--gb-top: 0px; /* hauteur de l'en-tête fixe éventuel, tenue à jour par le script */
	padding-bottom: 64px;
	font-family: Rubik, Arial, sans-serif;
	color: #111;
}

/* Remises à zéro de faible priorité (:where), pour ne pas l'emporter sur les règles des composants plus bas. */
.gb-sections :where(ul, dl) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gb-sections :where(li) {
	margin: 0;
}

.gb-sections :where(li)::before {
	content: none;
}

.gb-sections a:not(.gb-pill):not(.gb-nav__link) {
	color: var(--gb-green);
}

.gb-sections a:not(.gb-pill):not(.gb-nav__link):hover {
	color: var(--gb-green-dark);
}

/* ---------- Sommaire ---------- */

.gb-nav {
	position: sticky;
	top: var(--gb-top);
	z-index: 50;
	margin: 0 0 48px;
	background: var(--gb-cream);
	border-bottom: 1px solid var(--gb-line);
}

.gb-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 28px;
	min-height: 56px;
}

.gb-nav__link {
	display: block;
	padding: 16px 0 13px;
	border-bottom: 3px solid transparent;
	font-size: 15px;
	line-height: 1.6;
	color: var(--gb-text);
	text-decoration: none;
}

.gb-nav__link:hover {
	color: #111;
}

.gb-nav__link.is-active,
.gb-nav__link[aria-current="true"] {
	color: #111;
	font-weight: 500;
	border-bottom-color: var(--gb-yellow);
}

.gb-nav__short {
	display: none;
}

/* ---------- Sections ---------- */

.gb-sections__list {
	display: flex;
	flex-direction: column;
	gap: 56px;
}

.gb-section {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 40px;
	scroll-margin-top: calc(var(--gb-top) + 80px);
}

.gb-sections .gb-section__title {
	margin: 0 0 8px;
	padding: 0;
	font-family: 'DM Serif Display', serif;
	font-weight: 400;
	font-size: 32px;
	line-height: 1.15;
	letter-spacing: 0;
	text-transform: none;
	color: #111;
}

.gb-section__lead {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--gb-muted);
}

.gb-section__body {
	min-width: 0;
}

/* Caractéristiques */

.gb-specs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 40px;
	padding: 8px 28px;
	background: #fff;
	border-radius: 20px;
	font-size: 15px;
}

.gb-specs__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--gb-line-soft);
}

/* Pas de trait sous la dernière ligne de chaque colonne. */
.gb-specs__row:last-child,
.gb-specs__row:nth-last-child(2):nth-child(odd) {
	border-bottom: 0;
}

.gb-specs dt {
	color: var(--gb-muted);
	font-weight: 400;
}

.gb-specs dd {
	margin: 0;
	text-align: right;
}

/* Certifications et impact (contenu de l'extension « Certifications et impact ») */

.gb-sections .ga-cert {
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
}

.gb-sections .ga-cert__list {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.gb-sections .ga-cert__item {
	flex-direction: column;
	gap: 12px;
	padding: 24px !important;
	border: 0;
	border-radius: 20px;
	background: #fff;
}

.gb-sections .ga-cert__item--co2 {
	background: var(--gb-mint);
}

.gb-sections .ga-cert__logo {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: #f4f4f4;
}

.gb-sections .ga-cert__logo img {
	width: 48px;
	height: 48px;
}

.gb-sections .ga-cert__item--co2 .ga-cert__logo {
	background: #fff;
}

.gb-sections .ga-cert__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 6px;
}

.gb-sections .ga-cert__body p {
	margin: 0 !important;
}

.gb-sections .ga-cert__name {
	font-size: 16px;
	line-height: 1.35;
}

.gb-sections .ga-cert__text {
	line-height: 1.5;
	color: var(--gb-text);
}

.gb-sections .ga-cert__tag {
	border-color: var(--gb-green);
	color: var(--gb-green);
}

.gb-sections .ga-cert__dl {
	margin-top: auto !important;
	padding-top: 6px;
}

.gb-sections .ga-cert__dl a {
	color: var(--gb-green);
}

.gb-sections .ga-cert__rse {
	margin: 20px 0 0 !important;
	padding: 0;
	border: 0;
	font-size: 15px;
}

.gb-sections .ga-cert__empty {
	padding: 24px 28px;
	background: #fff;
	border-radius: 20px;
}

/* Documents (contenu de l'extension « Certifications et impact ») */

.gb-sections .ga-docs {
	max-width: none;
	margin: 0 !important;
	border: 0;
	border-radius: 20px;
	background: #fff;
}

.gb-sections .ga-docs__item {
	border-top-color: var(--gb-line-soft);
}

.gb-sections .ga-docs__link {
	padding: 18px 24px;
}

.gb-sections a.ga-docs__link:hover {
	background: #fbfaf6;
}

.gb-sections .ga-docs__icon,
.gb-sections .ga-docs__dl {
	color: var(--gb-green);
}

.gb-sections .ga-docs__text,
.gb-sections .ga-docs__meta {
	color: var(--gb-muted);
}

/* Description */

.gb-desc {
	padding: 32px;
	background: #fff;
	border-radius: 20px;
}

.gb-desc__text {
	position: relative;
	font-size: 15px;
	line-height: 1.7;
	color: var(--gb-text);
}

.gb-desc__text > :first-child {
	margin-top: 0;
}

.gb-desc__text > :last-child {
	margin-bottom: 0;
}

/* Le thème parent remet toutes les marges à zéro : on redonne au texte un rythme de lecture. */
.gb-desc__text p,
.gb-desc__text ul,
.gb-desc__text ol,
.gb-desc__text blockquote,
.gb-desc__text table {
	margin: 0 0 14px;
}

.gb-desc__text ul,
.gb-desc__text ol {
	padding-left: 22px;
}

.gb-desc__text ul {
	list-style: disc;
}

.gb-desc__text ol {
	list-style: decimal;
}

.gb-desc__text li {
	margin: 0 0 6px;
}

.gb-desc__text li::before {
	content: none;
}

.gb-desc__text h2,
.gb-desc__text h3,
.gb-desc__text h4 {
	margin: 32px 0 12px;
	font-family: 'DM Serif Display', serif;
	font-weight: 400;
	line-height: 1.25;
	color: #111;
}

.gb-desc__text h2 {
	font-size: 26px;
}

.gb-desc__text h3 {
	font-size: 22px;
}

.gb-desc__text h4 {
	font-size: 18px;
}

.gb-desc__text strong,
.gb-desc__text b {
	font-weight: 600;
	color: #111;
}

.gb-desc__text a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.gb-desc.is-collapsed .gb-desc__text {
	max-height: 150px;
	overflow: hidden;
}

.gb-desc.is-collapsed .gb-desc__text::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 64px;
	background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}

.gb-sections .gb-desc__toggle {
	margin-top: 12px;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid #111;
	border-radius: 12px;
	background: #fff;
	color: #111;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	cursor: pointer;
}

.gb-sections .gb-desc__toggle:hover {
	background: #111;
	color: #fff;
}

/* Voir aussi */

.gb-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.gb-pill {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--gb-line);
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-size: 14px;
	text-decoration: none;
}

.gb-pill:hover {
	border-color: #111;
	color: #111;
}

.gb-pill--all {
	border-color: #111;
	background: #111;
	color: #fff;
}

.gb-pill--all:hover {
	background: var(--gb-green);
	border-color: var(--gb-green);
	color: #fff;
}

/* Clavier */

.gb-sections a:focus-visible,
.gb-sections button:focus-visible {
	outline: 2px solid var(--gb-green);
	outline-offset: 3px;
}

/* ---------- Tablette ---------- */

@media (max-width: 1024px) {
	.gb-section {
		grid-template-columns: 220px minmax(0, 1fr);
		gap: 28px;
	}

	.gb-specs {
		grid-template-columns: minmax(0, 1fr);
	}

	.gb-specs__row:nth-last-child(2):nth-child(odd) {
		border-bottom: 1px solid var(--gb-line-soft);
	}
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
	.gb-sections {
		padding-bottom: 40px;
	}

	.gb-nav {
		margin: 0 calc(50% - 50vw) 28px; /* pleine largeur d'écran, malgré les marges de la page */
	}

	/* Sommaire en pastilles défilantes, sans barre de défilement, avec un fondu à droite. */
	.gb-nav::after {
		content: "";
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: 40px;
		pointer-events: none;
		background: linear-gradient(90deg, rgba(247, 244, 236, 0), var(--gb-cream));
	}

	.gb-nav__scroll {
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.gb-nav__scroll::-webkit-scrollbar {
		display: none;
	}

	.gb-nav__list {
		flex-wrap: nowrap;
		gap: 8px;
		width: max-content;
		min-height: 0;
		padding: 10px 40px 10px 16px;
	}

	.gb-nav__link {
		display: inline-flex;
		align-items: center;
		min-height: 40px;
		padding: 0 14px;
		border: 1px solid var(--gb-line);
		border-radius: 999px;
		background: #fff;
		font-size: 14px;
		color: #111;
		white-space: nowrap;
	}

	.gb-nav__link.is-active,
	.gb-nav__link[aria-current="true"] {
		border-color: #111;
		background: #111;
		color: #fff;
		font-weight: 400;
	}

	.gb-nav__long {
		display: none;
	}

	.gb-nav__short {
		display: inline;
	}

	.gb-sections__list {
		gap: 40px;
	}

	.gb-section {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
		scroll-margin-top: calc(var(--gb-top) + 72px);
	}

	.gb-sections .gb-section__title {
		margin-bottom: 4px;
		font-size: 26px;
	}

	.gb-section__lead {
		font-size: 14px;
	}

	.gb-specs {
		padding: 4px 18px;
		font-size: 14px;
	}

	.gb-specs__row {
		padding: 13px 0;
	}

	.gb-sections .ga-cert__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.gb-sections .ga-cert__item {
		flex-direction: row;
		padding: 18px !important;
	}

	.gb-sections .ga-docs__link {
		padding: 14px 18px;
	}

	.gb-desc {
		padding: 22px 18px;
	}

	.gb-desc__text h2 {
		font-size: 22px;
	}

	.gb-desc__text h3 {
		font-size: 20px;
	}

	.gb-desc__text h2,
	.gb-desc__text h3,
	.gb-desc__text h4 {
		margin-top: 26px;
	}

	.gb-desc.is-collapsed .gb-desc__text {
		max-height: 180px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	html:has(.gb-sections) {
		scroll-behavior: smooth;
	}
}
