/**
 * Sticky Add To Cart — barre collante bas d'écran.
 * Préfixe : .stac-* / --stac-*
 * z-index sous les popups WBO (100000+) pour ne pas les masquer.
 */

.stac-sticky-bar {
	/* Design tokens */
	--stac-bg: #ffffff;
	--stac-text: #1a2e28;
	--stac-muted: #5a6b66;
	--stac-accent: #1f6f5c;
	--stac-btn-bg: #1f6f5c;
	--stac-btn-color: #ffffff;
	--stac-btn-hover: #185a4a;
	--stac-border: rgba(26, 46, 40, 0.1);
	--stac-shadow: 0 -4px 24px rgba(26, 46, 40, 0.12);
	--stac-radius: 0;
	--stac-z: 9999;
	--stac-height: 60px;
	--stac-gap: 10px;
	--stac-pad-x: 12px;
	--stac-img-size: 40px;
	--stac-transition: 0.3s ease;

	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: var(--stac-z);
	display: flex;
	align-items: center;
	gap: var(--stac-gap);
	min-height: var(--stac-height);
	padding: 8px var(--stac-pad-x);
	padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	background: var(--stac-bg);
	color: var(--stac-text);
	border-top: 1px solid var(--stac-border);
	box-shadow: var(--stac-shadow);
	border-radius: var(--stac-radius);
	font-family: inherit;
	transform: translateY(100%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		transform var(--stac-transition),
		opacity var(--stac-transition),
		visibility var(--stac-transition);
}

.stac-sticky-bar.is-visible {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.stac-sticky-bar[hidden] {
	display: none !important;
}

/* Image produit */
.stac-sticky-bar .stac-img {
	flex-shrink: 0;
	width: var(--stac-img-size);
	height: var(--stac-img-size);
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

/* Infos */
.stac-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
}

.stac-name {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--stac-text);
}

.stac-price {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--stac-accent);
}

.stac-price .price,
.stac-price .woocommerce-Price-amount,
.stac-price bdi {
	color: inherit;
	font-weight: inherit;
	font-size: inherit;
}

.stac-price del {
	opacity: 0.55;
	font-weight: 500;
	margin-right: 4px;
	color: var(--stac-muted);
}

.stac-price ins {
	text-decoration: none;
	color: var(--stac-accent);
}

/* Quantité — masquée (évite les bugs d’affichage iPhone / Android) */
.stac-qty-wrap {
	display: none !important;
}

.stac-add-btn:focus-visible {
	outline: 2px solid var(--stac-accent);
	outline-offset: 1px;
}

/* Bouton Add to cart */
.stac-add-btn {
	flex-shrink: 0;
	appearance: none;
	border: 0;
	background: var(--stac-btn-bg);
	color: var(--stac-btn-color);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	line-height: 1.2;
	padding: 10px 12px;
	border-radius: 6px;
	cursor: pointer;
	white-space: nowrap;
	min-height: 36px;
	transition: background 0.2s ease, transform 0.15s ease;
}

.stac-add-btn:hover {
	background: var(--stac-btn-hover);
}

.stac-add-btn:active {
	transform: scale(0.98);
}

.stac-add-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* Mobile étroit */
@media (max-width: 379px) {
	.stac-name {
		font-size: 12px;
	}

	.stac-add-btn {
		padding: 10px 10px;
		font-size: 11px;
	}
}

/* Tablette+ */
@media (min-width: 768px) {
	.stac-sticky-bar {
		--stac-height: 68px;
		--stac-pad-x: 24px;
		--stac-gap: 16px;
		--stac-img-size: 48px;
		left: 50%;
		right: auto;
		width: min(600px, calc(100% - 32px));
		transform: translate(-50%, 100%);
		bottom: 16px;
		border-radius: 12px;
		border: 1px solid var(--stac-border);
		padding: 10px 16px;
		padding-bottom: 10px;
	}

	.stac-sticky-bar.is-visible {
		transform: translate(-50%, 0);
	}

	.stac-name {
		font-size: 14px;
	}

	.stac-price {
		font-size: 14px;
	}

	.stac-add-btn {
		font-size: 13px;
		padding: 11px 18px;
		min-height: 40px;
	}
}

/* Desktop large : barre plus généreuse, toujours centrée */
@media (min-width: 1024px) {
	.stac-sticky-bar {
		width: min(720px, calc(100% - 48px));
		--stac-pad-x: 20px;
	}
}

/* Réduire les animations si préférence système */
@media (prefers-reduced-motion: reduce) {
	.stac-sticky-bar {
		transition: none;
	}
}
