/**
 * Widgets flottants : panier rapide + retour en haut.
 * Conteneur fixe en bas-droite ; les boutons s'empilent verticalement.
 */
.cbdco-fw {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	pointer-events: none;
}
.cbdco-fw > * { pointer-events: auto; }

/* ------ Panier flottant ------------------------------------- */
.cbdco-fc {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--btn-bg, var(--gold-gradient));
	color: #1a1208;
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	padding: 0;
	text-decoration: none;
	transition: transform .18s ease, box-shadow .18s ease;
}
.cbdco-fc:hover,
.cbdco-fc:focus-visible {
	color: #1a1208;
	transform: translateY(-2px) scale(1.04);
	/* Lueur externe dorée à la manière du bouton ATC : double couche
	   (halo proche + diffuse) pour un effet "pulsant" au survol. */
	box-shadow:
		0 0 0 4px rgba(212, 168, 75, 0.18),
		0 12px 32px rgba(212, 168, 75, 0.55),
		0 4px 10px rgba(0, 0, 0, 0.35);
	outline: none;
}
.cbdco-fc:hover svg,
.cbdco-fc:focus-visible svg { color: #1a1208; stroke: #1a1208; }
.cbdco-fc__icon { display: inline-flex; }
.cbdco-fc__icon svg { display: block; }
.cbdco-fc__count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: #0f0f0f;
	color: var(--gold-soft, #f0d28a);
	border: 1.5px solid var(--gold, #d4a648);
	font-family: var(--font-mono, "JetBrains Mono", monospace);
	font-size: 11px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	letter-spacing: 0;
	line-height: 1;
}
/* Compteur masqué quand panier vide (data-count="0"). */
.cbdco-fc__count[data-count="0"] { display: none; }

/* ------ Retour en haut -------------------------------------- */
.cbdco-btt {
	width: 44px !important;
	height: 44px !important;
	min-width: 44px;
	min-height: 44px;
	max-width: 44px;
	max-height: 44px;
	aspect-ratio: 1 / 1;
	flex: 0 0 44px;
	padding: 0;
	border-radius: 50%;
	background: var(--bg-2, #1a1a1a);
	color: var(--gold, #d4a648);
	border: 1px solid var(--line, rgba(226, 203, 151, 0.12));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.cbdco-btt[hidden] { display: none; }
.cbdco-btt.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.cbdco-btt:hover,
.cbdco-btt:focus-visible {
	background: var(--btn-bg, var(--gold-gradient));
	color: var(--btn-fg, #0f0f0f);
	border-color: transparent;
}
.cbdco-btt__icon {
	display: inline-block;
	width: 22px; height: 22px;
	background: var(--gold-gradient);
	transition: background .2s ease;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 15 12 9 18 15'/></svg>") center / contain no-repeat;
	        mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 15 12 9 18 15'/></svg>") center / contain no-repeat;
}
.cbdco-btt:hover .cbdco-btt__icon,
.cbdco-btt:focus-visible .cbdco-btt__icon { background: #1a1208; }

/* Mobile : on rapproche du bord et on réduit légèrement. */
@media (max-width: 640px) {
	.cbdco-fw { right: 14px; bottom: 14px; gap: 10px; }
	.cbdco-fc { width: 50px; height: 50px; }
	.cbdco-btt {
		width: 40px !important;
		height: 40px !important;
		min-width: 40px;
		min-height: 40px;
		max-width: 40px;
		max-height: 40px;
		flex: 0 0 40px;
	}
}

/* ============================================================
 * Widget WhatsApp flottant (bas-gauche).
 * Desktop : bulle horizontale animée avec logo + texte.
 * Mobile  : bouton rond compact.
 * ============================================================ */
.cbdco-wa {
	--wa-green:      #25d366;
	--wa-green-dark: #128c7e;
	--wa-shadow:     0 10px 30px rgba(18, 140, 126, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
	--wa-bottom:     20px;

	position: fixed;
	left: 20px;
	bottom: var(--wa-bottom);
	z-index: 9999;
	display: inline-flex;
	align-items: center;
	transform-origin: bottom left;
	opacity: 0;
	transform: translateY(16px) scale(0.92);
	transition: opacity .35s ease, transform .35s cubic-bezier(.2, 1.4, .35, 1), bottom .3s ease;
	pointer-events: none;
}
/* Si la notif sociale est visible, on remonte la bulle WhatsApp pour
   éviter le chevauchement (la notif fait ~70-80px de haut). */
body:has(.cbdco-sp.is-visible) .cbdco-wa {
	--wa-bottom: 110px;
}
.cbdco-wa[hidden] { display: none; }
.cbdco-wa.is-revealed {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	animation: cbdco-wa-pop .55s cubic-bezier(.2, 1.4, .35, 1);
}
@keyframes cbdco-wa-pop {
	0%   { opacity: 0; transform: translateY(16px) scale(.85); }
	60%  { opacity: 1; transform: translateY(-4px) scale(1.03); }
	100% { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Bulle cliquable (lien wa.me) */
.cbdco-wa__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 10px 20px 10px 12px;
	background: linear-gradient(135deg, var(--wa-green) 0%, var(--wa-green-dark) 100%);
	color: #fff;
	border-radius: 999px;
	text-decoration: none;
	box-shadow: var(--wa-shadow);
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
	overflow: visible;
}
.cbdco-wa__link:hover,
.cbdco-wa__link:focus-visible {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 14px 36px rgba(37, 211, 102, 0.55), 0 6px 14px rgba(0, 0, 0, 0.3);
	outline: none;
	filter: brightness(1.05);
}

/* Pulse animé autour du logo */
.cbdco-wa__pulse {
	position: absolute;
	left: 6px;
	top: 50%;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	border-radius: 50%;
	background: var(--wa-green);
	opacity: .55;
	z-index: 0;
	animation: cbdco-wa-pulse 1.8s ease-out infinite;
	pointer-events: none;
}
@keyframes cbdco-wa-pulse {
	0%   { transform: scale(0.85); opacity: .55; }
	70%  { transform: scale(1.7);  opacity: 0; }
	100% { transform: scale(1.7);  opacity: 0; }
}

.cbdco-wa__icon {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	color: var(--wa-green);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
	flex: 0 0 44px;
}
.cbdco-wa__icon svg { display: block; }

.cbdco-wa__text {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	line-height: 1.15;
	white-space: nowrap;
}
.cbdco-wa__label {
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.01em;
}
.cbdco-wa__subtext {
	font-size: 12.5px;
	opacity: 0.92;
	margin-top: 2px;
}

/* Bouton fermer × — en haut à droite de la bulle.
   On force les valeurs en !important car un verrou global dans main.css
   (button[class*="__close"]…) impose un fond transparent qui rendrait la
   croix invisible sur le dégradé vert WhatsApp. */
.cbdco-wa .cbdco-wa__close {
	position: absolute !important;
	top: -8px !important;
	right: -8px !important;
	width: 24px !important;
	height: 24px !important;
	min-width: 24px !important;
	min-height: 24px !important;
	max-width: 24px !important;
	max-height: 24px !important;
	border-radius: 50% !important;
	background: #1a1a1a !important;
	color: #fff !important;
	border: 2px solid #fff !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	padding: 0 !important;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
	backdrop-filter: none !important;
	-webkit-backdrop-filter: none !important;
	transition: transform .18s ease, background .18s ease !important;
	z-index: 2;
}
.cbdco-wa .cbdco-wa__close:hover,
.cbdco-wa .cbdco-wa__close:focus-visible {
	transform: scale(1.12) rotate(90deg) !important;
	background: #d33 !important;
	border-color: #fff !important;
	color: #fff !important;
	outline: none;
}
.cbdco-wa .cbdco-wa__close svg { display: block; color: #fff !important; stroke: #fff !important; }

/* Mobile : bouton rond compact, le texte se cache. */
@media (max-width: 640px) {
	.cbdco-wa { left: 14px; bottom: 14px; }
	.cbdco-wa__link {
		padding: 0;
		width: 54px;
		height: 54px;
		border-radius: 50%;
		justify-content: center;
	}
	.cbdco-wa__text { display: none; }
	.cbdco-wa__icon {
		width: 54px;
		height: 54px;
		flex: 0 0 54px;
		background: transparent;
		color: #fff;
		box-shadow: none;
	}
	.cbdco-wa__icon svg { width: 30px; height: 30px; }
	.cbdco-wa__pulse {
		left: 0;
		top: 0;
		width: 54px;
		height: 54px;
		margin-top: 0;
	}
	.cbdco-wa .cbdco-wa__close {
		top: -6px !important;
		right: -6px !important;
		width: 22px !important;
		height: 22px !important;
		min-width: 22px !important;
		min-height: 22px !important;
		max-width: 22px !important;
		max-height: 22px !important;
	}
}

/* Respect prefers-reduced-motion : on coupe pulse + bounce d'entrée. */
@media (prefers-reduced-motion: reduce) {
	.cbdco-wa.is-revealed { animation: none; }
	.cbdco-wa__pulse { animation: none; opacity: 0; }
	.cbdco-wa { transition: opacity .2s ease; transform: none; }
}
