/* === POPUP DESIGN - VERSION CORRIGÉE AVEC OVERLAY DÉDIÉ === */

/* --- Variables de base --- */
:root {
  --popup-bg: #ffffff;
  --popup-text: #333333;
  --popup-primary-color: #007bff;
  --popup-primary-text: #ffffff;
  --popup-border-radius: 12px;
  --popup-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 
 * 1. NOUVEL OVERLAY DÉDIÉ (remplace body::before)
 *    C'est un véritable élément div qui sera créé par JavaScript.
*/
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 30, 30, 0.5); 
  z-index: 99998; /* z-index très élevé mais inférieur à celui de la popup */
  display: none; /* Caché par défaut, géré par JS */
  cursor: pointer; /* Indique qu'on peut cliquer pour fermer */
}

/* SUPPRIMÉ : L'ancienne règle "body.popup-is-open::before" a été enlevée. */

/* 2. STYLE DE BASE DE LA POPUP (légèrement modifié) */
.popup {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 90%;
  max-width: 450px;
  
  background-color: var(--popup-bg);
  border-radius: var(--popup-border-radius);
  box-shadow: var(--popup-shadow);
  /* MODIFIÉ : z-index encore plus élevé pour une sécurité maximale */
  z-index: 99999; 

  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* 3. STYLE DE LA POPUP VISIBLE */
.popup.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 4. STYLE DE LA CROIX DE FERMETURE (inchangé) */
.popup .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  font-size: 28px;
  font-weight: 300;
  color: #aaa;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
  z-index: 100000;
}

.popup .close:hover {
  color: #333;
  background-color: #f0f0f0;
}

/* 5. STYLE DU CONTENU INTÉRIEUR (inchangé) */
.popup .content {
  padding: 25px 35px;
  text-align: center;
}

.popup .content p {
  font-size: 17px;
  color: #555;
  line-height: 1.6;
  margin: 15px 0 30px;
}

/* 6. STYLE DU BOUTON (inchangé) */
.popup .content .button {
  display: inline-block;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background-color: var(--popup-primary-color);
  color: var(--popup-primary-text);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.popup .content .button:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}