/*
 * Sopretty · WhatsApp (bouton flottant, retour en haut, « Une question sur ce produit ? ») et sélecteur de devise.
 * Maquette « Design System » § 08. Vert WhatsApp uniquement pour WhatsApp, texte encre dessus.
 */

/* ---------- Bouton flottant ---------- */
.sp-float {
	position: fixed;
	right: 16px;
	/* Toujours au-dessus de la barre d'achat collante (variable posée par la fiche produit). */
	bottom: calc(16px + var(--sp-barre-achat, 0px) + env(safe-area-inset-bottom, 0px));
	z-index: 9990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: var(--sp-font-texte, "Figtree", system-ui, sans-serif);
	pointer-events: none;
}

.sp-float > * {
	pointer-events: auto;
}

.sp-float [hidden] {
	display: none !important;
}

.sp-float__wa {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--sp-whatsapp, #25d366);
	box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
	transition: transform 0.15s ease;
}

.sp-float__wa:hover {
	transform: scale(1.05);
}

.sp-float__top {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0 4px 0 0;
	padding: 0;
	border: 1px solid var(--sp-gris-300, #d9cfcc);
	border-radius: 50%;
	background: #fff;
	color: var(--sp-action, #841625);
	box-shadow: 0 8px 20px -8px rgba(62, 18, 24, 0.35);
	cursor: pointer;
}

.sp-float__bubble {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 220px;
	padding: 10px 12px 10px 14px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 8px 24px -8px rgba(62, 18, 24, 0.3);
}

.sp-float__bubble-link {
	font-size: 14px;
	line-height: 1.35;
	color: var(--sp-encre, #241a1c);
	text-decoration: none;
}

.sp-float__bubble-close {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	margin: -6px -6px -6px 4px;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 20px;
	line-height: 1;
	color: var(--sp-gris-600, #6b5f61);
	cursor: pointer;
}

.sp-float__wa:focus-visible,
.sp-float__top:focus-visible,
.sp-float__bubble-close:focus-visible,
.sp-wa-question:focus-visible,
.sp-wa-btn:focus-visible,
.sp-devise a:focus-visible,
a.sp-devise:focus-visible {
	outline: 3px solid var(--sp-prune, #3e1218);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.sp-float__wa {
		transition: none;
	}
}

/* ---------- « Une question sur ce produit ? » (contour vert) ---------- */
.sp-wa-question,
.sp-wa-btn {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 50px;
	margin: 12px 0 0;
	padding: 0 20px;
	border: 2px solid var(--sp-whatsapp, #25d366);
	border-radius: 999px;
	background: #fff;
	font-family: var(--sp-font-texte, "Figtree", system-ui, sans-serif);
	font-size: 15px;
	font-weight: 700;
	color: var(--sp-encre, #241a1c);
	text-decoration: none;
}

.sp-wa-question:hover,
.sp-wa-btn--contour:hover {
	background: #effbf3;
	color: var(--sp-encre, #241a1c);
}

/* Bouton WhatsApp plein (contact uniquement). */
.sp-wa-btn {
	min-height: 54px;
	margin: 0;
	background: var(--sp-whatsapp, #25d366);
	font-size: 16px;
}

.sp-wa-btn:hover {
	background: #1ebe5a;
	color: var(--sp-encre, #241a1c);
}

.sp-wa-btn--contour {
	min-height: 50px;
	background: #fff;
	font-size: 15px;
}

/* ---------- Sélecteur de devise ---------- */
/* Pastille d'en-tête : 32 px visibles, zone cliquable de 44 px. */
a.sp-devise--pilule {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	min-width: 44px;
	justify-content: center;
	font-family: var(--sp-font-texte, "Figtree", system-ui, sans-serif);
	text-decoration: none;
}

a.sp-devise--pilule span {
	display: inline-flex;
	align-items: center;
	height: 32px;
	padding: 0 10px;
	border: 1px solid var(--sp-gris-300, #d9cfcc);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	color: var(--sp-encre, #241a1c);
}

a.sp-devise--pilule:hover span {
	border-color: var(--sp-action, #841625);
	color: var(--sp-action, #841625);
}

/* Interrupteur du menu : FCFA | Euro €. */
.sp-devise--bascule {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border-radius: 999px;
	background: #f2ecea;
	font-family: var(--sp-font-texte, "Figtree", system-ui, sans-serif);
}

.sp-devise__opt {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	color: var(--sp-gris-700, #4a3f41);
	text-decoration: none;
}

.sp-devise__opt.is-on {
	background: #fff;
	color: var(--sp-action, #841625);
}
