/*
 * DUOBAT – archives catégories produits (product_cat).
 * Mobile d'abord. Aucun z-index ni position fixe : le panier dgp garde son empilement.
 */

.dcat-header,
.dcat-bottom {
	--dcat-navy: #153448;
	--dcat-blue: #22526c;
	--dcat-accent: #ffff00;
	--dcat-bg: #f2f6f8;
	--dcat-border: #d5e0e6;
}

/* ---------- En-tête : H1, intro, liens rapides ---------- */

.dcat-header {
	margin: 0 0 12px;
}

.dcat-title {
	margin: 0 0 8px;
	color: var(--dcat-navy);
	font-size: 22px;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: 0;
}

.dcat-intro {
	color: #333;
	font-size: 14px;
	line-height: 1.5;
}

.dcat-intro .term-description {
	margin: 0;
}

.dcat-intro p {
	margin: 0 0 8px;
}

.dcat-intro p:last-child {
	margin-bottom: 0;
}

.dcat-intro a {
	color: var(--dcat-blue);
	text-decoration: underline;
}

/* Intro repliée sur mobile : hauteur fixe dès le rendu serveur, pas de décalage. */
.dcat-intro.is-collapsed {
	position: relative;
	max-height: 4.5em; /* 3 lignes */
	overflow: hidden;
}

.dcat-intro.is-collapsed::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 1.5em;
	background: linear-gradient(rgba(255, 255, 255, 0), #fff);
	pointer-events: none;
}

.dcat-intro-toggle {
	display: inline-block;
	margin: 2px 0 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--dcat-blue);
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.dcat-intro-toggle:focus-visible,
.dcat-quicklinks a:focus-visible,
.dcat-card:focus-visible,
.dcat-faq summary:focus-visible {
	outline: 2px solid var(--dcat-blue);
	outline-offset: 2px;
}

/* Pastilles : une ligne qui défile horizontalement sur mobile. */
.dcat-quicklinks {
	margin: 10px 0 0;
}

.dcat-quicklinks ul {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	margin: 0 -15px;
	padding: 2px 15px 6px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.dcat-quicklinks li {
	flex: 0 0 auto;
	margin: 0;
	scroll-snap-align: start;
}

.dcat-quicklinks a {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid var(--dcat-blue);
	border-radius: 999px;
	background: #fff;
	color: var(--dcat-blue);
	font-size: 13px;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color .15s, color .15s;
}

.dcat-quicklinks a:hover,
.dcat-quicklinks a:focus {
	background: var(--dcat-navy);
	border-color: var(--dcat-navy);
	color: #fff;
	text-decoration: none;
}

/* ---------- Bas de page ---------- */

.dcat-bottom {
	clear: both;
	margin: 32px 0 0;
}

.dcat-bottom h2 {
	margin: 0 0 14px;
	color: var(--dcat-navy);
	font-size: 20px;
	line-height: 1.3;
	letter-spacing: 0;
}

.dcat-bottom > * + * {
	margin-top: 32px;
}

.dcat-content h3 {
	color: var(--dcat-blue);
	font-size: 17px;
}

.dcat-content a,
.dcat-local a {
	color: var(--dcat-blue);
	text-decoration: underline;
}

.dcat-content ul,
.dcat-content ol {
	padding-left: 1.25em;
}

/* FAQ */
.dcat-faq__item {
	border-bottom: 1px solid var(--dcat-border);
}

.dcat-faq__item:first-of-type {
	border-top: 1px solid var(--dcat-border);
}

.dcat-faq summary {
	position: relative;
	padding: 12px 32px 12px 0;
	color: var(--dcat-navy);
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.dcat-faq summary::-webkit-details-marker {
	display: none;
}

.dcat-faq summary::after {
	content: "+";
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	color: var(--dcat-blue);
	font-size: 20px;
	font-weight: 400;
}

.dcat-faq details[open] > summary::after {
	content: "\2212";
}

.dcat-faq__answer p {
	margin: 0 0 14px;
}

/* Catégories liées */
.dcat-related__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dcat-related__list li {
	margin: 0;
}

.dcat-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--dcat-border);
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	color: var(--dcat-navy);
	text-decoration: none;
	transition: border-color .15s;
}

.dcat-card:hover,
.dcat-card:focus {
	border-color: var(--dcat-blue);
	color: var(--dcat-navy);
	text-decoration: none;
}

.dcat-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
}

.dcat-card__name {
	display: block;
	padding: 10px 12px;
	border-top: 3px solid var(--dcat-accent);
	font-weight: 600;
	line-height: 1.3;
}

.dcat-card--noimg .dcat-card__name {
	border-top: 0;
	border-left: 3px solid var(--dcat-accent);
	padding: 14px 12px;
}

/* Bloc local */
.dcat-local {
	padding: 20px 16px;
	border-radius: 6px;
	background: var(--dcat-navy);
	color: #fff;
}

.dcat-bottom .dcat-local h2 {
	color: #fff;
}

.dcat-local p {
	margin: 0 0 10px;
	color: #fff;
}

.dcat-local p:last-child {
	margin-bottom: 0;
}

.dcat-local a.dcat-local__tel {
	color: var(--dcat-accent);
	font-weight: 700;
	white-space: nowrap;
}

/* ---------- Tablette et plus ---------- */

@media (min-width: 768px) {
	.dcat-header {
		margin-bottom: 18px;
	}

	.dcat-title {
		font-size: 30px;
		margin-bottom: 10px;
	}

	.dcat-intro {
		font-size: 15px;
	}

	.dcat-intro.is-collapsed {
		max-height: none;
		overflow: visible;
	}

	.dcat-intro.is-collapsed::after,
	.dcat-intro-toggle {
		display: none;
	}

	.dcat-quicklinks ul {
		flex-wrap: wrap;
		margin: 0;
		padding: 0;
		overflow: visible;
	}

	.dcat-bottom h2 {
		font-size: 24px;
	}

	.dcat-related__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 16px;
	}

	.dcat-local {
		padding: 28px 32px;
	}
}

@media (min-width: 1200px) {
	.dcat-related__list {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.dcat-quicklinks a,
	.dcat-card {
		transition: none;
	}
}
