.services-bg-1,
.services-bg-2,
.services-bg-3,
.services-bg-4,
.services-bg-5 {
  width: 100%;
  height: 100%;
  min-height: 350px;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Chemins d'images */
.services-bg-1 {
  background-image: url("/assets/img/serv_1.jpg");
}

.services-bg-2 {
  background-image: url("/assets/img/serv_2.jpg");
}

.services-bg-3 {
  background-image: url("/assets/img/serv_3.jpg");
}

.services-bg-4 {
  background-image: url("/assets/img/serv_4.jpg");
}

.services-bg-5 {
  background-image: url("/assets/img/serv_5.jpg");
}

/* CORRECTION DU POSITIONNEMENT */
#services-wrapper {
  padding: 50px 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.halves-services {
  margin-bottom: 50px;
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 400px;
  /* IMPORTANT: Forcer la hauteur */
  height: auto;
}

.halves-services:last-child {
  margin-bottom: 0;
}

.halves-services .half {
  width: 50%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* CORRECTION: Assurer le positionnement relatif */
  flex: 1;
}

/* CORRECTION IMPORTANTE: Container pour les images */
.halves-services .half:first-child {
  position: relative;
  overflow: hidden;
}

.img-fullwidth-wrapper {
  padding: 30px;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.img-fullwidth-txt-services-right,
.img-fullwidth-txt-services-left {
  padding: 40px;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  background-color: rgba(255, 255, 255, 0.95);
  /* Légère transparence pour éviter les conflits */
}

/* Styles pour les conteneurs de texte */
.center-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-block {
  width: 100%;
  max-width: 500px;
  text-align: left;
}

/* CORRECTION: Styles pour les titres et sous-titres */
.section-subheading {
  margin-bottom: 20px;
}

.section-subheading h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

.section-subheading span {
  position: relative;
  padding-bottom: 10px;
}

.services-heading {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin: 20px 0;
  color: #333;
}

.services-number-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #999;
  margin-bottom: 20px;
}

/* Styles pour le contenu */
.post-txt {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
  margin: 20px 0;
}

.post-txt p {
  margin: 0 0 15px 0;
}

/* Diviseurs */
.inner-divider-post {
  width: 50px;
  height: 2px;
  background-color: #ddd;
  margin: 20px 0;
}

.inner-divider-in-post {
  width: 30px;
  height: 1px;
  background-color: #eee;
  margin: 15px 0;
}

/* CORRECTION: Classes pour la visibilité mobile */
.visible-mobile-devices {
  display: none !important;
}

.hidden-mobile-devices {
  display: block !important;
}

/* CORRECTION MAJEURE: Ajustements pour mobile */
@media only screen and (max-width: 768px) {
  #services-wrapper {
    padding: 30px 0;
  }

  .halves-services {
    margin-bottom: 30px;
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  .halves-services .half {
    width: 100% !important;
    min-height: 300px;
    flex: none;
  }

  .img-fullwidth-wrapper {
    padding: 20px;
  }

  .img-fullwidth-txt-services-right,
  .img-fullwidth-txt-services-left {
    padding: 20px;
    background-color: white;
  }

  .services-heading {
    font-size: 28px;
  }

  .center-block {
    max-width: 100%;
  }

  /* CORRECTION: Affichage mobile pour les images */
  .visible-mobile-devices {
    display: flex !important;
    position: relative;
  }

  .hidden-mobile-devices {
    display: none !important;
  }

  /* Réorganisation pour mobile */
  .services-bg-1,
  .services-bg-2,
  .services-bg-3,
  .services-bg-4,
  .services-bg-5 {
    position: relative;
    min-height: 250px;
  }
}

/* CORRECTION: Ajustements pour tablettes */
@media only screen and (max-width: 1024px) and (min-width: 769px) {
  .services-heading {
    font-size: 32px;
  }

  .img-fullwidth-txt-services-right,
  .img-fullwidth-txt-services-left {
    padding: 30px;
  }

  .halves-services .half {
    min-height: 350px;
  }
}

/* CORRECTION: Styles pour éviter les conflits avec Bootstrap */
.halves-services .half {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

.img-fullwidth-wrapper,
.img-fullwidth-txt-services-right,
.img-fullwidth-txt-services-left {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

/* CORRECTION: Reset des styles qui pourraient interférer */
#services * {
  box-sizing: border-box;
}

#services .row {
  margin-left: 0;
  margin-right: 0;
}

#services .col-lg-12 {
  padding-left: 15px;
  padding-right: 15px;
}

/* CORRECTION: Forcer le positionnement correct */
.halves-services {
  clear: both;
  width: 100%;
  display: flex !important;
  flex-wrap: nowrap;
}

/* CORRECTION: Éviter les débordements */
.container-fluid.sections {
  overflow-x: hidden;
  width: 100%;
}

/* CORRECTION: Styles pour les écrans très larges */
@media only screen and (min-width: 1200px) {
  .halves-services .half {
    min-height: 450px;
  }

  .services-heading {
    font-size: 40px;
  }
}

/* CORRECTION: Fallback pour les navigateurs plus anciens */
.halves-services {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: stretch;
  -ms-flex-align: stretch;
  align-items: stretch;
}

.halves-services .half {
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}
