/* ================================================
   MOBILE WIDTH FIX — SAT SERVICES
   Cible : 320px / 375px / 425px
   Objectif : Zéro débordement horizontal
   N'affecte PAS le desktop (>= 576px)
   ================================================ */

/* ─── BASE : Prévention globale du débordement ─── */
html,
body {
  scroll-behavior: smooth;
  overflow-x: hidden !important;
  max-width: 100vw;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ─── CORRECTION BOOTSTRAP : row negative margins ─── */
@media (max-width: 575px) {
  .container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    overflow: visible !important;
    max-width: 100% !important;
  }

  .container-fluid {
    padding-left: 10px !important;
    padding-right: 10px !important;
    overflow: visible !important;
  }

  /* Neutraliser les marges négatives Bootstrap sur .row */
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Colonnes : padding intérieur seulement */
  [class*="col-"] {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* ─── IMAGES : toujours contenues ─── */
img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 575px) {
  .img-rounded {
    border-radius: 15px;
  }
}

/* ─── HEADER ─── */
@media (max-width: 575px) {
  .main-header .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .main-header img {
    height: 45px !important;
  }
}

/* ─── HERO CAROUSEL (index.html) ─── */
@media (max-width: 425px) {
  .hero-isolation-wrapper,
  .carousel-item {
    height: 550px !important;
    min-height: 550px !important;
    max-height: 550px !important;
  }
}

@media (max-width: 375px) {
  .hero-isolation-wrapper,
  .carousel-item {
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
  }

  .hero-title {
    font-size: 1.9rem !important;
  }
}

@media (max-width: 320px) {
  .hero-isolation-wrapper,
  .carousel-item {
    height: 460px !important;
    min-height: 460px !important;
    max-height: 460px !important;
  }

  .hero-title {
    font-size: 1.7rem !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
    margin-bottom: 20px !important;
  }
}

/* ─── CAROUSEL CAPTION : centré et contenu ─── */
@media (max-width: 575px) {
  .carousel-caption {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    text-align: center !important;
  }

  .hero-tag {
    font-size: 11px !important;
    padding: 6px 14px !important;
  }
}

/* ─── BOUTONS CTA ─── */
@media (max-width: 575px) {
  .btn-cta-main,
  .btn-cta-outline {
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 15px !important;
    justify-content: center !important;
    text-align: center !important;
    margin-bottom: 12px !important;
    display: flex !important;
  }
}

/* ─── SECTION PADDING ─── */
@media (max-width: 425px) {
  .section-padding {
    padding: 50px 0 !important;
  }
}

@media (max-width: 320px) {
  .section-padding {
    padding: 40px 0 !important;
  }
}

/* ─── INNER PAGE HERO (pages internes) ─── */
@media (max-width: 575px) {
  .inner-page-hero {
    padding: 60px 15px !important;
  }
  .inner-page-hero h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 375px) {
  .inner-page-hero {
    padding: 50px 10px !important;
  }
  .inner-page-hero h1 {
    font-size: 1.8rem !important;
  }
}

/* ─── HERO .hero (pages about/activites) ─── */
@media (max-width: 575px) {
  .hero {
    height: auto !important;
    min-height: 300px !important;
    padding: 50px 15px !important;
  }
}

/* ─── CARD-STAT ─── */
@media (max-width: 575px) {
  .card-stat {
    padding: 25px 15px !important;
    margin-bottom: 15px !important;
  }
}

@media (max-width: 320px) {
  .card-stat {
    padding: 20px 12px !important;
  }
}

/* ─── GALLERY GRID (index.html) ─── */
@media (max-width: 575px) {
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    padding: 10px 0 !important;
  }

  .gallery-item {
    height: 280px !important;
  }
}

/* ─── GALERIE ACTIVITES (gallery-item-wrap) ─── */
@media (max-width: 575px) {
  .gallery-item-wrap img {
    height: 250px !important;
  }
}

/* ─── SECTION ABOUT : bloc citation ─── */
@media (max-width: 575px) {
  div[style*="border-left: 5px solid #2ecc71"][style*="padding-left: 30px"] {
    padding-left: 15px !important;
    font-size: 1.1rem !important;
  }
}

/* ─── POSITIONNEMENT RELATIF : badge "10+ ans" ─── */
@media (max-width: 575px) {
  /* Le badge "10+" positionné en absolute peut déborder sur mobile */
  .img-rounded + div[style*="position: absolute"] {
    position: static !important;
    display: inline-block !important;
    margin-top: 15px !important;
    right: auto !important;
    bottom: auto !important;
    text-align: center !important;
  }
}

/* ─── TEXTES H2 ─── */
@media (max-width: 425px) {
  h2 {
    font-size: 1.7rem !important;
    line-height: 1.3 !important;
  }
  h1 {
    font-size: 2rem !important;
  }
}

@media (max-width: 320px) {
  h2 {
    font-size: 1.5rem !important;
  }
  h1 {
    font-size: 1.8rem !important;
  }
}

/* ─── FOOTER ─── */
@media (max-width: 575px) {
  footer.footer {
    padding: 60px 0 0 0 !important;
  }

  footer .row {
    margin-bottom: 20px !important;
  }
}

/* ─── HEADER .header-bg (apport-dechets.html) ─── */
@media (max-width: 425px) {
  .header-bg {
    padding: 50px 15px !important;
  }
  .header-bg h1 {
    font-size: 1.9rem !important;
  }
}

@media (max-width: 320px) {
  .header-bg {
    padding: 40px 10px !important;
  }
  .header-bg h1 {
    font-size: 1.7rem !important;
  }
}

/* ─── FORMULAIRE apport-dechets.html ─── */
@media (max-width: 575px) {
  .form-card {
    padding: 20px 12px !important;
    margin-top: 20px !important;
  }

  .form-control {
    font-size: 14px !important;
  }
}

/* ─── PROCESS STEPS (apport-dechets) ─── */
@media (max-width: 320px) {
  .process-step {
    width: 60px !important;
    height: 60px !important;
    font-size: 20px !important;
  }
}

/* ─── TOPBAR ─── */
@media (max-width: 575px) {
  .topbar {
    display: none !important;
  }
}

/* ─── ICONES D-FLEX QUI DEBORDENT SUR 320px ─── */
@media (max-width: 320px) {
  .d-flex {
    flex-wrap: wrap !important;
  }

  .fa-2x {
    font-size: 1.4em !important;
  }
  .fa-3x {
    font-size: 2em !important;
  }
}

/* ─── FOOTER : padding-left stat bloc ─── */
@media (max-width: 575px) {
  footer .col-lg-3,
  footer .col-lg-2,
  footer .col-lg-4,
  footer .col-md-6 {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}
