/* ==========================================================================
   Bulle WhatsApp et sa fenêtre de conversation (GG_Marque_Whatsapp, 20/11/2026).

   Reprise de la bulle de naoumihijab.com : vert WhatsApp #128c4b, bordure blanche, point vert « en ligne », infobulle au survol,
   fenêtre à en-tête #075e54 avec le monogramme, fond #ece5dd, bulles blanches.

   Sélecteurs portés par les identifiants `#gg-wac-button` et `#gg-wa-fenetre` : le reset du thème stylise tout lien et tout
   bouton par un sélecteur d'attribut (rose au survol), un simple nom de classe perdrait. `!important` seulement sur la couleur,
   le fond, la bordure et le soulignement, là où le thème s'impose.

   Mesures identiques à celles de la bulle de Naima (relevées sur naoumihijab.com le 20/11/2026) : 62 px et icône de 32 px sur
   ordinateur ; au plus 767 px, 56 px, icône de 30 px, à 14 px du bord droit et 18 px du bas (plus la zone de sécurité de l'appareil).
   Différences voulues : la couche (99999, au-dessus de la pastille Google, sous le bandeau des cookies à 100000), le texte
   de l'infobulle et sa police (Montserrat). Les seuils de la bulle (767 px) et ceux de la fenêtre (601 à 899 px, et 600 px)
   ne sont pas les mêmes : la fenêtre garde ceux de la première version.

   La pastille Google (`.gg-avis`, bas 96 px) et la barre d'achat de la fiche (fiche.css, qui remonte `#gg-wac-button` sous
   900 px) dépendent de la position de la bulle. Pas d'`!important` sur `bottom` pour que fiche.css continue de l'emporter.
   ========================================================================== */

/* --- La bulle --- */
#gg-wac-button {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 62px;
	height: 62px;
	margin: 0;
	padding: 0;
	background: #128c4b !important;
	border: 3px solid #fff !important;
	border-radius: 50%;
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.45);
	cursor: pointer;
	transition: transform 0.2s ease;
}

#gg-wac-button:hover,
#gg-wac-button:focus-visible {
	background: #0e7a41 !important;
	color: #fff !important;
	transform: scale(1.06);
}

#gg-wac-button:focus-visible {
	outline: 3px solid #075e54;
	outline-offset: 3px;
}

/* L'onde verte qui respire autour de la bulle. */
#gg-wac-button::before {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
	animation: gg-wa-onde 2.6s infinite;
	pointer-events: none;
}

@keyframes gg-wa-onde {
	0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
	70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

#gg-wac-button .gg-wa-icone {
	display: block;
	width: 32px;
	height: 32px;
	fill: currentColor;
}

/* Le point vert « connecté », posé sur le bord haut droit. */
#gg-wac-button .gg-wa-point {
	position: absolute;
	top: -2px;
	right: -2px;
	width: 18px;
	height: 18px;
	box-sizing: border-box;
	background: #25d366;
	border: 3px solid #fff;
	border-radius: 50%;
}

/* L'infobulle à gauche, au survol et au clavier (jamais sur téléphone : pas de survol). */
#gg-wac-button .gg-wa-infobulle {
	position: absolute;
	right: calc(100% + 12px);
	top: 50%;
	transform: translateY(-50%);
	padding: 9px 14px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	color: #141414;
	font: 700 14px/26px Montserrat, "Helvetica Neue", Arial, sans-serif;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

#gg-wac-button:hover .gg-wa-infobulle,
#gg-wac-button:focus-visible .gg-wa-infobulle {
	opacity: 1;
}

/* --- La fenêtre --- */
#gg-wa-fenetre {
	position: fixed;
	right: 24px;
	bottom: 100px;
	/* Au-dessus du bandeau des cookies (100000) : l'ouvrir est un geste voulu, et la saisie ne doit jamais passer dessous. */
	z-index: 100001;
	box-sizing: border-box;
	width: min(340px, calc(100vw - 28px));
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	overflow: hidden;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.06);
	font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
	text-align: left;
	animation: gg-wa-entree 0.2s ease;
}

#gg-wa-fenetre[hidden] {
	display: none;
}

@keyframes gg-wa-entree {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

#gg-wa-fenetre p {
	margin: 0;
	padding: 0;
}

#gg-wa-fenetre .gg-wa__tete {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 10px 14px 16px;
	background: #075e54;
	color: #fff;
}

#gg-wa-fenetre .gg-wa__marque {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

#gg-wa-fenetre .gg-wa__logo {
	position: relative;
	display: inline-flex;
	flex: none;
	width: 44px;
	height: 44px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

#gg-wa-fenetre .gg-wa__logo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	padding: 5px;
	box-sizing: border-box;
	object-fit: contain;
	border-radius: 50%;
}

#gg-wa-fenetre .gg-wa__logo b {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	font-size: 15px;
	font-weight: 800;
	color: #075e54;
}

#gg-wa-fenetre .gg-wa__point {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 14px;
	height: 14px;
	box-sizing: border-box;
	background: #25d366;
	border: 2px solid #075e54;
	border-radius: 50%;
}

#gg-wa-fenetre .gg-wa__nom {
	font-size: 15px;
	font-weight: 800;
	line-height: 1.25;
	color: #fff;
}

#gg-wa-fenetre .gg-wa__statut {
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.85);
}

#gg-wa-fenetre .gg-wa__fermer {
	align-self: flex-start;
	width: 36px;
	height: 36px;
	min-width: 0;
	margin: 0 0 0 auto;
	padding: 0;
	background: transparent !important;
	border: 0 !important;
	border-radius: 50%;
	box-shadow: none;
	color: #fff !important;
	font-size: 26px;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
}

