/**
 * Catalogue produits — porté du prototype validé (catalogue.html, variante
 * « Catalogue visuel »).
 *
 * Toutes les classes sont préfixées gmCat pour ne pas entrer en collision avec
 * le thème parent CliniQ (.hero, .container… y existent déjà). Les couleurs
 * par univers sont indexées sur les slugs des catégories produit WooCommerce
 * (product_cat de premier niveau) : ajuster les sélecteurs [data-univers="…"]
 * ci-dessous aux slugs réels du site ; sans correspondance, un univers reste
 * simplement bleu (teinte par défaut).
 */

.gmCatalogue,
.gmCatDrawer {
	--gmcat-navy: #071126;
	--gmcat-blue: #2364b0;
	--gmcat-ink: #111827;
	--gmcat-muted: #667085;
	--gmcat-line: #e6eaf0;
	--gmcat-radius: 16px;
	--gmcat-shadow: 0 16px 44px rgba(12, 24, 48, .08);
	color: var(--gmcat-ink);
}

.gmCatalogue *,
.gmCatDrawer * {
	box-sizing: border-box;
}

.gmCatalogue .hidden {
	display: none !important;
}

/* Filet : certains thèmes ne définissent pas cette classe côté front. */
.gmCatalogue .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---- Hero (sous le bandeau boutique `.bt-blog-header-content` du parent) --- */

.gmCatHero {
	padding: 28px 0 34px;
}

.gmCatEyebrow {
	margin: 0;
	color: var(--gmcat-blue);
	font-size: 12px;
	font-weight: 850;
	text-transform: uppercase;
	letter-spacing: .08em;
}

.gmCatTitle {
	font-size: clamp(38px, 4vw, 62px);
	line-height: 1.02;
	letter-spacing: -2.2px;
	margin: 10px 0 16px;
	max-width: 820px;
	color: var(--gmcat-ink);
}

.gmCatIntro {
	font-size: 17px;
	line-height: 1.65;
	color: var(--gmcat-muted);
	max-width: 760px;
	margin: 0;
}

/* ---- Bande de filtres par univers --------------------------------------- */

.gmCatStrip {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	border: 1px solid var(--gmcat-line);
	border-radius: var(--gmcat-radius);
	overflow: hidden;
	margin: 4px 0 20px;
	background: #fff;
}

.gmCatStat {
	appearance: none;
	width: 100%;
	border: 0;
	border-right: 1px solid var(--gmcat-line);
	border-radius: 0;
	background: #fff;
	padding: 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	text-align: left;
	cursor: pointer;
	position: relative;
	transition: background .18s, color .18s, box-shadow .18s;
}

.gmCatStat:last-child {
	border-right: 0;
}

.gmCatStat:hover {
	background: #f8fbff;
}

.gmCatStat:focus-visible {
	outline: 3px solid rgba(35, 100, 176, .2);
	outline-offset: -3px;
}

.gmCatStat.active {
	background: #f1f7fd;
	box-shadow: inset 0 -3px 0 var(--gmcat-blue);
}

.gmCatStat.active b {
	color: #174f8d;
}

.gmCatDot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--gmcat-blue);
	flex: 0 0 auto;
}

.gmCatStat[data-univers="anesthesie-reanimation"] .gmCatDot {
	background: #2364b0;
}

.gmCatStat[data-univers="douleur-confort"] .gmCatDot,
.gmCatStat[data-univers="gestion-de-la-douleur-et-du-confort-patient"] .gmCatDot {
	background: #3f8c83;
}

.gmCatStat[data-univers="chirurgie-oncologique"] .gmCatDot {
	background: #8b5eae;
}

.gmCatStat[data-univers="testeurs-biomedicaux"] .gmCatDot {
	background: #ca7d2a;
}

.gmCatStatText b {
	display: block;
	font-size: 12px;
	color: var(--gmcat-ink);
}

.gmCatStatText span {
	font-size: 10px;
	color: #8a94a4;
}

.gmCatCount {
	margin-left: auto;
	font-size: 10px;
	font-weight: 800;
	color: var(--gmcat-muted);
	background: #f1f4f7;
	border-radius: 999px;
	padding: 4px 7px;
}

.gmCatStat.active .gmCatCount {
	background: #fff;
	color: #174f8d;
}

