/* Conteneur sticky bottom du thème (barre fixe en bas de page).
   Alimenté par le hook tdm_sticky_bottom : chaque plugin y rend une div enfant.
   Pile verticale sans padding ni gap : chaque enfant applique margin-top: var(--tdm-sticky-bottom-child-margin-top)
   (variable scopée sur le conteneur) et gère lui-même ses espaces latéral et bas — un enfant peut être collé au bas du viewport.
   Classe is-hidden posable par un consumer pour masquer le conteneur (ex. wp-stay22 quand une iframe passe dessous).
   Enqueue conditionnel dans functions.enqueue.css.php (gate has_action). */

:root {
	--tdm-sticky-bottom-bg: white;
	--tdm-sticky-bottom-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
	--tdm-sticky-bottom-z-index: 99;
	/* Hauteur réservée en bas du body (la hauteur réelle dépend des enfants) */
	--tdm-sticky-bottom-height: 80px;
	--tdm-sticky-bottom-transition: opacity 0.2s ease;
}

@media (min-width: 800px) {
	:root {
		--tdm-sticky-bottom-height: 86px;
	}
}


/* === Conteneur sticky bottom ============================================== */

/* Réserve le padding bas du body — évite que la barre recouvre la fin du contenu */
body:has(.tdm-sticky-bottom) {
	padding-bottom: var(--tdm-sticky-bottom-height);
}

.tdm-sticky-bottom {
	/* Contrat enfants : rythme vertical à appliquer en margin-top */
	--tdm-sticky-bottom-child-margin-top: 15px;

	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	background-color: var(--tdm-sticky-bottom-bg);
	box-shadow: var(--tdm-sticky-bottom-shadow);
	z-index: var(--tdm-sticky-bottom-z-index);
	display: flex;
	flex-direction: column;
	gap: 0;
	transition: var(--tdm-sticky-bottom-transition);

	/* Enfants (div rendues par les plugins) : jamais rétrécis */
	> * {
		flex: 0 0 auto;
	}

	/* Masquage posé par un consumer (contrat) */
	&.is-hidden {
		opacity: 0;
		pointer-events: none;
	}
}
