/* Widget flottant : bulle + Neflette (scroll vers le chat footer) */

.footer-chat-floating {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 999;
	display: block;
	width: auto;
	max-width: min(320px, calc(100vw - 32px));
	margin: 0;
	padding: 0 36px 36px 0;
	border: none;
	background: transparent;
	cursor: pointer;
	text-align: left;
	box-sizing: border-box;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s ease;
}

.footer-chat-floating__bubble {
	display: block;
	padding: 14px 18px 16px;
	background-color: #ffffff;
	border: 1.5px solid #E23D3D;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(34, 34, 34, 0.18);
}

.footer-chat-floating__text {
	display: block;
	font-family: "Lato", sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: #222222;
}

.footer-chat-floating__avatar {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	padding: 6px;
	border: 1.5px solid #E23D3D;
	border-radius: 50%;
	background-color: #ffffff;
	box-shadow: 0 4px 14px rgba(34, 34, 34, 0.2);
	line-height: 0;
	box-sizing: border-box;
}

.footer-chat-floating__avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center center;
}

.footer-chat-floating.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.footer-chat-floating:hover,
.footer-chat-floating:focus {
	transform: translateY(-2px);
}

.footer-chat-floating:hover .footer-chat-floating__bubble,
.footer-chat-floating:focus .footer-chat-floating__bubble {
	box-shadow: 0 6px 20px rgba(226, 61, 61, 0.28);
}

.footer-chat-floating:focus {
	outline: none;
}

.footer-chat-floating:focus-visible .footer-chat-floating__bubble {
	outline: 2px solid #222222;
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Chat MxChat embarqué dans le footer (NEFLETTE)
 * ------------------------------------------------------------------------- */

footer .container-fluid > .row:has(.col-widget-3--chat) {
	align-items: stretch;
}

footer .col-widget-3.col-widget-3--chat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	overflow-x: hidden;
	overflow-y: visible;
	padding-top: 40px !important;
	padding-bottom: 40px !important;
	/* style.css : 4vw / 12vw — décale le chat vers la gauche dans le dégradé */
	padding-left: 28px !important;
	padding-right: 28px !important;
	box-sizing: border-box;
}

footer .col-footer-newsletter.col-footer-newsletter--chat {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: none;
	margin: 0;
}

.footer-mxchat-row {
	display: grid;
	grid-template-columns: minmax(100px, 200px) minmax(240px, 360px);
	align-items: end;
	justify-content: center;
	width: min(100%, 536px);
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

.footer-mxchat-neflette {
	width: 100%;
	margin-right: -20px;
	position: relative;
	z-index: 2;
	pointer-events: none;
	line-height: 0;
}

.footer-mxchat-neflette__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(420px, 72vh);
	object-fit: contain;
	object-position: bottom left;
	filter: drop-shadow(0 6px 14px rgba(34, 34, 34, 0.2));
}