/* ---- Recherche et outils ------------------------------------------------- */

.gmCatTools {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 18px 0 24px;
}

.gmCatSearch {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid #d9dee7;
	background: #fff;
	border-radius: 12px;
	padding: 0 15px;
	height: 46px;
	margin: 0;
}

.gmCatSearch:focus-within {
	border-color: #97b7dd;
	box-shadow: 0 0 0 4px rgba(35, 100, 176, .08);
}

.gmCatSearch input,
.gmCatSearch input[type="search"] {
	border: 0;
	outline: 0;
	min-width: 0;
	flex: 1;
	color: #1d2939;
	background: transparent;
	font: inherit;
	height: auto;
	padding: 0;
	box-shadow: none;
}

.gmCatSearchIcon {
	color: var(--gmcat-muted);
}

.gmCatReset {
	display: none;
	border: 1px solid #dfe3ea;
	background: #fff;
	border-radius: 999px;
	padding: 9px 12px;
	font-size: 11px;
	font-weight: 750;
	color: #475467;
	cursor: pointer;
	white-space: nowrap;
}

.gmCatReset.visible {
	display: inline-flex;
}

.gmCatResultCount {
	font-size: 11px;
	color: #7c8797;
	white-space: nowrap;
}

/* ---- Grille de cartes ---------------------------------------------------- */

.gmCatGrid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	padding-bottom: 78px;
}

.gmCatCard {
	border: 1px solid var(--gmcat-line);
	border-radius: 15px;
	background: #fff;
	overflow: hidden;
	transition: .2s;
	cursor: pointer;
	min-height: 255px;
	display: flex;
	flex-direction: column;
}

.gmCatCard:hover,
.gmCatCard:focus-visible {
	transform: translateY(-3px);
	box-shadow: var(--gmcat-shadow);
	border-color: #d8dee8;
}

.gmCatThumb {
	aspect-ratio: 16 / 10;
	min-height: 154px;
	background: #fff;
	border-bottom: 1px solid var(--gmcat-line);
	position: relative;
	overflow: hidden;
	display: grid;
	place-items: center;
	padding: 14px 16px;
}

.gmCatImage {
	width: 92%;
	height: 92%;
	max-width: 220px;
	max-height: 140px;
	object-fit: contain;
	object-position: center;
	display: block;
}

/* Produit sans visuel : l'initiale sur un disque discret, en attendant
   l'image mise en avant. */
.gmCatThumbFallback {
	width: 74px;
	height: 74px;
	border-radius: 50%;
	background: #e7eefc;
	color: #174f8d;
	display: grid;
	place-items: center;
	font-size: 30px;
	font-weight: 800;
}

.gmCatThumb[data-univers="anesthesie-reanimation"] {
	--gmcat-univers-bg: #e7eefc;
	--gmcat-univers-ink: #174f8d;
	--gmcat-univers-line: #c5d9f2;
}

.gmCatThumb[data-univers="douleur-confort"],
.gmCatThumb[data-univers="gestion-de-la-douleur-et-du-confort-patient"] {
	--gmcat-univers-bg: #e3f1ef;
	--gmcat-univers-ink: #2c6b64;
	--gmcat-univers-line: #b8ddd8;
}

.gmCatThumb[data-univers="chirurgie-oncologique"] {
	--gmcat-univers-bg: #f0e8f7;
	--gmcat-univers-ink: #6b4587;
	--gmcat-univers-line: #dcc9eb;
}

.gmCatThumb[data-univers="testeurs-biomedicaux"] {
	--gmcat-univers-bg: #fdf1e0;
	--gmcat-univers-ink: #9a5e1d;
	--gmcat-univers-line: #f0d4a8;
}

.gmCatThumb[data-univers="anesthesie-reanimation"] .gmCatThumbFallback {
	background: var(--gmcat-univers-bg);
	color: var(--gmcat-univers-ink);
}

.gmCatThumb[data-univers="douleur-confort"] .gmCatThumbFallback,
.gmCatThumb[data-univers="gestion-de-la-douleur-et-du-confort-patient"] .gmCatThumbFallback {
	background: var(--gmcat-univers-bg);
	color: var(--gmcat-univers-ink);
}

