/* 
 * Mailjet Popup Lead Magnet V4 - CSS Unifié Simplifié
 * Templates conservés : Magazine (desktop) et Magazine Mobile
 * Version refactorisée - Templates obsolètes supprimés
 */

/* ============================================================================
   VARIABLES CSS GLOBALES
   ============================================================================ */
:root {
  --mplm-z-index: 9999;
  --mplm-border-radius: 12px;
  --mplm-transition: all 0.3s ease;
  --mplm-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ============================================================================
   STYLES DE BASE COMMUNS
   ============================================================================ */

/* Reset et styles de base */
#mailjet-popup * {
  box-sizing: border-box;
}

/* Styles de base pour le popup */
#mailjet-popup {
  position: fixed;
  display: none;
  z-index: var(--mplm-z-index);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mailjet-popup-content {
  position: relative;
}

/* Styles communs pour tous les boutons de fermeture */
#mailjet-popup-close {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--mplm-transition);
  z-index: 10;
}

/* Styles communs pour les iframes */
.mailjet-popup-content iframe {
  width: 100%;
  border: none;
  transition: height 0.3s ease;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

/* Animation magazineSlideUp - utilisée par Magazine Desktop */
@keyframes magazineSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Animation magazineMobileSlideUp - utilisée par Magazine Mobile */
@keyframes magazineMobileSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================================================
   TEMPLATE MAGAZINE (DESKTOP)
   ============================================================================ */

#mailjet-popup.template-magazine {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 700px;
  height: 420px;
  max-width: calc(100vw - 40px);
  display: none;
  z-index: 9999;
  animation: magazineSlideUp 0.4s ease-out;
}

#mailjet-popup.template-magazine .mailjet-popup-content {
  background: #3b9c92;
  background: linear-gradient(135deg, #3b9c92 0%, #63b6ac 100%);
  color: white;
  padding: 0;
  border-radius: 5px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: none;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: row;
  /* Décalage de 20px vers le haut */
  transform: translateY(-50px);
}

#mailjet-popup.template-magazine .magazine-left {
  flex: 1;
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#mailjet-popup.template-magazine .magazine-right {
  flex: 0 0 250px;
  background: url("../Capture.png") no-repeat center center;
  background-size: cover;
  position: relative;
}

#mailjet-popup.template-magazine .magazine-right::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(231, 76, 60, 0.1) 0%,
    transparent 50%
  );
}

#mailjet-popup.template-magazine #mailjet-popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  z-index: 10;
  font-weight: 300;
}

#mailjet-popup.template-magazine #mailjet-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

#mailjet-popup.template-magazine .magazine-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#mailjet-popup.template-magazine .magazine-subtitle {
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 1.2rem 0;
  line-height: 1.4;
  opacity: 0.95;
}

#mailjet-popup.template-magazine .magazine-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

#mailjet-popup.template-magazine .magazine-benefits li {
  padding: 0.3rem 0;
  font-size: 0.9rem;
  position: relative;
  padding-left: 0;
  line-height: 1.3;
}

#mailjet-popup.template-magazine .magazine-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  color: white;
  font-size: 1.2rem;
  top: 0.4rem;
}

#mailjet-popup.template-magazine .magazine-consent {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  line-height: 1.3;
}

#mailjet-popup.template-magazine .magazine-consent input[type="checkbox"] {
  margin-right: 0.6rem;
  margin-top: 0.1rem;
  transform: scale(1.1);
}

#mailjet-popup.template-magazine .mailjet-form-container {
  margin-top: 0;
}

#mailjet-popup.template-magazine .mailjet-popup-content iframe {
  width: 100%;
  min-height: 80px;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: height 0.3s ease;
}

/* ============================================================================
   TEMPLATE MAGAZINE MOBILE
   ============================================================================ */

#mailjet-popup.template-magazine-mobile {
  position: fixed;
  bottom: 1px;
  left: 1px;
  right: 1px;
  width: auto;
  max-width: 416px;
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  margin: 0 auto;
  display: none;
  z-index: 99999;
  animation: magazineMobileSlideUp 0.4s ease-out;
}

