/* =========================================================
   3. BLOCS FEATURES (Grille de 3)
========================================================= */
.tf-features {
  position: relative;
  z-index: 10;
  isolation: isolate;
  background: #8e6ce1;
  padding: 90px 40px;
  color: #fff;
}

.tf-features-grid, 
.tf-features-grid-secure {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
  gap: 30px !important;
  max-width: 1300px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* CARTE INDIVIDUELLE */
.tf-features-grid-secure .tf-feature-card,
.tf-features-grid .tf-feature-card {
  flex: 0 0 31% !important; 
  width: 31% !important;
  max-width: 420px !important;
  margin: 0 !important;
  float: none !important; 
  display: block !important;
  background: #fff;
  border-radius: 24px;
  padding: 34px 30px 38px;
  text-align: center;
  color: #333;
  box-shadow: 0 25px 50px rgba(0,0,0,.12);
  position: relative;
}

.tf-feature-card > img { display: block; width: 260px; max-width: 100%; height: auto; margin: 0 auto 18px; }
.tf-feature-card > h2 { font-size: 20px; font-weight: 800; margin: 0 0 10px; color: #4a3d6b; }
.tf-feature-card p { font-size: 14px; line-height: 1.45; color: #777; margin: 0; }
.tf-feature-short { margin: 0 0 14px; }

/* SUB FEATURES (Contenu caché) */
.tf-subfeatures-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 25px;
    text-align: left;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.tf-subfeature strong { display: block; color: #bd3535; font-size: 13px; font-weight: 800; text-transform: uppercase; margin-bottom: 2px; }
.tf-subfeature p { font-size: 13px; line-height: 1.4; color: #555; margin: 0; }
.tf-feature-outro { margin-top: 20px !important; font-weight: 700; color: #111 !important; font-style: italic; text-align: center; }

/* =========================================================
   4-5. INTRO
========================================================= */
.tf-feature-intro { max-width: 1300px; margin: 80px auto 60px; padding: 0 40px; }
.tf-feature-intro-row { display: flex; align-items: center; gap: 60px; max-width: 1300px; margin: 10px auto 60px; padding: 0 40px; }
.tf-feature-intro-textcol { flex: 0 0 66.666%; } .tf-feature-intro-imgcol  { flex: 0 0 33.333%; }
.tf-feature-intro-title { font-size: 34px; font-weight: 900; margin-bottom: 18px; color: #222; }
.tf-feature-intro-text { font-size: 16px; line-height: 1.7; color: #555; margin-bottom: 16px; }

/* =========================================================
   7. UTILITAIRES & RESPONSIVE GLOBAL
========================================================= */
.tf-section-divider, .tf-section-divider1 { max-width: 200px; height: 1px; margin: 30px auto 40px; background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,.15), rgba(0,0,0,0)); }

/* Visibilité forcée */
.tf-features .tf-features-kicker, .tf-features .tf-features-title, .tf-features .tf-features-intro, .tf-features .tf-feature-card > h2, .tf-features .tf-feature-card > p.tf-feature-short {
  display: block !important; visibility: visible !important; opacity: 1 !important; height: auto !important; max-height: none !important; overflow: visible !important;
}

/* Mobile: Tout en 1 colonne */
@media (max-width: 991px) {
  .tf-features-grid, .tf-features-grid-secure { display: block !important; padding: 0 20px; }
  .tf-features-grid-secure .tf-feature-card, .tf-features-grid .tf-feature-card { width: 100% !important; max-width: none !important; margin-bottom: 30px !important; flex: none !important; }
  .tf-subfeatures-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   8. STYLE BOUTONS V3 (TECH / BOLD) - VALIDÉ
========================================================= */
.tf-inject-btn {
    display: inline-block;
    position: relative;
    
    /* Couleurs & Fond */
    background-color: #f5f5f5; /* Gris très clair au repos */
    color: #333; /* Texte sombre */
    
    /* Typographie Forte */
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 900; /* Très gras */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    /* Forme */
    padding: 14px 28px;
    border: none; /* Pas de bordure */
    border-radius: 6px; /* Coins à peine arrondis */
    
    cursor: pointer;
    margin-top: 20px;
    
    /* Transition */
    transition: all 0.2s ease-out;
    overflow: hidden; /* Pour l'effet de remplissage */
    z-index: 1;
    text-align: center;
}

/* Effet de barre latérale rouge au repos */
.tf-inject-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background-color: #bd3535;
    transition: width 0.3s ease;
    z-index: -1;
}

/* 2. ETAT SURVOL (HOVER) - Le rouge envahit tout */
.tf-inject-btn:hover, 
.tf-inject-btn.active {
    color: #fff;
    padding-left: 35px; /* Petit décalage du texte */
}

.tf-inject-btn:hover::before,
.tf-inject-btn.active::before {
    width: 100%; /* Le rouge remplit tout le bouton */
}

/* 3. BOUTON FERMER (Carré et minimaliste) */
.tf-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #bd3535;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tf-close-btn:hover {
    background: #333;
    color: #fff;
}

/* =========================================================
   9. LA ZONE DYNAMIQUE (Cadre net)
========================================================= */
.tf-dynamic-zone {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.5s;
    opacity: 0;
    background: #fff;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    border-radius: 4px;
}

.tf-dynamic-zone.is-active {
    max-height: 2000px;
    opacity: 1;
    margin-top: 40px;
    margin-bottom: 40px;
    border-left: 5px solid #bd3535; /* Rappel de la couleur à gauche */
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.tf-panel-inner {
    padding: 40px 50px;
    position: relative;
}

/* CORRECTIF PRESTASHOP : Masquer les sources en bas de page */
.tf-sources-container {
    display: none !important;
}
.tf-dynamic-zone:not(.is-active) {
    display: none !important;
    max-height: 0;
    padding: 0; margin: 0; border: none;
}

/* =========================================================
   10. UX MOBILE : MODE "MODAL/POPUP"
========================================================= */
@media (max-width: 768px) {
    
    .tf-dynamic-zone.is-active {
        /* Position fixe par-dessus tout */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        z-index: 99999 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        
        /* Design */
        background: #fff !important;
        padding: 60px 20px 20px 20px !important;
        overflow-y: auto !important;
        box-shadow: none !important;
        border-left: none !important;
    }

    /* Le bouton fermer doit être bien visible en haut à droite */
    .tf-close-btn {
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 100000 !important;
        background: #bd3535 !important;
        color: #fff !important;
        border: none !important;
        padding: 8px 15px !important;
        border-radius: 50px !important;
        font-size: 14px !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
    }

    .tf-panel-inner {
        padding: 0 !important;
        padding-top: 20px !important;
    }

    /* Optionnel : Assombrir le fond */
    .tf-dynamic-zone.is-active::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: #fff;
        z-index: -1;
    }
}

/* =========================================================
   VARIANTE E — MINIMAL LUXE (FINAL) — DESKTOP ONLY
   (SAFE: scoped + only when the panel is open)
========================================================= */
@media (min-width: 769px) {

  /* Grille 2 colonnes + spacing premium */
  .tf-dynamic-zone.is-active .tf-subfeatures-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 80px;
    align-items: start;
    text-align: left;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
  }

  /* Items */
  .tf-dynamic-zone.is-active .tf-subfeature{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 12px;
  }

  /* Titres */
  .tf-dynamic-zone.is-active .tf-subfeature strong{
    display: block;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .3px;
    color: #111;
    text-transform: none;
    margin-bottom: 0;
  }

  /* Texte */
  .tf-dynamic-zone.is-active .tf-subfeature p{
    font-size: 14px;
    color: #777;
    margin: 4px 0 0;
    line-height: 1.55;
  }

  /* Divider entre items (on garde la logique "2 derniers sans border") */
  .tf-dynamic-zone.is-active .tf-subfeature:not(:nth-last-child(-n+2)){
    border-bottom: 1px solid rgba(0,0,0,.05);
  }

  /* Padding panel (uniquement quand ouvert) */
  .tf-dynamic-zone.is-active .tf-panel-inner{
    padding: 50px 70px;
  }

  /* Outro + divider au-dessus */
  .tf-dynamic-zone.is-active .tf-feature-outro{
    margin-top: 50px !important;
    text-align: center;
    font-style: normal;
    font-size: 13px;
    letter-spacing: .3px;
    color: #555 !important;
    font-weight: 400;
  }

  .tf-dynamic-zone.is-active .tf-feature-outro::before{
    content: '';
    display: block;
    width: 180px;
    height: 1px;
    margin: 0 auto 30px;
    background: linear-gradient(
      to right,
      rgba(0,0,0,0),
      rgba(0,0,0,.15),
      rgba(0,0,0,0)
    );
  }

}