.gmCatThumb[data-univers="chirurgie-oncologique"] .gmCatThumbFallback {
	background: var(--gmcat-univers-bg);
	color: var(--gmcat-univers-ink);
}

.gmCatThumb[data-univers="testeurs-biomedicaux"] .gmCatThumbFallback {
	background: var(--gmcat-univers-bg);
	color: var(--gmcat-univers-ink);
}

.gmCatTag {
	position: absolute;
	left: 10px;
	top: 10px;
	font-size: 9px;
	font-weight: 800;
	color: var(--gmcat-univers-ink, #174f8d);
	background: var(--gmcat-univers-bg, #e7eefc);
	border: 1px solid var(--gmcat-univers-line, #c5d9f2);
	border-radius: 999px;
	padding: 5px 7px;
	z-index: 2;
}

.gmCatBody {
	padding: 14px 15px 13px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.gmCatCardTitle {
	font-size: 14px;
	line-height: 1.25;
	margin: 0 0 7px;
	letter-spacing: -.15px;
	color: var(--gmcat-ink);
}

.gmCatCardRange {
	font-size: 10.5px;
	line-height: 1.4;
	color: #788392;
	margin: 0;
}

.gmCatCardLink {
	font-size: 10.5px;
	font-weight: 800;
	color: var(--gmcat-blue);
	margin-top: auto;
	padding-top: 10px;
}

.gmCatEmpty,
.gmCatNone {
	padding: 50px;
	text-align: center;
	color: #798494;
	border: 1px dashed #d5dbe4;
	border-radius: 14px;
	margin-bottom: 78px;
}

/* ---- Drawer d'aperçu ----------------------------------------------------- */

.gmCatDrawerBackdrop {
	position: fixed;
	top: var(--gmcat-drawer-top, 0px);
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(4, 10, 22, .36);
	z-index: 90;
	opacity: 0;
	pointer-events: none;
	transition: .2s;
}

.gmCatDrawerBackdrop.open {
	opacity: 1;
	pointer-events: auto;
}

.gmCatDrawer {
	position: fixed;
	right: 0;
	top: var(--gmcat-drawer-top, 0px);
	bottom: 0;
	width: min(430px, 92vw);
	background: #fff;
	/* Sous .mainHeader CliniQ (z-index ~10002) : le panneau démarre sous le menu. */
	z-index: 91;
	transform: translateX(100%);
	transition: .25s cubic-bezier(.2, .8, .2, 1);
	box-shadow: -20px 0 50px rgba(3, 10, 25, .15);
	display: flex;
	flex-direction: column;
}

.gmCatDrawer.open {
	transform: translateX(0);
}

.gmCatDrawerTop {
	padding: 10px 16px;
	min-height: 0;
	border-bottom: 1px solid var(--gmcat-line);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}

.gmCatDrawerTop span {
	font-size: 11px;
	line-height: 1.25;
	font-weight: 800;
	color: var(--gmcat-muted);
	text-transform: uppercase;
	letter-spacing: .05em;
}

.gmCatDrawerClose {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 1px solid var(--gmcat-line);
	background: #fff;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	color: var(--gmcat-ink);
	padding: 0;
}

.gmCatDrawerVisual {
	flex-shrink: 0;
	background: #fff;
	border-bottom: 1px solid var(--gmcat-line);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 20px;
}

/* Pas de width/height 100 % : CliniQ impose img { height: auto } et le combo
   « remplir la boîte » donne un cadrage type zoom. On borne seulement le max. */
.gmCatDrawer .gmCatDrawerImage {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: min(200px, 24vh);
	object-fit: contain;
	object-position: center;
}

.gmCatDrawerVisual img[src=""],
.gmCatDrawerVisual .gmCatThumbFallback {
	display: none;
}

.gmCatDrawerVisual.noimage img {
	display: none;
}

.gmCatDrawerVisual.noimage .gmCatThumbFallback {
	display: grid;
}

.gmCatDrawerBody {
	position: relative;
	z-index: 1;
	flex: 1;
	min-height: 0;
	padding: 22px 25px 25px;
	overflow: auto;
	background: #fff;
}

/* CliniQ impose font-size en em et un :after clearfix sur tous les h2 :
   le kicker et le titre de l'aperçu se chevauchent sinon. */
.gmCatDrawer h1,
.gmCatDrawer h2,
.gmCatDrawer h3,
.gmCatDrawer h4,
.gmCatDrawer h5,
.gmCatDrawer h6 {
	margin: 0;
	padding: 0;
	clear: none;
	font-weight: inherit;
	line-height: inherit;
}

.gmCatDrawer h1::after,
.gmCatDrawer h2::after,
.gmCatDrawer h3::after,
.gmCatDrawer h4::after,
.gmCatDrawer h5::after,
.gmCatDrawer h6::after {
	content: none;
	display: none;
}

.gmCatDrawerKicker {
	display: block;
	margin: 0 0 10px;
	font-size: 12px;
	line-height: 1.35;
	color: var(--gmcat-blue);
	font-weight: 850;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.gmCatDrawerName {
	display: block;
	font-size: 28px;
	line-height: 1.12;
	letter-spacing: -1px;
	margin: 0 0 14px;
	padding: 0;
	color: var(--gmcat-ink);
	font-weight: 800;
}

.gmCatDrawerDesc {
	font-size: 15px;
	color: #6b7686;
	line-height: 1.55;
	margin: 0;
}

.gmCatDrawerFacts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 9px;
	margin: 20px 0;
}

.gmCatFact {
	border: 1px solid var(--gmcat-line);
	border-radius: 10px;
	padding: 11px;
}

.gmCatFact small {
	display: block;
	font-size: 11px;
	color: #909aa7;
	margin-bottom: 5px;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.gmCatFact b {
	font-size: 13px;
	line-height: 1.35;
	color: var(--gmcat-ink);
}

.gmCatDrawerActions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.gmCatDrawer a.gmCatDrawerCta,
.gmCatDrawer a.gmCatDrawerSecondary {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 11px 12px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.3;
	font-weight: 800;
	text-decoration: none;
}

.gmCatDrawer a.gmCatDrawerCta {
	background: var(--gmcat-blue);
	color: #fff;
}

.gmCatDrawer a.gmCatDrawerCta:hover,
.gmCatDrawer a.gmCatDrawerCta:focus {
	background: #1658a4;
	color: #fff;
}

.gmCatDrawer a.gmCatDrawerSecondary {
	border: 1px solid #d9dfe8;
	font-weight: 750;
	color: #566273;
	background: #fff;
}

.gmCatDrawer a.gmCatDrawerSecondary:hover,
.gmCatDrawer a.gmCatDrawerSecondary:focus {
	color: var(--gmcat-ink);
	border-color: #b9c2d0;
}

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 1000px) {
	.gmCatGrid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 760px) {
	.gmCatHero {
		padding-top: 38px;
	}

	.gmCatTitle {
		font-size: 38px;
		letter-spacing: -1.3px;
	}

	.gmCatTools {
		align-items: stretch;
		flex-direction: column;
	}

	.gmCatStrip {
		grid-template-columns: 1fr 1fr;
	}

	.gmCatStat:nth-child(2) {
		border-right: 0;
	}

	.gmCatGrid {
		grid-template-columns: 1fr 1fr;
	}

	.gmCatDrawer .gmCatDrawerImage {
		max-height: min(168px, 20vh);
	}

	.gmCatDrawerVisual {
		padding: 12px 18px;
	}
}

@media (max-width: 520px) {
	.gmCatGrid {
		grid-template-columns: 1fr;
	}

	.gmCatStrip {
		grid-template-columns: 1fr;
	}

	.gmCatStat {
		border-right: 0;
		border-bottom: 1px solid var(--gmcat-line);
	}

	.gmCatStat:last-child {
		border-bottom: 0;
	}

	.gmCatCard {
		min-height: 180px;
	}

	.gmCatThumb {
		min-height: 112px;
	}

	.gmCatDrawer .gmCatDrawerImage {
		max-height: min(140px, 18vh);
	}

	.gmCatDrawerVisual {
		padding: 10px 16px;
	}

	.gmCatDrawerBody {
		padding: 16px 18px 20px;
	}

	.gmCatDrawerName {
		font-size: 24px;
		margin-bottom: 10px;
	}

	.gmCatDrawerFacts {
		margin: 14px 0;
	}
}