#mailjet-popup.template-magazine-mobile .mailjet-popup-content {
  background: #3b9c92;
  background: linear-gradient(135deg, #3b9c92 0%, #63b6ac 100%);
  color: white;
  padding: 0;
  border-radius: 0;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: none;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: row;
  transform: translateY(-45px);
}

#mailjet-popup.template-magazine-mobile .magazine-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  min-height: 100%;
}

/* Si seul le formulaire est présent, le centrer verticalement */
#mailjet-popup.template-magazine-mobile
  .magazine-left:has(.mailjet-form-container:only-child) {
  justify-content: center;
}

#mailjet-popup.template-magazine-mobile .magazine-right {
  flex: 0 0 40%;
  background: url("../Capture.png") no-repeat center center;
  background-size: cover;
  position: relative;
  min-height: 100%;
}

#mailjet-popup.template-magazine-mobile .magazine-right::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(231, 76, 60, 0.1) 0%,
    transparent 50%
  );
}

#mailjet-popup.template-magazine-mobile #mailjet-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  z-index: 100000;
  font-weight: 300;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#mailjet-popup.template-magazine-mobile #mailjet-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

#mailjet-popup.template-magazine-mobile .magazine-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

#mailjet-popup.template-magazine-mobile .magazine-subtitle {
  font-size: 13px;
  font-weight: 400;
  margin: 0;
  line-height: 1.2;
  opacity: 0.95;
  flex-shrink: 0;
}

#mailjet-popup.template-magazine-mobile .magazine-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  display: block;
}

#mailjet-popup.template-magazine-mobile .magazine-benefits li {
  padding: 2px 0;
  font-size: 11px;
  position: relative;
  padding-left: 0;
  line-height: 1.2;
  display: block;
}

#mailjet-popup.template-magazine-mobile .magazine-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  color: white;
  font-size: 1.2rem;
  top: 0.4rem;
}

#mailjet-popup.template-magazine-mobile .mailjet-form-container {
  margin-top: 6px;
  padding: 0;
  flex-shrink: 0;
  display: block;
}

/* Si c'est le seul élément, lui donner plus d'espace */
#mailjet-popup.template-magazine-mobile
  .magazine-left
  .mailjet-form-container:only-child {
  margin-top: 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
}

#mailjet-popup.template-magazine-mobile .mailjet-popup-content iframe {
  width: 100%;
  min-height: 40px;
  max-height: 300px !important;
  overflow: hidden;
  border: none;
  border-radius: 3px;
  background: transparent;
  transition: height 0.3s ease;
  display: block;
}

/* ============================================================================
   TEMPLATE MAGAZINE BOUTON (DESKTOP UNIQUEMENT)
   ============================================================================ */

#mailjet-popup.template-magazine-bouton {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 700px;
  height: 420px;
  max-width: calc(100vw - 40px);
  display: none;
  z-index: 9999;
  animation: magazineSlideUp 0.4s ease-out;
}

#mailjet-popup.template-magazine-bouton .mailjet-popup-content {
  background: #3b9c92;
  background: linear-gradient(135deg, #3b9c92 0%, #63b6ac 100%);
  color: white;
  padding: 0;
  border-radius: 5px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: none;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: row;
  /* Décalage de 20px vers le haut */
  transform: translateY(-50px);
}

#mailjet-popup.template-magazine-bouton .magazine-left {
  flex: 1;
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#mailjet-popup.template-magazine-bouton .magazine-right {
  flex: 0 0 250px;
  background: url("../Capture.png") no-repeat center center;
  background-size: cover;
  position: relative;
}

#mailjet-popup.template-magazine-bouton .magazine-right::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(231, 76, 60, 0.1) 0%,
    transparent 50%
  );
}

#mailjet-popup.template-magazine-bouton #mailjet-popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  z-index: 10;
  font-weight: 300;
}

#mailjet-popup.template-magazine-bouton #mailjet-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

#mailjet-popup.template-magazine-bouton .magazine-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#mailjet-popup.template-magazine-bouton .magazine-subtitle {
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 1.2rem 0;
  line-height: 1.4;
  opacity: 0.95;
}

#mailjet-popup.template-magazine-bouton .magazine-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

#mailjet-popup.template-magazine-bouton .magazine-benefits li {
  padding: 0.3rem 0;
  font-size: 0.9rem;
  position: relative;
  padding-left: 0;
  line-height: 1.3;
}

