/**
 * responsive-pages.css
 * Corrections responsive pour les pages internes Mon-Bonus-Malus.fr
 * 
 * Corrige :
 * - Box CTA "Vous souhaitez connaître..." qui déborde sur mobile
 * - Menu aside qui doit passer sous le contenu principal sur mobile
 * - Header responsive
 * - Divers éléments de mise en page
 */

/* =============================================
   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;
}

/* =============================================
   HEADER - Responsive pages internes
============================================= */
@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: 180px;
    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: 15px;
    margin-top: 5px;
    margin-bottom: 15px;
  }
}

/* =============================================
   SECTION PRESTEP-ARTICLE (CTA Box pages internes)
   La box doit être centrée et visible sur mobile
============================================= */
@media screen and (max-width: 991px) {
  .prestep-article {
    height: auto;
    min-height: auto;
    padding: 20px 0 30px 0;
    margin-top: 30px;
  }
  
  /* Supprimer les offsets sur tablette/mobile */
  .prestep-article .container .row > [class*="col-"] {
    margin-left: 0 !important;
    float: none;
  }
  
  .prestep-article .bloc-prestep {
    margin-top: 50px;
    margin-left: 15px;
    margin-right: 15px;
  }
}

@media screen and (max-width: 767px) {
  .prestep-article {
    padding: 15px 10px 25px 10px;
    margin-top: 20px;
    /* Fond atténué sur mobile */
    background-image: linear-gradient(rgba(48, 56, 51, 0.8), rgba(48, 56, 51, 0.8)), url('../visu/voiture-visuel.jpg');
  }
  
  /* Box CTA en pleine largeur */
  .prestep-article .bloc-prestep {
    margin: 45px 0 0 0;
    width: 100%;
    max-width: 100%;
    display: block;
  }
  
  /* Header de la box */
  .prestep-article .bloc-prestep header {
    width: 100%;
    display: block;
    text-align: center;
    border-radius: 10px 10px 0 0;
    padding: 45px 15px 20px 15px;
  }
  
  .prestep-article .bloc-prestep header h2 {
    font-size: 18px;
    line-height: 1.3;
  }
  
  .prestep-article .bloc-prestep header h2 br {
    display: none;
  }
  
  /* Picto centré en haut */
  .prestep-article .bloc-prestep header .picto-prestep {
    top: -42px;
    left: 50%;
    margin-left: -42px;
    margin-top: 0;
  }
  
  /* Content de la box */
  .prestep-article .bloc-prestep .content-prestep {
    width: 100%;
    display: block;
    text-align: center;
    padding: 20px 15px 25px 15px;
  }
  
  .prestep-article .bloc-prestep .content-prestep .accroche-prestep {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 15px;
  }
  
  .prestep-article .bloc-prestep .content-prestep .accroche-prestep br {
    display: none;
  }
  
  /* Cacher la flèche sur mobile */
  .prestep-article .bloc-prestep .content-prestep img {
    display: none;
  }
  
  /* Bouton responsive */
  .prestep-article .bloc-prestep .content-prestep .bouton {
    padding: 12px 25px 10px 25px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* =============================================
   SECTION EDITO - Layout Main + Aside
   Aside passe EN DESSOUS du contenu sur mobile
============================================= */

/* Reset des push/pull sur mobile */
@media screen and (max-width: 767px) {
  /* Annuler les push/pull Bootstrap pour mobile */
  .edito .row > [class*="col-md-push-"],
  .edito .row > [class*="col-sm-push-"],
  .edito .row > [class*="col-md-pull-"],
  .edito .row > [class*="col-sm-pull-"] {
    left: auto;
    right: auto;
  }
  
  /* Utiliser flexbox pour réordonner */
  .edito .container > .row {
    display: flex;
    flex-direction: column;
  }
  
  /* Main content en premier */
  .edito .container > .row > .col-md-8,
  .edito .container > .row > .col-sm-7 {
    order: 1;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Aside en second (après le contenu) */
  .edito .container > .row > .col-md-4,
  .edito .container > .row > .col-sm-5 {
    order: 2;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 40px;
  }
}

/* Styles edito responsive */
@media screen and (max-width: 767px) {
  .edito {
    margin-top: 20px;
    padding: 0 10px;
  }
  
  .edito .main article header {
    margin-bottom: 30px;
  }
  
  .edito .main article header h1 {
    font-size: 24px;
    line-height: 1.3;
  }
  
  .edito .main article header .intro,
  .edito .main article header em {
    font-size: 14px;
    line-height: 1.5;
  }
  
  .edito .main article h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .edito .main article p {
    font-size: 15px;
    line-height: 1.6;
  }
  
  .edito .main article ul {
    margin: 20px 0;
    padding-left: 10px;
  }
  
  .edito .main article ul li {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
  }
  
  /* Footer article - fiches précédente/suivante */
  .edito .main article footer .row {
    display: flex;
    flex-direction: column;
  }
  
  .edito .main article footer .col-xs-12 {
    margin-bottom: 50px;
  }
  
  .edito .main article footer .col-xs-12:last-child {
    margin-top: 0;
    text-align: left;
  }
  
  .edito .main article footer .bloc-lien-article a {
    left: 15px;
    right: 15px;
  }
  
  .edito .main article footer .col-xs-12:last-child a {
    left: 15px;
    right: 15px;
  }
}

/* =============================================
   ASIDE - Styles responsive
============================================= */
@media screen and (max-width: 767px) {
  aside {
    padding: 0 5px;
  }
  
  aside .bloc-gris {
    margin-bottom: 25px;
    padding: 20px 15px;
  }
  
  aside .bloc-gris header {
    margin-bottom: 15px;
  }
  
  aside .bloc-gris header img {
    max-width: 40px;
  }
  
  aside .bloc-gris header h3 {
    font-size: 18px;
  }
  
  aside .bloc-gris ul li {
    padding: 8px 0;
  }
  
  aside .bloc-gris ul li a {
    font-size: 15px;
  }
  
  aside .annonce {
    margin-bottom: 25px;
  }
  
  aside .annonce img {
    width: 100%;
    height: auto;
  }
}

/* =============================================
   QUIZ - Responsive
============================================= */
@media screen and (max-width: 767px) {
  .edito .main .quiz {
    margin-top: 40px;
    padding: 0 5px;
  }
  
  .edito .main .quiz header {
    margin-bottom: 20px;
  }
  
  .edito .main .quiz header img {
    max-width: 50px;
  }
  
  .edito .main .quiz header h2 {
    font-size: 20px;
  }
  
  .edito .main .quiz .ligne-question {
    padding: 20px 10px 40px 10px;
    margin-bottom: 15px;
  }
  
  .edito .main .quiz .ligne-question .question {
    font-size: 15px;
    margin-bottom: 15px;
  }
  
  .edito .main .quiz .ligne-question .bloc-input-label {
    display: block;
    margin: 10px 5px;
    width: calc(100% - 10px);
  }
}

/* =============================================
   COMMENTAIRES - Responsive
============================================= */
@media screen and (max-width: 767px) {
  .edito .main .commentaire {
    margin-top: 40px;
  }
  
  .edito .main .commentaire header {
    margin-bottom: 20px;
  }
  
  .edito .main .commentaire header img {
    max-width: 50px;
  }
  
  .edito .main .commentaire header h2 {
    font-size: 20px;
  }
  
  .edito .main .commentaire ul li {
    display: flex;
    flex-direction: column;
    padding: 15px 10px;
    margin-bottom: 10px;
  }
  
  .edito .main .commentaire ul li .partie-gauche {
    margin-bottom: 10px;
  }
  
  .edito .main .commentaire ul li .partie-gauche h3,
  .edito .main .commentaire ul li .partie-gauche p {
    font-size: 12px;
  }
  
  .edito .main .commentaire ul li .partie-droite h3 {
    font-size: 14px;
    margin-bottom: 5px;
  }
  
  .edito .main .commentaire ul li .partie-droite p {
    font-size: 14px;
    line-height: 1.5;
  }
  
  .edito .main .commentaire .plus-commentaire {
    width: 100%;
    padding: 12px 15px;
  }
}

/* =============================================
   FORMULAIRE COMMENTAIRE - Responsive
============================================= */
@media screen and (max-width: 767px) {
  .edito .main .laisser-commentaire {
    margin-top: 30px;
    padding: 0 5px;
  }
  
  .edito .main .laisser-commentaire h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .edito .main .laisser-commentaire form .row {
    margin-bottom: 15px;
  }
  
  .edito .main .laisser-commentaire form label {
    font-size: 14px;
    margin-bottom: 5px;
  }
  
  .edito .main .laisser-commentaire form input,
  .edito .main .laisser-commentaire form textarea {
    width: 100%;
    padding: 10px;
    font-size: 16px;
  }
  
  .edito .main .laisser-commentaire form textarea {
    min-height: 120px;
  }
  
  .edito .main .laisser-commentaire form .petit-bouton {
    width: 100%;
    margin-top: 15px;
  }
}

/* =============================================
   FOOTER - Responsive
============================================= */
@media screen and (max-width: 767px) {
  footer {
    padding: 20px 15px;
    margin-top: 30px;
  }
  
  footer .container {
    padding: 0;
  }
  
  footer p {
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
  }
  
  footer a {
    display: inline-block;
    padding: 3px 5px;
  }
}

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

/* =============================================
   FIX OFFSETS SUR MOBILE
============================================= */
@media screen and (max-width: 767px) {
  /* Annuler tous les offsets sur mobile */
  [class*="col-md-offset-"],
  [class*="col-lg-offset-"],
  [class*="col-sm-offset-"],
  .col-lg-offset-1, .col-lg-offset-2, .col-lg-offset-3, .col-lg-offset-4,
  .col-md-offset-1, .col-md-offset-2, .col-md-offset-3, .col-md-offset-4 {
    margin-left: 0 !important;
  }
  
  /* Annuler les push/pull sur mobile */
  [class*="col-md-push-"],
  [class*="col-md-pull-"],
  [class*="col-sm-push-"],
  [class*="col-sm-pull-"] {
    left: auto !important;
    right: auto !important;
  }
  
  /* Toutes les colonnes en pleine largeur */
  .col-xs-12,
  [class*="col-md-"],
  [class*="col-sm-"],
  [class*="col-lg-"] {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* =============================================
   IMAGES RESPONSIVE
============================================= */
img {
  max-width: 100%;
  height: auto;
}

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