/* ------------------------ */
/* -------- POPUP -------- */
/* ------------------------ */

.sba-popup {
	--sba-popup-gold: #c59d5f;
	--sba-popup-bg: #141414;
	--sba-popup-text: #fff;
	--sba-popup-muted: rgba(255, 255, 255, 0.75);
	--sba-popup-line: rgba(255, 255, 255, 0.15);

	box-sizing: border-box;
	width: 100%;
	max-width: min(960px, calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 1px solid var(--sba-popup-gold);
	border-radius: 0;
	background: var(--sba-popup-bg);
	color: var(--sba-popup-text);
	overflow: auto;
	overscroll-behavior: contain;
}

.sba-popup::backdrop {
	background: rgba(0, 0, 0, 0.7);
}

html:has(.sba-popup[open]) {
	overflow: hidden;
}

.sba-popup *,
.sba-popup *::before,
.sba-popup *::after {
	box-sizing: border-box;
}

.sba-popup__inner {
	display: grid;
	grid-template-columns: 1fr;
}

.sba-popup--has-image .sba-popup__inner {
	grid-template-columns: 9fr 11fr;
}

.sba-popup__media {
	align-self: center;
	display: grid;
	/* Les images restent dans le cadre, quelle que soit leur taille d'origine */
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	overflow: hidden;
	margin: 24px 0 24px 24px;
	/* Format de l'affiche épilation : les photos sont recadrées à ce format */
	aspect-ratio: 800 / 1105;
	/* Sur un écran peu haut, l'image rétrécit au lieu de faire défiler la popup */
	max-height: calc(100dvh - 82px);
}

/* Images et textes des offres sont superposés : seule l'offre active est visible */
.sba-popup__image,
.sba-popup__slide {
	grid-area: 1 / 1;
	visibility: hidden;
	opacity: 0;
}

.sba-popup__image.is-active,
.sba-popup__slide.is-active {
	visibility: visible;
	opacity: 1;
}

.sba-popup__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sba-popup__content {
	display: flex;
	flex-direction: column;
	padding: 56px 40px 40px;
}

.sba-popup--has-image .sba-popup__content {
	padding-left: 32px;
}

.sba-popup__title {
	margin: 0;
	color: var(--sba-popup-text);
	font-size: 32px;
	line-height: 1.2;
	text-align: center;
}

.sba-popup__intro {
	margin: 16px 0 0;
	color: var(--sba-popup-muted);
	font-size: 16px;
	line-height: 1.6;
}

.sba-popup__carousel {
	display: flex;
	flex: 1;
	flex-direction: column;
	margin-top: 32px;
}

.sba-popup__slides {
	display: grid;
	margin-bottom: 24px;
}

.sba-popup__item-title {
	margin: 0;
	color: var(--sba-popup-text);
	font-size: 20px;
	line-height: 1.3;
}

.sba-popup__badge {
	display: inline-block;
	margin-left: 8px;
	padding: 3px 8px;
	background: var(--sba-popup-gold);
	color: #000;
	font-family: inherit;
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
	vertical-align: middle;
}

.sba-popup__item-desc {
	margin: 12px 0 0;
	color: var(--sba-popup-muted);
	font-size: 15px;
	line-height: 1.6;
}

/* Navigation du diaporama */
.sba-popup__nav {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid var(--sba-popup-line);
}

.sba-popup__dots {
	display: flex;
	align-items: center;
}

.sba-popup__arrow,
.sba-popup__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--sba-popup-text);
	cursor: pointer;
	transition: color 0.3s;
}

.sba-popup__dot {
	width: 28px;
}

.sba-popup__dot::before {
	content: "";
	width: 10px;
	height: 10px;
	border: 1px solid var(--sba-popup-gold);
	border-radius: 50%;
	transition: background-color 0.3s;
}

.sba-popup__dot[aria-current="true"]::before {
	background: var(--sba-popup-gold);
}

.sba-popup__arrow:hover {
	color: var(--sba-popup-gold);
}

.sba-popup__dot:hover::before {
	background: var(--sba-popup-gold);
}

.sba-popup__toggle {
	margin-left: auto;
}

.sba-popup__toggle .sba-popup__icon-play,
.sba-popup__toggle.is-paused .sba-popup__icon-pause {
	display: none;
}

.sba-popup__toggle.is-paused .sba-popup__icon-play {
	display: block;
}

.sba-popup__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: auto;
	padding-top: 24px;
}

.sba-popup__btn {
	flex: 1 1 180px;
	padding: 15px;
	border: 1px solid var(--sba-popup-gold);
	background: var(--sba-popup-gold);
	color: #000 !important;
	font-size: 0.75rem;
	font-weight: bold;
	letter-spacing: 0.05em;
	text-align: center;
	text-transform: uppercase;
	transition: background-color 0.3s, color 0.3s;
}

.sba-popup__btn:hover {
	background: transparent;
	color: var(--sba-popup-gold) !important;
}

.sba-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--sba-popup-bg);
	color: var(--sba-popup-text);
	cursor: pointer;
	transition: color 0.3s;
}

.sba-popup__close:hover {
	color: var(--sba-popup-gold);
}

.sba-popup__btn:focus-visible,
.sba-popup__close:focus-visible,
.sba-popup__arrow:focus-visible,
.sba-popup__dot:focus-visible {
	outline: 2px solid var(--sba-popup-gold);
	outline-offset: 2px;
}

.sba-popup [hidden] {
	display: none !important;
}

.sba-popup .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.sba-popup[open] {
		animation: sba-popup-in 0.4s ease-out;
	}

	.sba-popup[open]::backdrop {
		animation: sba-popup-fade 0.4s ease-out;
	}

	.sba-popup__image,
	.sba-popup__slide {
		transition: opacity 0.6s ease, visibility 0.6s;
	}
}

@keyframes sba-popup-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

@keyframes sba-popup-fade {
	from {
		opacity: 0;
	}
}

@media only screen and (max-width: 700px) {
	.sba-popup--has-image .sba-popup__inner {
		grid-template-columns: 1fr;
	}

	.sba-popup__media {
		margin: 16px 16px 0;
		aspect-ratio: auto;
		height: 36vh;
	}

	/* En hauteur réduite, l'image est affichée en entier (texte de l'affiche lisible) */
	.sba-popup__image img {
		object-fit: contain;
	}

	.sba-popup__carousel {
		margin-top: 20px;
	}

	.sba-popup__content {
		padding: 28px 20px 24px;
	}

	.sba-popup__title {
		font-size: 26px;
	}
}
