/**
 * responsive-home.css
 * Corrections responsive pour la page d'accueil Mon-Bonus-Malus.fr
 * 
 * Corrige :
 * - Box CTA "Vous souhaitez connaître..." hors champ sur mobile
 * - Image et texte "Le Bonus Malus en quelques mots" mal positionnés
 * - Header qui déborde
 * - UX globale sur mobile
 */

/* =============================================
   GLOBAL - Empêcher tout débordement horizontal
============================================= */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  max-width: 100%;
  padding-left: 15px;
  padding-right: 15px;
}

.row {
  margin-left: -15px;
  margin-right: -15px;
}

/* =============================================
   HEADER - Responsive
============================================= */
@media screen and (max-width: 767px) {
  .header-principal {
    margin-top: 15px;
    padding: 0 10px;
  }
  
  .header-principal .partie-logo {
    text-align: center;
    margin-bottom: 15px;
  }
  
  .header-principal .partie-logo a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .header-principal .partie-logo a img {
    max-width: 200px;
    height: auto;
  }
  
  .header-principal .partie-logo a p {
    margin-left: 0;
    margin-top: 5px;
    font-size: 14px;
    text-align: center;
  }
  
  .header-principal .accroche {
    text-align: center;
    padding: 0 10px;
  }
  
  .header-principal .accroche h1,
  .header-principal .accroche span {
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 15px;
  }
}

/* =============================================
   SECTION PRESTEP (CTA Box) - Mobile
   La box doit être centrée et visible sur mobile
============================================= */
@media screen and (max-width: 991px) {
  .prestep-home {
    min-height: auto;
    padding: 30px 0 50px 0;
    margin-top: 30px;
    background-position: center center;
    background-size: cover;
  }
  
  /* Masquer les angles décoratifs sur mobile */
  .prestep-home:before,
  .prestep-home:after {
    display: none;
  }
  
  /* Centrer la box CTA */
  .prestep-home .container .row {
    justify-content: center;
  }
  
  .prestep-home .container .row > [class*="col-"] {
    margin-left: 0 !important;
    float: none;
  }
}

@media screen and (max-width: 767px) {
  .prestep-home {
    padding: 20px 15px 40px 15px;
    margin-top: 20px;
    /* Sur mobile, on réduit l'importance du background voiture */
    background-image: linear-gradient(rgba(48, 56, 51, 0.85), rgba(48, 56, 51, 0.85)), url('../visu/voiture-visuel.jpg');
  }
  
  /* La box CTA prend toute la largeur disponible */
  .prestep-home .bloc-prestep {
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
  }
  
  .prestep-home .bloc-prestep header {
    padding: 45px 15px 20px 15px;
  }
  
  .prestep-home .bloc-prestep header h2 {
    font-size: 20px;
    line-height: 1.3;
  }
  
  .prestep-home .bloc-prestep header h2 br {
    display: none;
  }
  
  .prestep-home .bloc-prestep .content-prestep {
    padding: 25px 15px 40px 15px;
  }
  
  .prestep-home .bloc-prestep .content-prestep .accroche-prestep {
    font-size: 16px;
    line-height: 22px;
    margin-bottom: 20px;
  }
  
  .prestep-home .bloc-prestep .content-prestep .avantage-prestep {
    font-size: 14px;
    margin-bottom: 15px;
  }
  
  /* Cacher la flèche décorative sur mobile */
  .prestep-home .bloc-prestep .content-prestep img {
    display: none;
  }
  
  /* Bouton responsive */
  .prestep-home .bloc-prestep .content-prestep .bouton {
    padding: 15px 30px 12px 30px;
    font-size: 18px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* =============================================
   SECTION OUTILS - Responsive
============================================= */
@media screen and (max-width: 767px) {
  .outils-home {
    padding-bottom: 15px;
  }
  
  .outils-home:after {
    display: none;
  }
  
  .outils-home header {
    padding: 15px 10px;
  }
  
  .outils-home header img {
    max-width: 60px;
  }
  
  .outils-home header h2 {
    font-size: 20px;
    line-height: 1.3;
  }
  
  .outils-home header h2 br {
    display: none;
  }
}

/* =============================================
   SECTION PRESENTATION "Qui sommes-nous"
============================================= */
@media screen and (max-width: 991px) {
  .presentation {
    margin-bottom: 40px;
  }
  
  .presentation .texte-presentation {
    margin-top: 30px;
    text-align: center;
    padding: 0 15px;
  }
  
  .presentation .texte-presentation h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }
  
  .presentation .texte-presentation p {
    text-align: left;
    line-height: 1.5;
  }
  
  .presentation .voiture-presentation {
    text-align: center;
    padding: 0 20px;
  }
  
  .presentation .voiture-presentation img {
    max-width: 80%;
    height: auto;
  }
}

@media screen and (max-width: 767px) {
  .presentation {
    margin-bottom: 30px;
  }
  
  .presentation .texte-presentation {
    margin-top: 20px;
  }
  
  .presentation .texte-presentation .bouton {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 20px 12px 20px;
    font-size: 18px;
  }
}

/* =============================================
   SECTION ARTICLE HOME - "Le Bonus Malus en quelques mots"
   Image au-dessus du titre sur mobile
============================================= */
@media screen and (max-width: 991px) {
  .article-home .int-article-home {
    margin-top: 60px;
    margin-bottom: 60px;
  }
  
  .article-home .int-article-home header {
    margin-bottom: 0;
    position: relative;
  }
  
  .article-home .int-article-home header img {
    position: relative;
    top: auto;
    left: auto;
    max-width: 80px;
    margin-bottom: 10px;
  }
  
  .article-home .int-article-home header h2 {
    font-size: 20px;
    padding: 8px 15px;
  }
}

@media screen and (max-width: 767px) {
  .article-home .int-article-home {
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 0 10px;
  }
  
  .article-home .int-article-home header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: -15px;
  }
  
  .article-home .int-article-home header img {
    max-width: 60px;
    margin-bottom: 8px;
  }
  
  .article-home .int-article-home header h2 {
    font-size: 16px;
    padding: 8px 12px;
  }
  
  .article-home .int-article-home .content-article {
    padding-top: 40px;
    padding-bottom: 25px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Row en flexbox avec ordre inversé sur mobile */
  .article-home .int-article-home .content-article .article-content-row {
    display: flex;
    flex-direction: column;
  }
  
  /* Image en premier sur mobile */
  .article-home .int-article-home .content-article .article-image-col {
    order: 1;
    margin-bottom: 20px;
    margin-left: 0 !important;
    width: 100%;
  }
  
  /* Texte en second */
  .article-home .int-article-home .content-article .article-text-col {
    order: 2;
    width: 100%;
  }
  
  /* Image responsive dans la box */
  .article-home .int-article-home .content-article .image-article {
    text-align: center;
    padding: 0;
  }
  
  .article-home .int-article-home .content-article .image-article img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
  }
  
  /* Texte bien aligné et centré */
  .article-home .int-article-home .content-article .texte-article {
    text-align: center;
    padding: 0;
  }
  
  .article-home .int-article-home .content-article .texte-article p {
    text-align: left;
    padding: 0;
    line-height: 1.5;
    font-size: 15px;
  }
  
  .article-home .int-article-home .content-article .texte-article .bouton {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 20px 12px 20px;
    font-size: 18px;
    margin-top: 20px;
  }
}