.footer-mxchat-row .footer-mxchat {
	display: flex;
	justify-content: flex-start;
	align-items: flex-end;
	width: 100%;
	min-width: 0;
	max-width: 360px;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.footer-mxchat {
	display: flex;
	justify-content: flex-start;
	align-items: flex-end;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

#footer-mxchat-chatbot.footer-mxchat .mxchat-chatbot-wrapper {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	border: 2px solid #E23D3D;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(34, 34, 34, 0.18);
	background-color: #ffffff;
	height: 420px !important;
	max-height: min(420px, 62vh) !important;
	overflow: hidden;
}

.footer-mxchat .mxchat-chatbot-wrapper .chatbot-top-bar {
	background: #E23D3D !important;
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	padding: 10px 14px;
	min-height: 52px;
}

.footer-mxchat .mxchat-chatbot-wrapper .chatbot-top-bar .chatbot-title {
	font-family: "Lato", sans-serif !important;
	font-weight: 700 !important;
	font-size: 16px !important;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #ffffff !important;
}

.footer-mxchat .mxchat-chatbot-wrapper .chatbot-top-bar .chat-mode-indicator {
	background: rgba(255, 255, 255, 0.2) !important;
	color: #ffffff !important;
	font-family: "Lato", sans-serif;
	font-size: 12px;
}

.footer-mxchat .mxchat-chatbot-wrapper .chatbot-top-bar .mxchat-header-btn,
.footer-mxchat .mxchat-chatbot-wrapper .chatbot-top-bar .mxchat-menu-trigger {
	color: #ffffff !important;
}

.footer-mxchat .mxchat-chatbot {
	background-color: #ffffff !important;
}

.footer-mxchat .mxchat-chatbot .chat-container .chat-box {
	padding: 16px 14px 8px;
	background-color: #ffffff;
}

.footer-mxchat .mxchat-chatbot .chat-container .chat-box .bot-message,
.footer-mxchat .mxchat-chatbot .chat-container .chat-box .agent-message,
.footer-mxchat .mxchat-chatbot .chat-container .chat-box .mxchat-intro-message {
	background: #E23D3D !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 12px !important;
	box-shadow: none !important;
}

.footer-mxchat .mxchat-chatbot .chat-container .chat-box .bot-message a {
	color: #ffffff !important;
}

.footer-mxchat .mxchat-popular-questions {
	padding: 0 14px 8px;
}

.footer-mxchat .mxchat-popular-questions-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	max-height: 220px;
}

.footer-mxchat .mxchat-popular-question {
	width: 100%;
	max-width: 320px;
	padding: 12px 16px;
	text-align: center;
	background-color: #ffffff;
	border: 1px solid #cccccc;
	border-radius: 8px;
	color: #222222;
	font-family: "Lato", sans-serif;
	font-size: 14px;
	line-height: 20px;
	box-shadow: none;
}

.footer-mxchat .mxchat-popular-question:hover {
	background-color: #f8f8f8;
	border-color: #aaaaaa;
	transform: none;
}

.footer-mxchat .mxchat-chatbot .chat-container .input-container {
	margin: 0 14px 12px;
	border: 1px solid #cccccc;
	border-radius: 10px;
	background-color: #ffffff;
}

.footer-mxchat .mxchat-chatbot .chat-container .input-container .chat-input {
	font-family: "Lato", sans-serif;
	font-size: 15px;
	color: #222222;
}

.footer-mxchat .mxchat-chatbot .chat-container .input-container .chat-input::placeholder {
	color: #888888;
}

.footer-mxchat .mxchat-chatbot-wrapper .chatbot-footer {
	padding: 8px 14px 12px;
	font-family: "Lato", sans-serif;
	color: #666666;
}

.footer-mxchat .mxchat-chatbot-wrapper .chatbot-footer .privacy-notice {
	font-weight: 400;
	color: #666666;
}

.footer-mxchat .mxchat-chatbot-wrapper .chatbot-footer .privacy-notice a {
	color: #E23D3D;
	font-weight: bold;
	text-decoration: none;
}

/* Colonne chat pleine largeur : bandeau orange sans coins gauche seuls */
@media screen and (max-width: 991px) {
	footer .col-widget-3.col-widget-3--chat {
		border-radius: 0 !important;
		padding-left: 20px !important;
		padding-right: 20px !important;
		justify-content: center;
	}

	.footer-mxchat-row {
		grid-template-columns: minmax(90px, 180px) minmax(220px, 1fr);
		width: min(100%, 560px);
	}

	.footer-mxchat-neflette {
		margin-right: -16px;
	}

	.footer-mxchat-neflette__img {
		max-height: min(380px, 55vh);
	}

	#footer-mxchat-chatbot.footer-mxchat .mxchat-chatbot-wrapper {
		height: min(400px, 58vh) !important;
		max-height: min(400px, 58vh) !important;
	}
}