#mailjet-popup.template-magazine-bouton .magazine-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  color: white;
  font-size: 1.2rem;
  top: 0.4rem;
}

/* Styles spécifiques au bouton CTA */
#mailjet-popup.template-magazine-bouton .magazine-bouton-container {
  margin-top: 1.5rem;
}

#mailjet-popup.template-magazine-bouton .magazine-bouton-cta {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 1rem 2rem;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#mailjet-popup.template-magazine-bouton .magazine-bouton-cta:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

#mailjet-popup.template-magazine-bouton .magazine-bouton-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Contenu du magazine pour le template bouton */
#mailjet-popup.template-magazine-bouton .magazine-content {
  flex-grow: 1;
}

/* ============================================================================
   TEMPLATE MAGAZINE BOUTON MOBILE (MOBILE UNIQUEMENT)
   ============================================================================ */

#mailjet-popup.template-magazine-bouton-mobile {
  position: fixed;
  bottom: 1px;
  left: 1px;
  right: 1px;
  width: auto;
  max-width: 416px;
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  margin: 0 auto;
  display: none;
  z-index: 99999;
  animation: magazineMobileSlideUp 0.4s ease-out;
}

#mailjet-popup.template-magazine-bouton-mobile .mailjet-popup-content {
  background: #3b9c92;
  background: linear-gradient(135deg, #3b9c92 0%, #63b6ac 100%);
  color: white;
  padding: 0;
  border-radius: 0;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: none;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: row;
  transform: translateY(-45px);
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  min-height: 100%;
  padding: 12px;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-right {
  flex: 0 0 40%;
  background: url("../Capture.png") no-repeat center center;
  background-size: cover;
  position: relative;
  min-height: 100%;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-right::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(231, 76, 60, 0.1) 0%,
    transparent 50%
  );
}

#mailjet-popup.template-magazine-bouton-mobile #mailjet-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  z-index: 100000;
  font-weight: 300;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#mailjet-popup.template-magazine-bouton-mobile #mailjet-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-subtitle {
  font-size: 12px;
  font-weight: 400;
  margin: 0 0 6px 0;
  line-height: 1.2;
  opacity: 0.95;
  flex-shrink: 0;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
  flex-shrink: 0;
  display: block;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-benefits li {
  padding: 2px 0;
  font-size: 10px;
  position: relative;
  padding-left: 0;
  line-height: 1.2;
  display: block;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  color: white;
  font-size: 1.2rem;
  top: 0.4rem;
}

/* Contenu du magazine pour le template bouton mobile */
#mailjet-popup.template-magazine-bouton-mobile .magazine-content {
  flex-grow: 1;
}

/* Container et styles du bouton CTA pour mobile */
#mailjet-popup.template-magazine-bouton-mobile .magazine-bouton-container {
  margin-top: 8px;
  flex-shrink: 0;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-bouton-cta {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 150px;
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-bouton-cta:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

#mailjet-popup.template-magazine-bouton-mobile .magazine-bouton-cta:active {
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   RÈGLES DE MASQUAGE STRICT MOBILE/DESKTOP SIMPLIFIÉES
   ============================================================================ */

/* 
 * RÈGLES CRITIQUES : Masquage strict pour éviter l'affichage croisé
 * Simplifiées pour seulement 2 templates
 */

/* Sur mobile (≤768px) : masquer TOUS les templates desktop */
@media (max-width: 768px) {
  #mailjet-popup.template-magazine,
  #mailjet-popup.template-magazine-bouton {
    display: none !important;
  }
}

/* Sur desktop (≥769px) : masquer TOUS les templates mobile */
@media (min-width: 769px) {
  #mailjet-popup.template-magazine-mobile,
  #mailjet-popup.template-magazine-bouton-mobile {
    display: none !important;
  }
}

/* ============================================================================
   CLASSES ADDITIONNELLES POUR CONTRÔLE DEVICE
   ============================================================================ */

/* Classes utilitaires pour un contrôle plus fin */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
  .desktop-only {
    display: block !important;
  }
}


/* ============================================================================
   FIN DU FICHIER CSS UNIFIÉ REFACTORISÉ
   ============================================================================ */
