/* 70.8 Popups — styles publics (couleurs / tailles injectées par popup) */
.spu-box, .spu-box *, .spu-bg { box-sizing: border-box; }
.spu-box[hidden], .spu-bg[hidden] { display: none !important; }

.spu-bg {
	position: fixed;
	inset: 0;
	z-index: 99999;
	opacity: 0;
	transition: opacity .4s ease;
}
.spu-bg.is-open { opacity: var(--spu-bg-opacity, .5); }

.spu-box {
	position: fixed;
	z-index: 999999;
	margin: 10px;
	max-width: calc(100% - 20px);
	max-height: calc(100vh - 20px);
	overflow: auto;
	opacity: 0;
	transition: opacity .4s ease, transform .4s ease;
}
.spu-box.is-open { opacity: 1; transform: none !important; }
.spu-box:focus { outline: none; }

/* Positions */
.spu-box.spu-centered { inset: 0; margin: auto; height: fit-content; }
.spu-box.spu-top-left { top: 0; left: 0; }
.spu-box.spu-top-right { top: 0; right: 0; }
.spu-box.spu-bottom-left { bottom: 0; left: 0; }
.spu-box.spu-bottom-right { bottom: 0; right: 0; }

.spu-box.spu-top-bar,
.spu-box.spu-bottom-bar {
	left: 0; right: 0;
	margin: 0;
	width: 100% !important;
	max-width: 100%;
	padding: 10px 30px !important;
	border-left: 0 !important;
	border-right: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	z-index: 1000;
}
.spu-box.spu-top-bar { top: 0; border-top: 0 !important; }
.spu-box.spu-bottom-bar { bottom: 0; border-bottom: 0 !important; }
.admin-bar .spu-box.spu-top-bar { top: 32px; }
.spu-box.spu-top-bar :is(h1, h2, h3, h4, h5, h6, p),
.spu-box.spu-bottom-bar :is(h1, h2, h3, h4, h5, h6, p) { margin: 0; }

/* Animation « glissement » : départ depuis le bord le plus proche */
.spu-box[data-animation="slide"] { transform: translateY(-40px); }
.spu-box[data-animation="slide"].spu-bottom-left,
.spu-box[data-animation="slide"].spu-bottom-right,
.spu-box[data-animation="slide"].spu-bottom-bar { transform: translateY(40px); }
.spu-box[data-animation="slide"].spu-top-bar { transform: translateY(-100%); }
.spu-box[data-animation="slide"].spu-bottom-bar { transform: translateY(100%); }
.spu-box[data-animation="disable"],
.spu-bg[data-animation="disable"] { transition: none; }

/* Contenu */
.spu-content > :first-child { margin-top: 0; padding-top: 0; }
.spu-content > :last-child { margin-bottom: 0; padding-bottom: 0; }
.spu-box img { max-width: 100%; height: auto; }
.spu-box iframe { max-width: 100%; }

/* Bouton de fermeture */
.spu-close {
	position: absolute;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.spu-close.top_right { top: 5px; right: 8px; }
.spu-close.top_left { top: 5px; left: 8px; }
.spu-close.bottom_right { bottom: 5px; right: 8px; }
.spu-close.bottom_left { bottom: 5px; left: 8px; }
.spu-content .spu-close-popup,
.spu-content .spu-close-convert { position: static; font-size: inherit; text-shadow: none; }

@media (max-width: 782px) {
	.admin-bar .spu-box.spu-top-bar { top: 46px; }
}
@media (max-width: 620px) {
	.spu-box { margin: 0; max-width: 100%; }
	.spu-box.spu-centered { max-height: 100vh; }
}
@media (prefers-reduced-motion: reduce) {
	.spu-box, .spu-bg { transition: none; }
}