/* 3 colonnes footer (lg+) : ensemble centré dans la colonne étroite */
@media screen and (min-width: 992px) and (max-width: 1399px) {
	footer .col-widget-3.col-widget-3--chat {
		padding-left: 10px !important;
		padding-right: 10px !important;
	}

	.footer-mxchat-row {
		grid-template-columns: minmax(88px, 170px) minmax(200px, 1fr);
		width: 100%;
	}

	.footer-mxchat-neflette__img {
		max-height: min(360px, 58vh);
	}

	.footer-mxchat-row .footer-mxchat {
		max-width: 100%;
	}

	#footer-mxchat-chatbot.footer-mxchat .mxchat-chatbot-wrapper {
		height: min(380px, 56vh) !important;
		max-height: min(380px, 56vh) !important;
	}

	.footer-mxchat .mxchat-popular-questions-container {
		max-height: 160px;
	}

	.footer-mxchat .mxchat-popular-question {
		max-width: 100%;
		padding: 10px 12px;
		font-size: 13px;
	}
}

@media screen and (min-width: 1400px) {
	.footer-mxchat-row {
		grid-template-columns: minmax(120px, 220px) minmax(280px, 360px);
		width: min(100%, 580px);
	}

	.footer-mxchat-neflette__img {
		max-height: min(440px, 68vh);
	}

	#footer-mxchat-chatbot.footer-mxchat .mxchat-chatbot-wrapper {
		height: 440px !important;
		max-height: min(440px, 65vh) !important;
	}
}

@media screen and (max-width: 767px) {
	.footer-chat-floating {
		right: 12px;
		bottom: 12px;
		max-width: min(280px, calc(100vw - 24px));
		padding: 0 30px 30px 0;
	}

	.footer-chat-floating__bubble {
		padding: 12px 14px 14px;
		border-radius: 10px;
	}

	.footer-chat-floating__text {
		font-size: 13px;
		line-height: 18px;
	}

	.footer-chat-floating__avatar {
		width: 56px;
		height: 56px;
		padding: 5px;
	}

	footer .col-widget-3.col-widget-3--chat {
		padding-left: 16px !important;
		padding-right: 16px !important;
		padding-top: 24px !important;
		padding-bottom: 28px !important;
	}

	/* Mobile : Neflette au-dessus du chat, ensemble centré */
	.footer-mxchat-row {
		display: grid;
		grid-template-columns: 1fr;
		justify-items: center;
		width: 100%;
		max-width: 420px;
	}

	.footer-mxchat-neflette {
		display: block;
		width: min(150px, 42vw);
		margin-right: 0;
		margin-bottom: -6px;
	}

	.footer-mxchat-neflette__img {
		max-height: min(180px, 28vh);
		object-position: bottom center;
	}

	.footer-mxchat-row .footer-mxchat {
		width: 100%;
		max-width: 100%;
		justify-content: center;
	}

	#footer-mxchat-chatbot.footer-mxchat .mxchat-chatbot-wrapper {
		margin-left: auto !important;
		margin-right: auto !important;
		max-width: 100% !important;
		height: min(400px, calc(100dvh - 200px)) !important;
		max-height: min(400px, calc(100dvh - 200px)) !important;
	}
}

@media screen and (max-width: 399px) {
	.footer-mxchat-neflette {
		width: min(130px, 46vw);
	}

	.footer-mxchat-neflette__img {
		max-height: min(150px, 26vh);
	}

	#footer-mxchat-chatbot.footer-mxchat .mxchat-chatbot-wrapper {
		height: min(380px, calc(100dvh - 190px)) !important;
		max-height: min(380px, calc(100dvh - 190px)) !important;
	}
}

/*
 * Scroll to top (legacy — réactiver avec le bouton commenté dans footer.php)
 *
 * #scrollToTop {
 *     display: none;
 *     position: fixed;
 *     bottom: 10px;
 *     right: 10px;
 *     z-index: 99;
 *     border: none;
 *     outline: none;
 *     background-color: #E23D3D !important;
 *     color: #ffffff !important;
 *     cursor: pointer;
 *     padding: 10px 15px;
 *     border-radius: 5px;
 *     font-size: 20px;
 * }
 *
 * #scrollToTop:hover {
 *     background-color: #E23D3D;
 * }
 */
