/* Bollaert Chat 3CX v2 : la feuille de cuve-light (components/ui/chat.css) avec les couleurs du thème écrites en dur,
   pour le thème « theme » de cuve.be et tankkopen.be. Boutons et textes reçoivent font-family: inherit. */
.cchat, .cchat button, .cchat textarea { font-family: inherit; }
/* Composant : chat en direct, notre fenêtre (inc/chat.php). Le widget 3CX est hors écran et ne se voit jamais.
   Tout se cale en bas à droite, au-dessus de la barre d'achat des fiches produit (--buy-bar-h, assets/js/main.js).
   Vert du thème (--color-success) pour la bulle et l'envoi, comme l'ancien chatbot ; carré, unité de 4 px. */

.cchat {
	--cchat-right: 20px;
	--cchat-bottom: calc(20px + 0px);
	--cchat-w: 360px;
	position: fixed;
	right: 0;
	bottom: 0;
	z-index: 100000;
	font-family: inherit;
}

/* --- La bulle et son libellé ------------------------------------------------ */
.cchat__bulle {
	position: fixed;
	right: var(--cchat-right);
	bottom: var(--cchat-bottom);
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: #1d9a4f;
	box-shadow: 0 4px 14px rgb(11 19 32 / 28%);
	color: #fff;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease;
}
.cchat__bulle:hover, .cchat__bulle:focus-visible { transform: translateY(-1px); box-shadow: 0 8px 22px rgb(11 19 32 / 32%); }
.cchat__bulle:focus-visible { outline: 2px solid #1d9a4f; outline-offset: 3px; }
/* Icônes au trait : le thème remplit les svg en currentColor, ce qui faisait un disque blanc à la place du combiné. */
.cchat svg path, .cchat svg circle { fill: none; stroke: currentColor; }
.cchat__ico { width: 26px; height: 26px; }

.cchat__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: #c0392b;
	box-shadow: 0 0 0 2px #fff;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}
.cchat__badge[hidden] { display: none; }


/* Le téléphone du coin, à gauche de la bulle : appelle le standard d'un clic ; rouge et combiné raccroché pendant
   l'appel (un clic raccroche). */
.cchat__tel {
	position: fixed;
	right: calc(var(--cchat-right) + 72px);
	bottom: var(--cchat-bottom);
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: #1d9a4f;
	box-shadow: 0 4px 14px rgb(11 19 32 / 28%);
	color: #fff;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.cchat__tel[hidden] { display: none; }
.cchat__tel:hover, .cchat__tel:focus-visible { background: #17803f; color: #fff; transform: translateY(-1px); box-shadow: 0 8px 22px rgb(11 19 32 / 32%); }
.cchat__tel:disabled { background: #3b4757; cursor: default; transform: none; }
.cchat__ico--raccrocher { display: none; }
.cchat.is-call .cchat__tel, .cchat.is-call-ailleurs .cchat__tel { background: #c0392b; }
.cchat.is-call .cchat__tel:hover, .cchat.is-call-ailleurs .cchat__tel:hover { background: #a93226; }
.cchat.is-call .cchat__ico--tel, .cchat.is-call-ailleurs .cchat__ico--tel { display: none; }
.cchat.is-call .cchat__ico--raccrocher, .cchat.is-call-ailleurs .cchat__ico--raccrocher { display: block; }

/* La carte d'accueil au-dessus des deux boutons : la photo de Marie et « Contactez-nous directement ». Un clic
   ouvre le chat ; la croix la range pour la visite. */
.cchat__carte-accueil {
	position: fixed;
	right: var(--cchat-right);
	bottom: calc(var(--cchat-bottom) + 72px);
	z-index: 100001;
	display: flex;
	align-items: center;
	gap: 4px;
	max-width: min(320px, calc(100vw - 2 * var(--cchat-right)));
	padding: 8px 8px 8px 10px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 6px 24px rgb(11 19 32 / 22%);
}
.cchat__carte-accueil[hidden] { display: none; }
.cchat__carte-accueil-corps { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: #0b1320; font-family: inherit; text-align: left; cursor: pointer; }
.cchat__carte-accueil-corps:hover { background: none; color: #0b1320; }
.cchat__carte-accueil-photo { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgb(29 154 79 / 35%); }
.cchat__carte-accueil-texte { font-size: 14px; font-weight: 700; line-height: 1.3; }
.cchat__carte-accueil-x { flex: none; width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: #3b4757; font-size: 20px; line-height: 1; cursor: pointer; }
.cchat__carte-accueil-x:hover { background: #f4f7fb; color: #0b1320; }

/* Ondes de l'appel en cours, derrière le téléphone. */
.cchat__ondes { position: fixed; right: calc(var(--cchat-right) + 72px); bottom: var(--cchat-bottom); z-index: 100000; width: 60px; height: 60px; pointer-events: none; }
.cchat__ondes[hidden] { display: none; }
.cchat__ondes span { position: absolute; inset: 0; border: 2px solid #c0392b; border-radius: 50%; opacity: 0; animation: cchat-onde 1.8s ease-out infinite; }
.cchat__ondes span:nth-child(2) { animation-delay: .6s; }
.cchat__ondes span:nth-child(3) { animation-delay: 1.2s; }
@keyframes cchat-onde { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.1); opacity: 0; } }


/* --- La fenêtre --------------------------------------------------------------- */
.cchat__panel {
	position: fixed;
	right: var(--cchat-right);
	bottom: calc(var(--cchat-bottom) + 72px);
	z-index: 100001;
	display: flex;
	flex-direction: column;
	width: var(--cchat-w);
	max-width: calc(100vw - 2 * var(--cchat-right));
	height: 520px;
	max-height: calc(100vh - var(--cchat-bottom) - 88px);
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 16px 48px rgb(11 19 32 / 28%), 0 0 0 1px #dfe6ee;
}
.cchat__panel[hidden] { display: none; }

.cchat__head { display: flex; flex: none; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: #1d9a4f; color: #fff; }
.cchat__avatar { display: grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #1d9a4f; font-size: 17px; font-weight: 800; }
.cchat__who { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.cchat__name { overflow: hidden; font-size: 15px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.cchat__status { font-size: 12px; line-height: 1.3; opacity: .9; }
.cchat.is-live .cchat__status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #9df5b6; }
.cchat__hbtn { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 16%); color: #fff; cursor: pointer; }
.cchat__hbtn:hover { background: rgb(255 255 255 / 28%); }
.cchat__hbtn svg { width: 20px !important; height: 20px !important; min-width: 20px; }
.cchat__hbtn[hidden] { display: none; }

.cchat__callbar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: #0b1e3f; color: #fff; font-size: 14px; font-weight: 600; }
.cchat__callbar[hidden] { display: none; }
.cchat__callbar-texte::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #c0392b; animation: cchat-clignote 1s ease-in-out infinite; }
@keyframes cchat-clignote { 50% { opacity: .2; } }
.cchat__hangup { padding: 6px 12px; border: 0; border-radius: 999px; background: #c0392b; color: #fff; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }

.cchat__msgs { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; min-height: 0; padding: 14px; overflow-y: auto; background: #f4f7fb; scrollbar-width: thin; }
.cchat__msgs[hidden] { display: none; }
.cchat__accueil { align-self: flex-start; max-width: 85%; margin: 0; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: 0 1px 2px rgb(11 19 32 / 8%); color: #0b1320; font-size: 14px; line-height: 1.45; }
.cchat__accueil[hidden] { display: none; }
.cchat__msg { display: flex; flex-direction: column; max-width: 85%; }
.cchat__msg--agent { align-self: flex-start; }
.cchat__msg--client { align-self: flex-end; align-items: flex-end; }
.cchat__texte { padding: 10px 12px; border-radius: 14px; color: #0b1320; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.cchat__msg--agent .cchat__texte { border-bottom-left-radius: 4px; background: #fff; box-shadow: 0 1px 2px rgb(11 19 32 / 8%); }
.cchat__msg--client .cchat__texte { border-bottom-right-radius: 4px; background: #1d9a4f; color: #fff; }
.cchat__msg.is-envoi .cchat__texte { opacity: .6; }
.cchat__texte a { color: inherit; font-weight: 600; text-decoration: underline; }
.cchat__heure { margin: 3px 4px 0; color: #3b4757; font-size: 11px; line-height: 1.2; }
.cchat__typing { flex: none; margin: 0; padding: 4px 14px 8px; background: #f4f7fb; color: #3b4757; font-size: 12px; font-style: italic; }
.cchat__typing[hidden] { display: none; }

/* Carte d'une fiche produit envoyée par l'agent : photo, nom, prix, puis « Ajouter au panier » (produit simple en
   stock) ou « Configurer » / « Voir la fiche ». Le lien lui-même n'apparaît pas dans la bulle. */
.cchat__texte.is-vide { display: none; }
.cchat__carte { display: flex; gap: 10px; width: min(100%, 300px); margin-top: 6px; padding: 8px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px #dfe6ee; color: #0b1320; }
.cchat__carte-img { display: block; flex: none; width: 76px; height: 76px; border-radius: 8px; background: #f4f7fb; overflow: hidden; }
.cchat__carte-img img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cchat__carte-corps { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
.cchat__carte-nom { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #0b1320; font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none; }
.cchat__carte-nom:hover { color: #1565d8; text-decoration: underline; }
.cchat__carte-prix { font-size: 13px; font-weight: 800; }
.cchat__carte-prix del { margin-right: 4px; color: #3b4757; font-weight: 500; }
.cchat__carte-prix ins { background: none; text-decoration: none; }
.cchat__carte-prix .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cchat__carte-prix .cuve-config__from, .cchat__carte-prix small { display: block; font-size: 11px; font-weight: 500; color: #3b4757; }
.cchat__carte-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 2px; }
.cchat__carte-add { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: #1d9a4f; color: #fff; font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1; text-decoration: none; cursor: pointer; }
.cchat__carte-add:hover { background: #17803f; color: #fff; text-decoration: none; }
.cchat__carte-add.is-busy { opacity: .7; }
.cchat__carte-on { display: none; }
.cchat__carte-add.is-done { background: #e6f6ec; color: #1d9a4f; box-shadow: inset 0 0 0 1.5px #1d9a4f; }
.cchat__carte-add.is-done .cchat__carte-off { display: none; }
.cchat__carte-add.is-done .cchat__carte-on { display: inline; }
.cchat__carte-lien { color: #1565d8; font-size: 12px; font-weight: 600; }

/* Panneaux d'état : fermé, appel seul, conversation terminée. */
.cchat__ferme, .cchat__appel, .cchat__ended { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; }
.cchat__ferme[hidden], .cchat__appel[hidden], .cchat__ended[hidden] { display: none; }
.cchat__ended { flex: none; border-top: 1px solid #dfe6ee; }
.cchat__ferme-titre { margin: 0; color: #0b1320; font-size: 16px; font-weight: 700; line-height: 1.3; }
.cchat__ferme-texte { margin: 0; color: #3b4757; font-size: 14px; line-height: 1.45; }
.cchat__btn { display: inline-block; padding: 10px 18px; border: 0; border-radius: 999px; background: #1d9a4f; color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.45; text-decoration: none; cursor: pointer; }
.cchat__btn:hover { background: #17803f; color: #fff; text-decoration: none; }
.cchat__lien { color: #1565d8; font-size: 14px; font-weight: 600; }

/* Saisie. */
.cchat__form { display: flex; flex: none; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #dfe6ee; background: #fff; }
.cchat__form[hidden] { display: none; }
.cchat__input { flex: 1 1 auto; min-height: 40px; max-height: 120px; padding: 9px 12px; border: 1px solid #dfe6ee; border-radius: 12px; background: #fff; color: #0b1320; font-family: inherit; font-size: 14px; line-height: 1.4; resize: none; }
.cchat__input:focus { border-color: #1d9a4f; outline: none; box-shadow: 0 0 0 3px rgb(29 154 79 / 18%); }
.cchat__send { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #1d9a4f; color: #fff; cursor: pointer; }
.cchat__send svg { width: 20px !important; height: 20px !important; min-width: 20px; }
.cchat__send:disabled { background: #dfe6ee; color: #3b4757; cursor: default; }
.cchat__erreur { flex: none; margin: 0; padding: 6px 14px 10px; color: #c0392b; font-size: 12px; font-weight: 600; }
.cchat__erreur[hidden] { display: none; }

/* Téléphone : la fenêtre prend l'écran, le libellé disparaît. */
@media (max-width: 767px) {
	.cchat { --cchat-right: 12px; --cchat-bottom: calc(12px + 0px); }
	.cchat__panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; max-height: 100dvh; border-radius: 0; }
	.cchat.is-open .cchat__bulle, .cchat.is-open .cchat__ondes, .cchat.is-open .cchat__tel { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.cchat__bulle { transition: none; }
	.cchat__ondes span, .cchat__callbar-texte::before { animation: none; }
}
.cchat__hbtn:disabled { opacity: .45; cursor: default; }
.cchat__hangup[hidden] { display: none; }

/* Conversations précédentes, gardées dans le navigateur : datées, un peu en retrait, au-dessus de la conversation en cours. */
.cchat__sep { align-self: center; margin: 6px 0 2px; color: #3b4757; font-size: 11px; font-weight: 600; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.cchat__msg.is-ancien { opacity: .72; }

/* Le thème blanchit tout bouton au survol (main.css, button:hover) : les boutons du chat gardent leur couleur. */
.cchat__bulle:hover, .cchat__bulle:focus-visible { background: #17803f; color: #fff; }
.cchat__send:hover:not(:disabled) { background: #17803f; color: #fff; }
.cchat__send:disabled:hover { background: #dfe6ee; color: #3b4757; }
.cchat__hbtn:hover { background: rgb(255 255 255 / 28%); color: #fff; }
.cchat__hangup:hover { background: #a93226; color: #fff; }
.cchat__btn:hover, .cchat__carte-add:hover { background: #17803f; color: #fff; }
.cchat__carte-add.is-done:hover { background: #e6f6ec; color: #1d9a4f; }

/* La coque d'appel (inc/chat.php) : pendant un appel, les pages suivantes se chargent dans ce cadre plein écran,
   la page qui tient l'appel reste derrière, cachée. */
html.cchat-shell-on, html.cchat-shell-on body { overflow: hidden !important; }
html.cchat-shell-on body > :not(.cchat-shell):not(call-us-selector):not(call-us-phone):not(script) { visibility: hidden !important; }
.cchat-shell { position: fixed; inset: 0; z-index: 100010; background: #fff; }
.cchat-shell__cadre { display: block; width: 100%; height: 100%; border: 0; }

/* Numéro de la conversation, sous l'état de l'agent : le visiteur et l'agent voient le même. */
.cchat__numero { font-size: 11px; line-height: 1.3; opacity: .85; font-variant-numeric: tabular-nums; }
.cchat__numero[hidden] { display: none; }

/* Les thèmes posent un padding et une hauteur de ligne sur tout bouton (7px 20px sur cuve.be) : les icônes des
   boutons ronds en sortaient de travers. Chaque bouton du chat repart de zéro. */
.cchat button { margin: 0; padding: 0; min-width: 0; min-height: 0; line-height: 1; text-transform: none; letter-spacing: normal; box-sizing: border-box; }
.cchat__tel, .cchat__bulle { padding: 0; }
.cchat__hbtn { width: 36px; height: 36px; padding: 0; }
.cchat__send { width: 40px; height: 40px; padding: 0; }
.cchat__carte-add { padding: 0 12px; }
.cchat__hangup { padding: 6px 12px; }
.cchat__btn { padding: 10px 18px; }
.cchat__notif-btn { padding: 8px 16px; }
.cchat__carte-accueil-corps { padding: 0; }
.cchat__ico, .cchat__hbtn svg, .cchat__send svg { display: block; margin: 0; }

/* Les icônes à deux états : la règle display:block ci-dessus rallumait la seconde, qui décalait la première. */
.cchat__ico--raccrocher { display: none; }
.cchat.is-call .cchat__ico--tel, .cchat.is-call-ailleurs .cchat__ico--tel { display: none; }
.cchat.is-call .cchat__ico--raccrocher, .cchat.is-call-ailleurs .cchat__ico--raccrocher { display: block; }
