@media (min-width: 992px) {
  .cta-sticky-card_cta {
    display:block; 
  }
  .cta-sticky-card__form {
    display:none; 
  }
}
@media (max-width: 992px) {
  .cta-sticky-card_cta {
    display:none; 
  }
  .cta-sticky-card__form {
    display:block; 
  }
}


/* ==========================================================================
RESET DU LIEN HUBSPOT (Pour qu'il agisse comme une DIV)
========================================================================== */
a.cta_button.legacy-sticky-card-cta {
  display: block !important;
  text-decoration: none !important;
  border: none !important;
  padding: 0 !important;
  width: 100%;
  color: inherit !important;
  background: transparent !important;
}

/* ==========================================================================
TON CSS D'ORIGINE (Réintégré)
========================================================================== */

.cp-card-sticky-cta-blog-post__content,
.cp-card-sticky-cta-blog-post__title {
  line-height: 1.2;
}
.cp-card-sticky-cta-blog-post__title {
  font-weight: 500;
}
/* Base de la carte */
.legacy-sticky-card-cta .cp-card-sticky-cta-blog-post {
  position: relative;
  background-color: #EDF4FF; /* Ta couleur de fond */
  overflow: hidden; /* Sécurité pour le border-radius */
}

/* Bouton fermeture mobile */
.legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: 20; /* Augmenté pour être sûr */
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  padding: 0;
}

.legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__close-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__close-btn svg {
  color: #131032;
}


.legacy-sticky-card-cta .fake-cta-button {
  color:#fff !important;
  background:#0e70e0;
  border-radius: 6px;
  font-weight: 500!important;
}
.legacy-sticky-card-cta:hover .fake-cta-button {
  background:#3993fb;
}

/* ==========================================================================
DESKTOP (>= 992px) - STICKY & IMAGE VISIBLE
========================================================================== */
@media (min-width: 992px) {
  /* 1. Le lien devient le conteneur Sticky */
  a.cta_button.legacy-sticky-card-cta {
    position: -webkit-sticky;
    position: sticky;
    top: 20px; /* Ajuster selon ton header */
    z-index: 90;
    margin-bottom: 40px;
  }

  /* 2. Style de la carte Desktop */
  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post {
    border-radius: 16px;
    /* Pas de sticky ici, c'est le parent <a> qui gère */
  }

  /* 3. RESTAURATION DE L'IMAGE (Ton code critique) */
  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__image-wrapper {
    position: relative;
    min-height: 320px; /* C'est ça qui rendait l'image visible ! */
    min-width: calc( 100% - 46px);
    display: block; /* Assure que le wrapper prend la place */
  }

  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__image-container {
    margin-top: 20px;
  }

  /* Positionnement absolu de l'image dans le wrapper */
  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__image {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 100%;
    max-width: none; /* Évite que l'image soit écrasée */
    width: 100%;
    object-fit: cover;
    object-position: top;
  }
  .legacy-sticky-card-cta .fake-cta-button {
    padding: 12px 16px !important;
  }
  .cp-card-sticky-cta-blog-post__title {
    font-size: 25px;
  }
}

/* ==========================================================================
MOBILE (< 992px) - FIXED BOTTOM BAR
========================================================================== */
@media (max-width: 991px) {

  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__image {
    display: none!important;
  }

  /* 1. Le lien devient la barre fixe */
  a.cta_button.legacy-sticky-card-cta {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999999 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  /* 2. Layout de la carte Mobile */
  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-radius: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    text-align: center;
  }

  /* 3. Afficher le bouton fermer */
  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__close-btn {
    display: flex;
    top: 12px; /* Sortir un peu de la carte */
    right: 10px;
    pointer-events: auto; /* CRITIQUE pour le JS */
  }

  /* 4. Masquer l'image sur mobile (comme souvent sur les sticky bars) */
  /* Si tu veux la garder, retire ce display:none, mais attention à la place */
  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__image-container {
    display: none; 
  }

  /* Ajustements texte mobile */
  .legacy-sticky-card-cta .cp-card-sticky-cta-blog-post__title {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: left;
    padding-right: 10px;
  }

  .legacy-sticky-card-cta .fake-cta-button {
    padding: 12px 16px !important;
    font-size: 16px !important;
  }
}

/* Classe utilitaire JS */
.legacy-sticky-card-cta.is-hidden {
  display: none !important;
}


/* ==========================================================================
5. OVERRIDE DU RESET HUBSPOT (CRITIQUE)
========================================================================== */
/* 
HubSpot force "margin: 0" et "padding: 0" sur tous les DIVs dans un CTA.
On doit réactiver tes classes utilitaires manuellement pour ce module.
*/

/* --- Desktop Overrides (>= 992px) --- */
@media (min-width: 992px) {
  /* Conteneur principal */
  .legacy-sticky-card-cta .pb-lg-48 { 
    padding-bottom: 48px !important; 
  }

  /* Contenu interne (Paddings) */
  .legacy-sticky-card-cta .pl-lg-46 { 
    padding-left: 46px !important; 
  }
  .legacy-sticky-card-cta .pt-lg-36 { 
    padding-top: 36px !important; 
  }
  .legacy-sticky-card-cta .pr-lg-46 { 
    padding-right: 46px !important; 
  }

  /* Marges du bouton (Margins) */
  .legacy-sticky-card-cta .mt-lg-26 { 
    margin-top: 26px !important; 
  }
  .legacy-sticky-card-cta .mb-lg-26 { 
    margin-bottom: 26px !important; 
  }

  /* Titre */
  .legacy-sticky-card-cta .pr-sm-36 {
    padding-right: 36px !important;
  }
}

