/* CWA – Pop-up déménagement Moon v1.1.0 */

#cwa-moon-pop,
#cwa-moon-pop *,
#cwa-moon-bubble,
#cwa-moon-bubble * {
	box-sizing: border-box;
}

#cwa-moon-pop[hidden],
#cwa-moon-bubble[hidden] {
	display: none !important;
}

html.cmp-lock,
html.cmp-lock body {
	overflow: hidden !important;
}

/* ---------- Conteneur ---------- */

#cwa-moon-pop {
	--cmp-green: #729F83;
	--cmp-green-dark: #3E5F4B;
	--cmp-gold: #926E38;
	--cmp-gold-light: #F1DFB8;
	--cmp-cream: #F3EFE5;
	--cmp-ink: #333333;
	--cmp-text: #3F4041;
	--cmp-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
	--cmp-sans: Lato, Helvetica, Arial, sans-serif;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow: hidden;
	font-family: var(--cmp-sans);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

#cwa-moon-pop p,
#cwa-moon-pop h2 {
	margin: 0;
	padding: 0;
	border: 0;
	text-shadow: none;
}

#cwa-moon-pop img,
#cwa-moon-pop svg {
	display: block;
	max-width: none;
}

.cmp-overlay {
	position: absolute;
	inset: 0;
	background: rgba(44, 42, 39, 0.55);
	opacity: 0;
	transition: opacity 0.45s ease;
}

#cwa-moon-pop.is-open .cmp-overlay {
	opacity: 1;
}

#cwa-moon-pop.is-closing .cmp-overlay {
	opacity: 0;
	transition-duration: 0.42s;
}

/* ---------- Boîte ---------- */

.cmp-dialog {
	position: relative;
	display: flex;
	width: 820px;
	max-width: 100%;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	background: var(--cmp-green);
	border: 1px solid var(--cmp-gold);
	border-radius: 30px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	outline: 0;
	opacity: 0;
	transform-origin: 100% 100%;
	will-change: transform, opacity;
	isolation: isolate;
}

#cwa-moon-pop.is-open .cmp-dialog {
	animation: cmpIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#cwa-moon-pop.is-closing .cmp-dialog {
	animation: cmpOut 0.42s cubic-bezier(0.55, 0, 0.75, 0.4) forwards;
}

@keyframes cmpIn {
	from { opacity: 0; transform: translate(90px, 90px) scale(0.82); }
	to   { opacity: 1; transform: none; }
}

@keyframes cmpOut {
	from { opacity: 1; transform: none; }
	to   { opacity: 0; transform: translate(140px, 140px) scale(0.7); }
}

/* ---------- Bouton fermer ---------- */

#cwa-moon-pop .cmp-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--cmp-green);
	border-radius: 50%;
	background: transparent;
	color: var(--cmp-green);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

#cwa-moon-pop .cmp-close:hover,
#cwa-moon-pop .cmp-close:focus-visible {
	background: var(--cmp-green);
	color: #ffffff;
}

#cwa-moon-pop .cmp-close:focus-visible,
#cwa-moon-pop .cmp-btn:focus-visible,
#cwa-moon-bubble:focus-visible {
	outline: 2px solid var(--cmp-gold);
	outline-offset: 3px;
}

/* ---------- Colonne verte ---------- */

.cmp-side {
	position: relative;
	flex: 0 0 300px;
	display: flex;
	flex-direction: column;
	padding: 44px 36px 40px;
	color: #ffffff;
}

#cwa-moon-pop .cmp-mandala {
	position: absolute;
	left: -150px;
	bottom: -230px;
	width: 460px;
	height: 460px;
	opacity: 0.22;
	pointer-events: none;
}

.cmp-side-inner {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	text-align: center;
}

.cmp-top {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
}

#cwa-moon-pop .cmp-logo {
	width: 210px;
	height: auto;
}

#cwa-moon-pop .cmp-welcome {
	font-family: var(--cmp-serif);
	font-size: 26px;
	font-weight: 500;
	line-height: 1.3;
	color: #ffffff;
}

#cwa-moon-pop .cmp-welcome em {
	font-style: italic;
	color: var(--cmp-gold-light);
}

.cmp-blob {
	position: relative;
	padding: 22px 16px;
}

#cwa-moon-pop .cmp-blob svg {
	position: absolute;
	top: -8px;
	left: -14px;
	width: calc(100% + 28px);
	height: calc(100% + 16px);
	fill: var(--cmp-green-dark);
}

#cwa-moon-pop .cmp-blob p {
	position: relative;
	font-family: var(--cmp-sans);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: #ffffff;
	white-space: nowrap;
}

/* ---------- Colonne crème ---------- */

.cmp-main {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 20px;
	padding: 56px 48px 48px 72px;
	background: linear-gradient(to right, transparent 52px, var(--cmp-cream) 52px);
	color: var(--cmp-text);
	overflow: hidden;
}

