/* MIP Annonces – bandeau */

.mipa-root[hidden] {
	display: none !important;
}

.mipa-root--sticky {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 9990;
}

.mipa-bar {
	--mipa-bg: #c60275;
	--mipa-fg: #fff;
	--mipa-link: #fff;
	--mipa-btn-bg: #ffcc00;
	--mipa-btn-fg: #111;
	position: relative;
	z-index: 9990;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	padding: 0 8px 0 16px;
	box-sizing: border-box;
	background-color: var(--mipa-bg);
	background-image: linear-gradient(100deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.12) 100%);
	color: var(--mipa-fg);
	font-family: inherit;
	/* Police du site (Elementor) si elle est définie. */
	font-family: var(--e-global-typography-text-font-family), system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	opacity: 0;
	transform: translateY(-100%);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.mipa-bar *,
.mipa-bar *::before,
.mipa-bar *::after {
	box-sizing: border-box;
}

.mipa-bar--bottom {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	transform: translateY(100%);
	box-shadow: 0 -4px 20px rgba(17, 17, 17, 0.15);
}

.mipa-bar.mipa-is-visible {
	opacity: 1;
	transform: none;
}

.mipa-bar.mipa-is-leaving {
	opacity: 0;
}

.mipa-bar__viewport {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 0;
	overflow: hidden;
}

/* --- Contenu d'une annonce ------------------------------------------- */

.mipa-item {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	max-width: 100%;
}

.mipa-item__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: var(--mipa-fg);
}

.mipa-item__text {
	min-width: 0;
}

.mipa-item__text strong,
.mipa-item__text b {
	font-weight: 600;
}

.mipa-item__text a {
	color: var(--mipa-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.mipa-bar .mipa-item__btn {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 0;
	border-radius: 3px;
	background: var(--mipa-btn-bg);
	color: var(--mipa-btn-fg);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.mipa-bar .mipa-item__btn::after {
	content: "\2192";
	font-weight: 500;
	transition: transform 0.15s ease;
}

.mipa-bar .mipa-item__btn:hover,
.mipa-bar .mipa-item__btn:focus-visible {
	color: var(--mipa-btn-fg);
	filter: brightness(0.96);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
	transform: translateY(-1px);
}

.mipa-bar .mipa-item__btn:hover::after {
	transform: translateX(3px);
}

.mipa-bar a:focus-visible,
.mipa-bar__ctrl:focus-visible {
	outline: 2px solid var(--mipa-fg);
	outline-offset: 2px;
}

/* --- Texte fixe ------------------------------------------------------- */

.mipa-bar--static {
	justify-content: center;
	padding: 0 52px;
}

.mipa-bar--static .mipa-bar__viewport {
	display: flex;
	justify-content: center;
	padding: 10px 0;
}

.mipa-bar--static .mipa-bar__controls {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
}

.mipa-bar--list .mipa-bar__viewport {
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.mipa-slide[hidden] {
	display: none;
}

.mipa-bar--rotate .mipa-slide {
	animation: mipa-fade 0.45s ease;
}

@keyframes mipa-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* --- Texte défilant --------------------------------------------------- */

.mipa-bar--marquee .mipa-bar__viewport {
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.mipa-marquee {
	display: flex;
	width: max-content;
	animation: mipa-scroll var(--mipa-duration, 20s) linear infinite;
	will-change: transform;
}

.mipa-marquee__group {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	white-space: nowrap;
}

.mipa-marquee .mipa-item {
	flex-wrap: nowrap;
	white-space: nowrap;
}

.mipa-marquee__sep {
	padding: 0 28px;
	opacity: 0.6;
}

.mipa-bar--marquee:hover .mipa-marquee,
.mipa-bar--marquee:focus-within .mipa-marquee,
.mipa-bar.mipa-is-paused .mipa-marquee {
	animation-play-state: paused;
}

@keyframes mipa-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

/* --- Boutons de contrôle ---------------------------------------------- */

.mipa-bar__controls {
	display: flex;
	flex: 0 0 auto;
	gap: 2px;
}

.mipa-bar .mipa-bar__ctrl {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--mipa-fg);
	opacity: 0.8;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s, opacity 0.15s;
}

.mipa-bar .mipa-bar__ctrl:hover {
	background: rgba(255, 255, 255, 0.16);
	color: var(--mipa-fg);
	opacity: 1;
}

.mipa-bar__preview {
	position: absolute;
	top: 3px;
	left: 4px;
	padding: 0 6px;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	pointer-events: none;
}

/* --- Petits écrans ---------------------------------------------------- */

@media (max-width: 760px) {
	.mipa-bar {
		padding-left: 14px;
		font-size: 14px;
	}

	.mipa-bar--static {
		padding: 0 46px 0 14px;
	}

	.mipa-bar--static .mipa-bar__viewport {
		justify-content: flex-start;
		padding: 12px 0;
	}

	.mipa-bar--static .mipa-item {
		display: grid;
		grid-template-columns: auto 1fr;
		gap: 8px 10px;
		align-items: start;
	}

	.mipa-bar--static .mipa-item__icon {
		width: 26px;
		height: 26px;
		margin-top: -2px;
	}

	.mipa-bar--static .mipa-item__icon svg {
		width: 16px;
		height: 16px;
	}

	/* Sans icône, le texte et le bouton occupent toute la largeur. */
	.mipa-bar--static .mipa-item:not(:has(.mipa-item__icon)) {
		grid-template-columns: 1fr;
	}

	.mipa-bar--static .mipa-item__btn {
		grid-column: -2 / -1;
		justify-self: start;
		padding: 6px 12px;
		font-size: 13px;
	}

	.mipa-bar--static .mipa-bar__controls {
		top: 8px;
		right: 6px;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mipa-bar {
		transition: none;
		transform: none;
	}

	.mipa-marquee,
	.mipa-bar--rotate .mipa-slide {
		animation: none;
	}

	.mipa-bar .mipa-item__btn,
	.mipa-bar .mipa-item__btn::after {
		transition: none;
	}
}

@media print {
	.mipa-root {
		display: none !important;
	}
}