/* --- Mobile Overrides (< 992px) --- */
@media (max-width: 991px) {
  /* On réactive les petits paddings mobile */
  .legacy-sticky-card-cta .pl-sm-14 { padding-left: 14px !important; }
  .legacy-sticky-card-cta .pr-sm-14 { padding-right: 14px !important; }
  .legacy-sticky-card-cta .pt-sm-14 { padding-top: 14px !important; }
  .legacy-sticky-card-cta .pb-sm-14 { padding-bottom: 14px !important; }

  /* Centrage texte mobile */
  .legacy-sticky-card-cta .txt-sm-center {
    text-align: center !important; 
  }
}

/* --- Correctif Flexbox HubSpot --- */
/* Parfois HubSpot casse aussi le display flex */
.legacy-sticky-card-cta .d-flex {
  display: flex !important;
}
.legacy-sticky-card-cta .justify-content-end {
  justify-content: flex-end !important;
}






/* ========================================
SURCHARGE FORMULAIRE HUBSPOT (Style Isolé)
======================================== */

/* Conteneur principal du formulaire : Style "Barre de recherche" */
.cta-sticky-card__form .hs-form {
  display: flex;
  gap: 0;
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0px 4px 4px 0px #0000000D;
  max-width: 500px;
  align-items: center;
  margin: 0;
  width: 100%;
  flex-wrap: nowrap; /* Assure que ça reste sur une ligne */
  padding: 5px;
}

/* Cache le label */
.cta-sticky-card__form .hs-form label {
  display: none!important;
}

/* Conteneur du champ email */
.cta-sticky-card__form .hs_email {
  flex: 1;
  margin: 0 !important;
  background: #FFFFFF;
  border-radius: 10px;
}

.cta-sticky-card__form .hs_email .input {
  margin: 0;
}

/* Style du champ input */
.cta-sticky-card__form .hs-input {
  width: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #333;
  height: auto !important;
}

.cta-sticky-card__form .hs-input::placeholder {
  color: #999;
}

.cta-sticky-card__form .hs-input:focus {
  outline: none;
  box-shadow: none !important;
}

/* Conteneur du bouton */
.cta-sticky-card__form .hs_submit {
  margin: 0 !important;
  flex-shrink: 0;
}

.cta-sticky-card__form .hs_submit .actions {
  margin: 0;
  padding: 0;
  font-weight: 700!important;
}

/* Style du bouton */
.cta-sticky-card__form .hs-button {
  background-color: #478AFF !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 10px !important;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700 !important;
  cursor: pointer;
  transition: background-color 150ms ease;
  white-space: nowrap;
  padding: 14px 22px !important;
  margin: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.cta-sticky-card__form .hs-button:hover {
  background-color: #0075F3 !important;
}

.cta-sticky-card__form .hs-button:active {
  background-color: #0075F3 !important;
}

/* Messages d'erreur */
.cta-sticky-card__form .hs-error-msgs {
  width: 100%;
  padding: 8px 16px;
  margin: 0;
  list-style: none;
}

.cta-sticky-card__form .hs-error-msg {
  color: #E74C3C;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

/* ========================================
MEDIA QUERIES - HERO FORM
======================================== */

.cta-sticky-card__form .hs_email input {
  padding: 8px 10px!important;
}

@media screen and (max-width: 991px) {
  .template-wrapper_card-sticky-cta-blog-post {
    z-index: 10;
  }

  .cta-sticky-card__form {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999999 !important;
    margin: 0 !important;
    width: 100% !important;

    /* Styles Mobile (Fond bleu + Padding + Centrage) */
    background-color: #EDF4FF;
    padding: 55px 30px 30px 14px; /* Padding right plus grand pour la croix */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .cta-sticky-card__form-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .cta-sticky-card__form .hs-button,
  .cta-sticky-card__form .hs-form .hs-input {
    text-align: center!important;
  }

}

@media screen and (max-width: 1170px) {
  .cta-sticky-card__form .hs_email input {
    padding-left: 5px!important;
    padding-right: 5px!important;
    font-size: 14px!important;
    min-height: auto!important;
  }

  .cta-sticky-card__form .hs-button {
    padding: 12px 20px!important;
    font-size: 15px!important;
  }

  {#.cta-sticky-card__form .hs-button,
  .cta-sticky-card__form .hs-form .hs-input {
    font-size: 12px!important;
  }#}
}

@media screen and (min-width: 1170px) {
  .cta-sticky-card__form .hs-button {
    font-weight: 700!important;
    padding: 14px 22px !important;
    font-size: 12px!important;
  }

  .cta-sticky-card__form .hs-form .hs-input {
    font-size: 14px!important;
  }
}


/* ========================================
FIX AUTOCOMPLETE (Fond bleu Chrome)
======================================== */
.cta-sticky-card__form input:-webkit-autofill,
.cta-sticky-card__form input:-webkit-autofill:hover, 
.cta-sticky-card__form input:-webkit-autofill:focus, 
.cta-sticky-card__form input:-webkit-autofill:active {
  /* On force le fond blanc (ou transparent si possible, mais blanc est plus sûr ici) */
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  /* On force la couleur du texte */
  -webkit-text-fill-color: #333 !important;
  transition: background-color 5000s ease-in-out 0s;
}



@media (min-width: 992px) {
  .template-wrapper_card-sticky-cta-blog-post {
    /* top 90 car espacement pour place du header sticky */
    top: 90px!important;
    position: -webkit-sticky;
    position: sticky;
  } 
} 