/* ==========================================================================
   Delta Assistance — bulle d'aide
   Tout est préfixé #di-assist / .di-a- : aucun risque de collision avec le
   thème, Elementor ou WooCommerce. Les couleurs arrivent du PHP sous forme
   de variables (--di-a-navy, --di-a-orange…).
   ========================================================================== */

#di-assist {
	--di-a-navy: #12355B;
	--di-a-navy-dark: #0D2744;
	--di-a-sky: #79B5D3;
	--di-a-orange: #FF7400;
	--di-a-line: #E2E6EE;
	--di-a-ink: #1F2937;
	--di-a-ink-soft: #5B6472;

	--di-a-gap: 20px;
	--di-a-shift: 0px; /* relevé par le script : bandeau cookies, barre panier… */
	--di-a-radius: 14px;

	position: fixed;
	right: var(--di-a-gap);
	bottom: calc(var(--di-a-gap) + var(--di-a-shift));
	z-index: 100090; /* au-dessus du bandeau de consentement (100000) */
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--di-a-ink);
	-webkit-font-smoothing: antialiased;
	transition: bottom .22s ease;
}

#di-assist *,
#di-assist *::before,
#di-assist *::after {
	box-sizing: border-box;
}

#di-assist button {
	font: inherit;
	color: inherit;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	text-align: left;
}

/* -------------------------------------------------- bouton bulle ---------- */

#di-assist .di-a-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 56px;
	padding: 0 20px 0 18px;
	border-radius: 28px;
	background: var(--di-a-navy) !important;
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
	box-shadow: 0 6px 22px rgba(13, 39, 68, .28), 0 1px 2px rgba(13, 39, 68, .2);
	transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
	position: relative;
}

#di-assist .di-a-launcher:hover,
#di-assist .di-a-launcher:focus-visible {
	background: var(--di-a-navy-dark) !important;
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(13, 39, 68, .34);
}

#di-assist .di-a-launcher:focus-visible {
	outline: 3px solid var(--di-a-sky);
	outline-offset: 3px;
}

#di-assist .di-a-launcher__icon {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
}

#di-assist .di-a-launcher__icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

#di-assist .di-a-launcher__label {
	white-space: nowrap;
}

/* point d'attention, une seule fois par visite */
#di-assist .di-a-launcher__dot {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--di-a-orange);
	box-shadow: 0 0 0 2px var(--di-a-navy);
	opacity: 0;
	transform: scale(.4);
	transition: opacity .2s ease, transform .2s ease;
}

#di-assist[data-nudge="1"] .di-a-launcher__dot {
	opacity: 1;
	transform: scale(1);
}

#di-assist[data-nudge="1"] .di-a-launcher {
	animation: di-a-pulse 2.4s ease-in-out 2;
}

@keyframes di-a-pulse {
	0%, 100% { box-shadow: 0 6px 22px rgba(13, 39, 68, .28); }
	50%      { box-shadow: 0 6px 22px rgba(13, 39, 68, .28), 0 0 0 10px rgba(121, 181, 211, .22); }
}

/* état ouvert : la bulle devient une croix compacte */
#di-assist[data-open="1"] .di-a-launcher__label {
	display: none;
}

#di-assist[data-open="1"] .di-a-launcher {
	width: 56px;
	padding: 0;
	justify-content: center;
	animation: none;
}

#di-assist[data-open="1"] .di-a-launcher__dot {
	opacity: 0;
}

/* -------------------------------------------------- panneau --------------- */

#di-assist .di-a-panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 14px);
	width: 372px;
	max-width: calc(100vw - 32px);
	max-height: min(72vh, 620px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--di-a-line);
	border-radius: var(--di-a-radius);
	box-shadow: 0 18px 50px rgba(13, 39, 68, .22), 0 2px 8px rgba(13, 39, 68, .08);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

#di-assist[data-open="1"] .di-a-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
}

#di-assist .di-a-head {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 17px 18px 15px;
	background: var(--di-a-navy) !important;
	color: #fff !important;
}

#di-assist .di-a-head__back {
	display: none;
	place-items: center;
	width: 30px;
	height: 30px;
	margin: -3px 0 0 -6px;
	border-radius: 8px;
	flex: 0 0 30px;
	transition: background-color .15s ease;
}

#di-assist .di-a-head__back svg { width: 18px; height: 18px; display: block; }
#di-assist .di-a-head__back:hover { background: rgba(255, 255, 255, .14); }
#di-assist .di-a-head__back:focus-visible { outline: 2px solid var(--di-a-sky); outline-offset: 1px; }

#di-assist[data-view="detail"] .di-a-head__back { display: grid; }

#di-assist .di-a-head__text { min-width: 0; }

#di-assist .di-a-head__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .005em;
}

#di-assist .di-a-head__sub {
	margin: 3px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: rgba(255, 255, 255, .78);
}

#di-assist .di-a-body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* -------------------------------------------------- liste ---------------- */

#di-assist .di-a-list {
	margin: 0;
	padding: 6px 0;
	list-style: none;
}

#di-assist .di-a-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	padding: 12px 18px;
	background: transparent;
	border-bottom: 1px solid var(--di-a-line);
	transition: background-color .14s ease;
}

#di-assist .di-a-list li:last-child .di-a-item { border-bottom: 0; }

#di-assist .di-a-item:hover,
#di-assist .di-a-item:focus-visible {
	background: #F4F8FB;
}

