/*
 * Barre d'achat collante.
 */

.dosage-sticky {
	--dst-encre: var(--wp--preset--color--ink, #14110e);
	--dst-papier: var(--wp--preset--color--paper, #fff);
	--dst-filet: var(--wp--preset--color--line, #e6e1d9);
	--dst-second: var(--wp--preset--color--data, #4c453d);
	--dst-argile: var(--wp--preset--color--clay, #e5dcd1);
	--dst-rayon: var(--wp--custom--radius, 0);
	--dst-mono: var(--wp--preset--font-family--mono, ui-monospace, monospace);

	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 40;
	background: var(--dst-papier);
	border-top: 1px solid var(--dst-filet);
	/* Le seul endroit du projet où une ombre est utile : elle dit que la barre
	   flotte au-dessus du contenu, et non qu'elle en fait partie. */
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
	/* Le clavier virtuel et la barre d'outils d'iOS mangent le bas de l'écran :
	   sans cette marge, le bouton passe dessous. */
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.dosage-sticky[hidden] {
	display: none;
}

.dosage-sticky__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: var(--wp--style--global--wide-size, 1320px);
	margin-inline: auto;
	padding: 10px var(--wp--custom--layout--gutter, 16px);
}

.dosage-sticky__image {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: var(--dst-rayon);
	display: block;
}

/* Sur un écran étroit, l'image cède la place au texte et au bouton : c'est
   l'action qui compte, pas la vignette. */
@media (max-width: 480px) {
	.dosage-sticky__image {
		display: none;
	}
}

.dosage-sticky__texte {
	flex: 1 1 auto;
	min-width: 0;
}

.dosage-sticky__nom {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	/* Un nom long ne doit pas pousser le bouton hors de l'écran. */
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dosage-sticky__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--dst-second);
	min-width: 0;
}

.dosage-sticky__pastille {
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
	background: var(--shade-color, var(--dst-argile));
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 50%;
}

.dosage-sticky__pastille[hidden] {
	display: none;
}

.dosage-sticky__variante {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dosage-sticky__variante:empty {
	display: none;
}

.dosage-sticky__prix {
	font-family: var(--dst-mono);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	margin-left: auto;
}

.dosage-sticky__prix del {
	opacity: 0.6;
	margin-right: 4px;
}

.dosage-sticky__bouton {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 12px 24px;
	background: var(--dst-encre);
	color: var(--dst-papier);
	border: 1px solid var(--dst-encre);
	border-radius: var(--dst-rayon);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
}

.dosage-sticky__bouton:hover {
	background: transparent;
	color: var(--dst-encre);
}

.dosage-sticky__bouton[disabled] {
	background: var(--dst-argile);
	color: var(--dst-second);
	border-color: var(--dst-argile);
	cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
	.dosage-sticky {
		transition: none !important;
	}
}