#gg-wa-fenetre .gg-wa__fermer:hover,
#gg-wa-fenetre .gg-wa__fermer:focus-visible {
	background: rgba(255, 255, 255, 0.16) !important;
}

#gg-wa-fenetre .gg-wa__corps {
	padding: 18px 16px 22px;
	background: #ece5dd;
}

#gg-wa-fenetre .gg-wa__heure {
	margin-bottom: 10px;
	text-align: center;
	font-size: 12px;
	color: #5f6b73;
}

/* La notice « vient de se connecter ». */
#gg-wa-fenetre .gg-wa__notice {
	width: max-content;
	max-width: 100%;
	margin: 0 auto 12px;
	padding: 4px 10px;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 8px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
	color: #54656f;
	font-size: 12.5px;
	line-height: 1.4;
	text-align: center;
}

/* Les deux messages d'accueil : le premier avec sa pointe, le second collé dessous. */
#gg-wa-fenetre .gg-wa__message {
	position: relative;
	max-width: 90%;
	padding: 10px 12px;
	background: #fff;
	border-radius: 0 12px 12px 12px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
	color: #111b21;
	font-size: 15px;
	line-height: 1.45;
}

#gg-wa-fenetre .gg-wa__message::before {
	content: "";
	position: absolute;
	left: -8px;
	top: 0;
	border-top: 10px solid #fff;
	border-left: 8px solid transparent;
}

#gg-wa-fenetre .gg-wa__message + .gg-wa__message {
	margin-top: 6px;
	border-radius: 12px;
}

#gg-wa-fenetre .gg-wa__message + .gg-wa__message::before {
	display: none;
}

/* Les trois points « écrit… » (le script les montre entre deux messages). */
#gg-wa-fenetre .gg-wa__ecrit {
	display: none;
	width: 58px;
	margin-top: 6px;
	padding: 12px 14px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
}

#gg-wa-fenetre .gg-wa__ecrit.gg-visible {
	display: flex;
	gap: 5px;
}

#gg-wa-fenetre .gg-wa__ecrit span {
	width: 7px;
	height: 7px;
	background: #90989e;
	border-radius: 50%;
	animation: gg-wa-point 1.1s infinite ease-in-out;
}

#gg-wa-fenetre .gg-wa__ecrit span:nth-child(2) { animation-delay: 0.15s; }
#gg-wa-fenetre .gg-wa__ecrit span:nth-child(3) { animation-delay: 0.3s; }

@keyframes gg-wa-point {
	0%, 60%, 100% { opacity: 0.5; transform: none; }
	30% { opacity: 1; transform: translateY(-4px); }
}

#gg-wa-fenetre .gg-cache { display: none; }
#gg-wa-fenetre .gg-entree { animation: gg-wa-entree 0.25s ease; }

/* Le champ libre et la flèche d'envoi. */
#gg-wa-fenetre .gg-wa__saisie {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	padding: 12px;
	background: #fff;
}

#gg-wa-fenetre .gg-wa__texte {
	flex: 1;
	min-width: 0;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 6px 4px;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0;
	box-shadow: none;
	color: #111b21;
	font: 400 16px/1.4 Montserrat, "Helvetica Neue", Arial, sans-serif;
	resize: none;
}

#gg-wa-fenetre .gg-wa__texte:focus {
	outline: 0;
	box-shadow: none;
}

#gg-wa-fenetre .gg-wa__texte:focus-visible {
	box-shadow: inset 0 -2px 0 #128c4b;
}

#gg-wa-fenetre .gg-wa__envoyer {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	background: #128c4b !important;
	border-radius: 50%;
	color: #fff !important;
	text-decoration: none !important;
}

#gg-wa-fenetre .gg-wa__envoyer:hover,
#gg-wa-fenetre .gg-wa__envoyer:focus-visible {
	background: #0e7a41 !important;
	color: #fff !important;
}

#gg-wa-fenetre svg.gg-wa__fleche {
	display: block;
	width: 22px;
	height: 22px;
	margin-left: 2px;
}

@media (prefers-reduced-motion: reduce) {
	#gg-wac-button::before,
	#gg-wa-fenetre {
		animation: none;
	}

	#gg-wac-button {
		transition: none;
	}
}

/* Comme chez Naima : quand la barre d'achat de la fiche monte ou descend, la bulle glisse au lieu de sauter. */
@media (prefers-reduced-motion: no-preference) {
	#gg-wac-button {
		transition: transform 0.2s ease, bottom 0.2s ease;
	}
}

/* Tablette de la fiche : la barre d'achat fixe remonte la bulle (fiche.css, 88 px) ; la fenêtre se pose au-dessus d'elle, sans la recouvrir. */
@media (min-width: 601px) and (max-width: 899px) {
	body.single-product.gg-avec-achat-fixe #gg-wa-fenetre {
		bottom: calc(162px + env(safe-area-inset-bottom, 0px));
	}
}

/* La bulle sous 768 px, comme chez Naima : plus petite, plus près du bord, sans infobulle (pas de survol). */
@media (max-width: 767px) {
	#gg-wac-button {
		right: 14px;
		bottom: calc(18px + env(safe-area-inset-bottom, 0px));
		width: 56px;
		height: 56px;
	}

	#gg-wac-button .gg-wa-icone {
		width: 30px;
		height: 30px;
	}

	#gg-wac-button .gg-wa-infobulle {
		display: none;
	}
}

/* Téléphone : ouverte, la fenêtre prend la largeur et la bulle s'efface. */
@media (max-width: 600px) {
	#gg-wac-button.gg-ouvert {
		visibility: hidden;
	}

	#gg-wa-fenetre {
		right: 14px;
		left: 14px;
		width: auto;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
	}
}