#di-assist .di-a-item:focus-visible {
	outline: 2px solid var(--di-a-sky);
	outline-offset: -2px;
}

#di-assist .di-a-item__icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 9px;
	background: #EEF4F9;
	color: var(--di-a-navy);
	margin-top: 1px;
}

#di-assist .di-a-item__icon svg { width: 18px; height: 18px; display: block; }

#di-assist .di-a-item--accent .di-a-item__icon {
	background: rgba(255, 116, 0, .12);
	color: #C25800;
}

#di-assist .di-a-item__text { min-width: 0; flex: 1 1 auto; }

#di-assist .di-a-item__title {
	display: block;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--di-a-ink);
	line-height: 1.35;
}

#di-assist .di-a-item__sub {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	color: var(--di-a-ink-soft);
	line-height: 1.4;
}

#di-assist .di-a-item__chev {
	flex: 0 0 16px;
	margin-top: 9px;
	color: #A6B0BF;
}

#di-assist .di-a-item__chev svg { width: 16px; height: 16px; display: block; }

/* -------------------------------------------------- détail --------------- */

#di-assist .di-a-detail { padding: 16px 18px 20px; }

#di-assist .di-a-detail h3 {
	margin: 0 0 10px;
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--di-a-ink);
}

#di-assist .di-a-detail p {
	margin: 0 0 11px;
	font-size: 14px;
	line-height: 1.6;
	color: #37414F;
}

#di-assist .di-a-detail ul {
	margin: 0 0 11px;
	padding-left: 18px;
	font-size: 14px;
	line-height: 1.6;
	color: #37414F;
}

#di-assist .di-a-detail li { margin-bottom: 4px; }
#di-assist .di-a-detail strong { color: var(--di-a-ink); font-weight: 650; }
#di-assist .di-a-detail p:last-child, .di-a-detail ul:last-child { margin-bottom: 0; }

#di-assist .di-a-detail a { color: var(--di-a-navy); text-decoration: underline; }

/* -------------------------------------------------- actions -------------- */

#di-assist .di-a-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 16px;
	padding-top: 15px;
	border-top: 1px solid var(--di-a-line);
}

#di-assist .di-a-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	border-radius: 10px;
	border: 1px solid var(--di-a-line);
	background: #fff !important;
	color: var(--di-a-navy) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	text-align: center;
	transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}

#di-assist .di-a-btn svg { width: 17px; height: 17px; flex: 0 0 17px; }

#di-assist .di-a-btn:hover { background: #F4F8FB; border-color: var(--di-a-sky); }
#di-assist .di-a-btn:active { transform: translateY(1px); }
#di-assist .di-a-btn:focus-visible { outline: 3px solid var(--di-a-sky); outline-offset: 2px; }

#di-assist .di-a-btn--principal {
	background: var(--di-a-navy) !important;
	border-color: var(--di-a-navy);
	color: #fff !important;
}
#di-assist .di-a-btn--principal:hover { background: var(--di-a-navy-dark); border-color: var(--di-a-navy-dark); }

#di-assist .di-a-btn--accent {
	background: var(--di-a-orange) !important;
	border-color: var(--di-a-orange);
	color: #fff !important;
}
#di-assist .di-a-btn--accent:hover { background: #E66A00; border-color: #E66A00; }

/* -------------------------------------------------- pied ---------------- */

#di-assist .di-a-foot {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 18px;
	border-top: 1px solid var(--di-a-line);
	background: #FAFBFD;
	font-size: 12px;
	color: var(--di-a-ink-soft);
}

#di-assist .di-a-foot a { color: var(--di-a-ink-soft); text-decoration: underline; }
#di-assist .di-a-foot a:hover { color: var(--di-a-navy); }

#di-assist .di-a-foot__hours { display: inline-flex; align-items: center; gap: 6px; }

#di-assist .di-a-foot__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #39A85B;
	flex: 0 0 7px;
}

#di-assist .di-a-foot__dot--off { background: #B9C0CA; }

/* -------------------------------------------------- mobile -------------- */

@media (max-width: 600px) {

	#di-assist {
		--di-a-gap: 14px;
	}

	#di-assist .di-a-launcher {
		height: 52px;
		width: 52px;
		padding: 0;
		justify-content: center;
	}

	#di-assist .di-a-launcher__label { display: none; }

	#di-assist .di-a-panel {
		position: fixed;
		right: 0;
		left: 0;
		bottom: 0;
		width: auto;
		max-width: none;
		max-height: 86vh;
		border-radius: 16px 16px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		transform: translateY(14px);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	#di-assist .di-a-head { padding: 15px 16px 14px; }
	#di-assist .di-a-item { padding: 13px 16px; }
	#di-assist .di-a-detail { padding: 15px 16px 18px; }
}

@supports (max-height: 86dvh) {
	@media (max-width: 600px) {
		#di-assist .di-a-panel { max-height: 86dvh; }
	}
}

/* -------------------------------------------------- voile mobile -------- */

#di-assist .di-a-veil {
	position: fixed;
	inset: 0;
	background: rgba(13, 39, 68, .4);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s;
	z-index: -1;
}

@media (max-width: 600px) {
	#di-assist[data-open="1"] .di-a-veil {
		opacity: 1;
		visibility: visible;
	}
}

/* -------------------------------------------------- impression / a11y --- */

@media print {
	#di-assist { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	#di-assist,
	#di-assist * {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}

#di-assist .di-a-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
