/* Couche CSS « core.modules » (voir Theme::buildCoreHeaders) : gagne sur BootstrapVendor, perd contre le Skin et contre tout CSS sans couche (Theme.css, pages Produit). */
@layer core.modules {
/*!
 * TableView.css — mécanique seulement : bouton de tri de l'en-tête remis à zéro, flèche, hauteur
 * fill (en-tête et pied fixes, les lignes défilent entre les deux), focus au clavier. Le <table>
 * n'a aucun look : le site lui donne ses classes et dessine ses cellules.
 * Flèche : .bootstrap-tableview-arrow, glyphe bi-arrow-up (masque peint en currentColor, 1em) qui
 * hérite de la couleur et de la taille de l'en-tête ; tournée pour le tri décroissant. Le site la
 * remplace en une règle, ex. .bootstrap-tableview-arrow { mask-image: url(…/bi-caret-up-fill.svg); }.
 */

.bootstrap-tableview-scroll {
	overflow-x: auto;
}

.bootstrap-tableview-search {
	margin-bottom: .5rem;
}

.bootstrap-tableview-empty[hidden] {
	display: none;
}

.bootstrap-tableview-footer {
	padding: .5rem .75rem;
	color: var(--bs-secondary-color);
	font-size: var(--bootstrap-fs-sm, .875rem);
}

/* ---- Bouton de tri : le texte de l'en-tête, sans habit de bouton ---- */
.bootstrap-tableview-sort {
	display: inline-flex;
	align-items: center;
	gap: .25em;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-align: inherit;
	text-transform: inherit;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
}

.bootstrap-tableview-sort:focus {
	outline: none;
}

.bootstrap-tableview-sort:focus-visible {
	border-radius: var(--bs-border-radius-sm);
	box-shadow: var(--bootstrap-focus-ring);
}

/* Tout l'en-tête de la colonne est cliquable : le bouton s'étend sur la cellule (le padding du site reste intact).
   :where() garde la règle presque sans poids, pour que position: sticky (height: 'fill') gagne. */
.bootstrap-tableview :where(.bootstrap-tableview-table > thead > tr > th:has(> .bootstrap-tableview-sort)) {
	position: relative;
}

.bootstrap-tableview-sort::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* Colonne alignée à droite : la flèche passe à gauche, le libellé reste aligné sur les chiffres. */
.bootstrap-tableview .text-end > .bootstrap-tableview-sort {
	flex-direction: row-reverse;
}

/* ---- Flèche : invisible hors tri (sa place est gardée), devinée au survol, pleine sur la colonne triée ---- */
.bootstrap-tableview-arrow {
	opacity: 0;
}

.bootstrap-tableview th:hover > .bootstrap-tableview-sort > .bootstrap-tableview-arrow,
.bootstrap-tableview-sort:hover > .bootstrap-tableview-arrow,
.bootstrap-tableview-sort:focus-visible > .bootstrap-tableview-arrow {
	opacity: .4;
}

.bootstrap-tableview [aria-sort] > .bootstrap-tableview-sort > .bootstrap-tableview-arrow {
	opacity: 1;
}

.bootstrap-tableview [aria-sort="descending"] > .bootstrap-tableview-sort > .bootstrap-tableview-arrow {
	transform: rotate(180deg);
}

.bootstrap-tableview-clickable > tbody > tr {
	cursor: pointer;
}

/* ---- height: 'fill' : le tableau occupe son conteneur ; seules les lignes défilent ---- */
.bootstrap-tableview-fill {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.bootstrap-tableview-fill > .bootstrap-tableview-search,
.bootstrap-tableview-fill > .bootstrap-tableview-footer {
	flex: none;
}

.bootstrap-tableview-fill > .bootstrap-tableview-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
}

/* Bordures séparées : celle du bas de l'en-tête reste avec lui quand il est fixé. */
.bootstrap-tableview-fill .bootstrap-tableview-table {
	border-collapse: separate;
	border-spacing: 0;
}

.bootstrap-tableview-fill .bootstrap-tableview-table > thead > tr > th {
	position: sticky;
	top: 0;
	z-index: 1;
	background-color: var(--bs-table-bg, var(--bs-body-bg));
}
}