.cmp-main > :not(svg) {
	position: relative;
}

#cwa-moon-pop .cmp-cream {
	fill: var(--cmp-cream);
}

#cwa-moon-pop .cmp-gold {
	fill: none;
	stroke: var(--cmp-gold);
	stroke-width: 1.2;
	opacity: 0.7;
	vector-effect: non-scaling-stroke;
}

#cwa-moon-pop .cmp-wave-v {
	position: absolute;
	top: -2px;
	left: -3px;
	width: 59px;
	height: calc(100% + 4px);
}

#cwa-moon-pop .cmp-wave-h {
	display: none;
}

#cwa-moon-pop .cmp-deco {
	position: absolute;
	right: -70px;
	bottom: -60px;
	width: 400px;
	height: 300px;
	pointer-events: none;
}

.cmp-head {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

#cwa-moon-pop .cmp-title {
	font-family: var(--cmp-serif);
	font-size: 42px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: 0;
	text-transform: none;
	color: var(--cmp-ink);
}

#cwa-moon-pop .cmp-sub {
	margin-top: 4px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--cmp-text);
}

.cmp-info {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

#cwa-moon-pop .cmp-eyebrow {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--cmp-gold);
}

#cwa-moon-pop .cmp-eyebrow svg {
	flex: 0 0 auto;
	color: var(--cmp-green);
}

#cwa-moon-pop .cmp-addr {
	padding-left: 30px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--cmp-text);
}

#cwa-moon-pop .cmp-addr strong {
	font-size: 17px;
	font-weight: 700;
	color: var(--cmp-ink);
}

#cwa-moon-pop .cmp-btn {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 15px;
	padding: 15px 30px;
	border: 0;
	border-radius: 0;
	background: var(--cmp-green);
	color: #ffffff;
	font-family: var(--cmp-sans);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 3px;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s;
}

#cwa-moon-pop .cmp-btn:hover,
#cwa-moon-pop .cmp-btn:focus-visible {
	background: var(--cmp-gold);
	color: #ffffff;
}

/* ---------- Tablette ---------- */

@media (max-width: 900px) {
	.cmp-dialog {
		width: 720px;
	}

	.cmp-side {
		flex-basis: 260px;
		padding: 40px 26px 36px;
	}

	#cwa-moon-pop .cmp-logo {
		width: 190px;
	}

	#cwa-moon-pop .cmp-welcome {
		font-size: 23px;
	}

	#cwa-moon-pop .cmp-blob p {
		font-size: 15px;
	}

	.cmp-main {
		padding: 52px 40px 44px 64px;
	}

	#cwa-moon-pop .cmp-title {
		font-size: 36px;
	}
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
	.cmp-dialog {
		flex-direction: column;
		width: 100%;
		transform-origin: 50% 100%;
	}

	#cwa-moon-pop.is-open .cmp-dialog {
		animation-name: cmpUp;
	}

	#cwa-moon-pop.is-closing .cmp-dialog {
		animation-name: cmpDown;
	}

	#cwa-moon-pop .cmp-close {
		top: 8px;
		right: 8px;
		border: 0;
		background: rgba(255, 255, 255, 0.18);
		color: #ffffff;
	}

	#cwa-moon-pop .cmp-close:hover,
	#cwa-moon-pop .cmp-close:focus-visible {
		background: rgba(255, 255, 255, 0.32);
	}

	.cmp-side {
		flex: none;
		padding: 18px 24px 20px;
	}

	#cwa-moon-pop .cmp-mandala {
		left: auto;
		right: -110px;
		bottom: -170px;
		width: 300px;
		height: 300px;
	}

	.cmp-side-inner {
		justify-content: flex-start;
		gap: 12px;
	}

	.cmp-top {
		gap: 10px;
	}

	#cwa-moon-pop .cmp-logo {
		width: 130px;
	}

	#cwa-moon-pop .cmp-welcome {
		max-width: 280px;
		font-size: 22px;
	}

	.cmp-blob {
		padding: 14px 24px;
	}

	#cwa-moon-pop .cmp-blob p {
		font-size: 15px;
	}

	.cmp-main {
		flex: none;
		align-items: center;
		gap: 12px;
		padding: 28px 24px 24px;
		text-align: center;
		background: linear-gradient(to bottom, transparent 19px, var(--cmp-cream) 19px);
	}

	#cwa-moon-pop .cmp-wave-v {
		display: none;
	}

	#cwa-moon-pop .cmp-wave-h {
		display: block;
		position: absolute;
		top: -3px;
		left: -2px;
		width: calc(100% + 4px);
		height: 25px;
	}

	#cwa-moon-pop .cmp-deco {
		right: -50px;
		bottom: -30px;
		width: 300px;
		height: 225px;
	}

	.cmp-head {
		align-items: center;
		gap: 4px;
	}

	#cwa-moon-pop .cmp-title {
		font-size: 32px;
	}

	#cwa-moon-pop .cmp-sub {
		max-width: 260px;
		font-size: 15px;
	}

	.cmp-info {
		align-items: center;
		gap: 4px;
	}

	#cwa-moon-pop .cmp-eyebrow {
		justify-content: center;
		gap: 5px;
		font-size: 12px;
	}

	#cwa-moon-pop .cmp-eyebrow svg {
		width: 20px;
		height: 20px;
	}

	#cwa-moon-pop .cmp-addr {
		padding-left: 0;
		font-size: 15px;
	}

	#cwa-moon-pop .cmp-addr strong {
		font-size: 16px;
	}

	#cwa-moon-pop .cmp-btn {
		align-self: stretch;
		padding: 15px 20px;
	}
}

