/**
 * cerda_popup — styles du popup léger PRDA.
 * Entièrement responsive : s'adapte à la largeur ET à la hauteur de l'écran,
 * avec défilement interne si le contenu dépasse.
 */

/* Empêche le défilement de l'arrière-plan quand le popup est ouvert. */
body.cerda-popup-open {
	overflow: hidden;
}

.cerda-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	/* padding = marge de sécurité sur petits écrans */
	padding: clamp(12px, 4vw, 40px);
	background: rgba(15, 23, 42, 0.6);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	overscroll-behavior: contain;
}

.cerda-popup-overlay[hidden] {
	display: none;
}

.cerda-popup-dialog {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 540px;
	/* s'adapte à la hauteur dispo ; dvh gère la barre d'adresse mobile */
	max-height: 90vh;
	max-height: 88dvh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #ffffff;
	color: #1f2937;
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
	padding: clamp(20px, 5vw, 36px);
	animation: cerda-popup-in 0.18s ease-out;
}

@keyframes cerda-popup-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.cerda-popup-dialog { animation: none; }
}

.cerda-popup-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #6b7280;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	border-radius: 8px;
	transition: background 0.15s, color 0.15s;
}

.cerda-popup-close:hover,
.cerda-popup-close:focus-visible {
	background: #f3f4f6;
	color: #111827;
	outline: none;
}

.cerda-popup-heading {
	margin: 0 34px 16px 0;
	font-size: clamp(1.25rem, 4vw, 1.6rem);
	line-height: 1.2;
	color: #0f172a;
}

.cerda-popup-body {
	font-size: clamp(0.95rem, 2.6vw, 1rem);
	line-height: 1.5;
}

/* Lignes d'information (adresse, téléphone, courriel, site) */
.cerda-popup__row {
	margin: 0 0 14px;
}

.cerda-popup__row:last-child {
	margin-bottom: 0;
}

.cerda-popup__label {
	display: block;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
	margin-bottom: 2px;
}

.cerda-popup__value {
	display: block;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.cerda-popup__value a {
	color: #1d4ed8;
	text-decoration: underline;
}

.cerda-popup__value a:hover {
	text-decoration: none;
}

/* Liste fallback [cerda_prda_liste] */
.cerda-prda-liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cerda-prda-liste a {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	text-decoration: none;
}

/* Très petits écrans : occuper presque toute la largeur */
@media (max-width: 480px) {
	.cerda-popup-dialog {
		max-width: 100%;
		border-radius: 12px;
	}
}