/* =============================================
   LISTE ARTICLES (Fiches pratiques)
============================================= */
@media screen and (max-width: 767px) {
  .liste-article header {
    margin-bottom: 30px;
    padding: 0 15px;
  }
  
  .liste-article header img {
    max-width: 50px;
  }
  
  .liste-article header h2 {
    font-size: 20px;
    margin-top: 15px;
    line-height: 1.3;
  }
  
  .liste-article .bloc-lien-article {
    margin-bottom: 60px;
    margin-left: 10px;
    margin-right: 10px;
  }
  
  .liste-article .bloc-lien-article a {
    left: 15px;
    right: 15px;
    padding: 18px 10px;
    font-size: 14px;
  }
}

/* =============================================
   FOOTER - Responsive
============================================= */
@media screen and (max-width: 767px) {
  footer {
    padding: 20px 15px;
  }
  
  footer .container {
    padding: 0;
  }
  
  footer p {
    font-size: 14px;
    line-height: 1.6;
  }
  
  footer a {
    display: inline-block;
    padding: 5px 0;
  }
}

/* =============================================
   BOUTONS - Mobile général
============================================= */
@media screen and (max-width: 767px) {
  .bouton {
    padding: 15px 25px 12px 25px;
    font-size: 18px;
  }
  
  .petit-bouton {
    padding: 10px 18px 8px 18px;
    font-size: 14px;
  }
}

/* =============================================
   CALCULATRICE BONUS - Mobile
============================================= */
@media screen and (max-width: 767px) {
  .bonus-calculator-advanced {
    padding: 15px !important;
    margin: 10px !important;
  }
  
  .bonus-calculator-advanced h2 {
    font-size: 20px !important;
    line-height: 1.3 !important;
  }
  
  .bonus-calculator-advanced .intro {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }
  
  .bonus-calc-layout {
    flex-direction: column !important;
  }
  
  .bonus-calc-form-col,
  .bonus-calc-preview-col {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .bonus-calc-section-title {
    font-size: 16px !important;
  }
  
  .bonus-calc-radio-content {
    padding: 10px !important;
  }
  
  .bonus-calc-radio-label {
    font-size: 14px !important;
  }
  
  .bonus-calc-radio-desc {
    font-size: 12px !important;
  }
}

/* =============================================
   UTILITAIRES RESPONSIVE
============================================= */

/* Cacher sur mobile uniquement */
@media screen and (max-width: 767px) {
  .hidden-mobile {
    display: none !important;
  }
}

/* Cacher sur tablette et desktop */
@media screen and (min-width: 768px) {
  .visible-mobile-only {
    display: none !important;
  }
}

/* Texte responsive */
@media screen and (max-width: 767px) {
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
  
  p, li, span, a {
    font-size: 15px;
  }
}

/* =============================================
   FIX POUR LES COLONNES OFFSET SUR MOBILE
   Les offsets ne doivent pas s'appliquer sur mobile
============================================= */
@media screen and (max-width: 767px) {
  [class*="col-md-offset-"],
  [class*="col-lg-offset-"],
  .col-md-offset-1, .col-md-offset-2, .col-md-offset-3, .col-md-offset-4,
  .col-md-offset-5, .col-md-offset-6, .col-md-offset-7, .col-md-offset-8,
  .col-lg-offset-1, .col-lg-offset-2, .col-lg-offset-3, .col-lg-offset-4,
  .col-lg-offset-5, .col-lg-offset-6, .col-lg-offset-7, .col-lg-offset-8 {
    margin-left: 0 !important;
  }
  
  /* Toutes les colonnes prennent 100% sur mobile */
  .col-xs-12 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* =============================================
   FIX DÉBORDEMENT IMAGES
============================================= */
img {
  max-width: 100%;
  height: auto;
}

.container img,
.row img,
[class*="col-"] img {
  max-width: 100%;
  height: auto;
}