/* Petits écrans en hauteur : on garde l'essentiel, sans défilement */
@media (max-width: 640px) and (max-height: 720px) {
	.cmp-blob {
		display: none;
	}

	#cwa-moon-pop .cmp-welcome {
		font-size: 19px;
	}

	#cwa-moon-pop .cmp-title {
		font-size: 28px;
	}

	.cmp-main {
		padding-top: 24px;
		padding-bottom: 20px;
	}
}

@media (min-width: 641px) and (max-height: 600px) {
	.cmp-blob {
		display: none;
	}

	.cmp-main {
		padding-top: 40px;
		padding-bottom: 36px;
	}
}

@keyframes cmpUp {
	from { opacity: 0; transform: translateY(40px) scale(0.96); }
	to   { opacity: 1; transform: none; }
}

@keyframes cmpDown {
	from { opacity: 1; transform: none; }
	to   { opacity: 0; transform: translateY(40px) scale(0.94); }
}

/* ---------- Bulle ---------- */

#cwa-moon-bubble {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	margin: 0;
	padding: 0;
	border: 3px solid #F3EFE5;
	border-radius: 50%;
	background: #729F83;
	color: #ffffff;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	opacity: 0;
	transform: scale(0.4);
	font-family: Lato, Helvetica, Arial, sans-serif;
	-webkit-tap-highlight-color: transparent;
}

#cwa-moon-bubble.is-visible {
	animation:
		cmpPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards,
		cmpPulse 2.6s ease-out 1.2s infinite;
}

#cwa-moon-bubble.is-leaving {
	animation: cmpPopOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

#cwa-moon-bubble > svg {
	position: relative;
	display: block;
}

.cmp-bubble-m {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	overflow: hidden;
}

#cwa-moon-bubble .cmp-bubble-m img {
	position: absolute;
	top: -25px;
	left: -25px;
	width: 120px;
	height: 120px;
	max-width: none;
	opacity: 0.35;
	animation: cmpSpin 40s linear infinite;
}

.cmp-label {
	position: absolute;
	top: 50%;
	right: 90px;
	padding: 12px 16px;
	background: #F3EFE5;
	color: #333333;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 2px;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	transform: translate(8px, -50%);
	transition: opacity 0.25s, transform 0.25s;
	pointer-events: none;
}

#cwa-moon-bubble:hover .cmp-label,
#cwa-moon-bubble:focus-visible .cmp-label {
	opacity: 1;
	transform: translate(0, -50%);
}

@keyframes cmpPop {
	from { opacity: 0; transform: scale(0.4); }
	to   { opacity: 1; transform: scale(1); }
}

@keyframes cmpPopOut {
	from { opacity: 1; transform: scale(1); }
	to   { opacity: 0; transform: scale(0.4); }
}

@keyframes cmpPulse {
	from { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(114, 159, 131, 0.5); }
	to   { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25), 0 0 0 16px rgba(114, 159, 131, 0); }
}

@keyframes cmpSpin {
	to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
	#cwa-moon-bubble {
		right: 18px;
		bottom: 22px;
		width: 64px;
		height: 64px;
	}

	#cwa-moon-bubble > svg {
		width: 26px;
		height: 26px;
	}

	#cwa-moon-bubble .cmp-bubble-m img {
		top: -21px;
		left: -21px;
		width: 100px;
		height: 100px;
	}
}

@media (max-width: 640px), (hover: none) {
	.cmp-label {
		display: none;
	}
}

/* ---------- Accessibilité / impression ---------- */

@media (prefers-reduced-motion: reduce) {
	#cwa-moon-pop .cmp-overlay {
		transition: none;
	}

	#cwa-moon-pop.is-open .cmp-dialog,
	#cwa-moon-pop.is-closing .cmp-dialog,
	#cwa-moon-bubble.is-visible,
	#cwa-moon-bubble.is-leaving,
	#cwa-moon-bubble .cmp-bubble-m img {
		animation: none;
	}

	#cwa-moon-pop.is-open .cmp-dialog,
	#cwa-moon-bubble.is-visible {
		opacity: 1;
		transform: none;
	}
}

@media print {
	#cwa-moon-pop,
	#cwa-moon-bubble {
		display: none !important;
	}
}
