/* ==========================================
TABLETTE
========================================== */

@media (max-width:1024px){

    .hero h1{

        font-size:56px;

    }

    .hero-grid,
    .config-grid,
    .project-card,
    .contact-grid{

        grid-template-columns:1fr;

        gap:50px;

    }

    .project-card:nth-child(even) .project-image,
    .project-card:nth-child(even) .project-content{

        order:initial;

    }

    .cards{

        grid-template-columns:repeat(2,1fr);

    }

    .why-grid{

        grid-template-columns:repeat(2,1fr);

    }

    .process-grid{

        grid-template-columns:repeat(2,1fr);

    }

}

/* ==========================================
MOBILE
========================================== */

@media (max-width:768px){

    .tdc-header .container{

        height:80px;

    }

    .main-nav{

        display:none;

    }

    .btn-header{

        display:none;

    }

    .hero{

        padding:120px 0 80px;

        text-align:center;

    }

    .hero h1{

        font-size:40px;

        line-height:1.2;

    }

    .hero p{

        font-size:18px;

    }

    .hero-buttons{

        flex-direction:column;

        align-items:center;

    }

    .hero-points{

        justify-content:center;

    }

    .cards,
    .choice-grid,
    .why-grid,
    .process-grid{

        grid-template-columns:1fr;

    }

    .section-title h2{

        font-size:34px;

    }

    .project-content h3{

        font-size:34px;

    }

    .config-summary{

        position:relative;

        top:auto;

    }

}

/* ==========================================
PETIT MOBILE
========================================== */

@media (max-width:480px){

    .container{

        width:92%;

    }

    .hero h1{

        font-size:32px;

    }

    .hero p{

        font-size:16px;

    }

    .btn-primary,
    .btn-secondary{

        width:100%;

    }

}


/* ========================================
   CORRECTIONS MOBILE - STATISTIQUES ET FOOTER
   ======================================== */

@media (max-width: 767px) {

  /* Statistiques : affichage sur plusieurs lignes */
  .stats,
  .stats-grid,
  .stats-container,
  .stats-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Éviter que les chiffres dépassent */
  .stats *,
  .stats-grid *,
  .stats-container *,
  .stats-inner * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Footer : empiler les colonnes */
  footer .footer-container,
  footer .footer-inner,
  footer .footer-grid,
  footer .footer-columns {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    gap: 30px;
    box-sizing: border-box;
  }

  /* Empêcher les éléments du footer de déborder */
  footer,
  footer * {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}


/* ========================================
   FIX MOBILE : EMPECHER LE DEBORDEMENT
   ======================================== */

@media (max-width: 767px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  #page,
  #content,
  .site,
  .site-content,
  main {
    max-width: 100%;
    box-sizing: border-box;
  }

  img,
  video,
  iframe {
    max-width: 100%;
  }

}



    /* Bouton de contact dans le menu mobile */
    .main-nav .btn,
    .main-nav .btn-primary,
    .main-nav .btn-header,
    .mobile-menu .btn,
    .mobile-menu .btn-primary,
    .mobile-menu .btn-header {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        min-height: 52px;
        padding: 14px 10px;
        box-sizing: border-box;
        text-align: center;
        white-space: normal;
        overflow-wrap: break-word;
        line-height: 1.4;
        font-size: 14px;
    }

    
/* ========================================
   MENU MOBILE - VERSION AMELIOREE
   ======================================== */

@media (max-width: 768px) {

    .mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: min(85%, 360px);
        height: 100vh;
        height: 100dvh;
        padding: 80px 28px 30px;
        box-sizing: border-box;
        background: #ffffff;
        z-index: 10001;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .mobile-menu ul {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .mobile-menu ul li {
        width: 100%;
        margin: 0;
    }

    .mobile-menu ul li > a:not(.btn-primary) {
        display: block;
        padding: 12px 0;
        color: #111111;
        font-size: 17px;
        font-weight: 600;
        text-decoration: none;
    }

    .mobile-menu .close-menu {
        position: absolute;
        top: 20px;
        right: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #111111;
        font-size: 26px;
        cursor: pointer;
        z-index: 2;
    }

    .mobile-menu .btn-primary {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 52px;
        margin-top: 12px;
        padding: 14px 16px;
        box-sizing: border-box;
        border-radius: 12px;
        background: #D71920;
        color: #ffffff;
        text-align: center;
        text-decoration: none;
        line-height: 1.4;
    }

    .mobile-overlay {
        z-index: 10000;
    }

    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }
}




/* ========================================
   CARTES FLOTTANTES - TABLETTE ET MOBILE
======================================== */

@media (max-width: 1024px) {

    .hero-showcase {
        position: relative;
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
        padding: 35px 0;
        box-sizing: border-box;
    }

    .hero-showcase > img {
        display: block;
        width: 100%;
        height: auto;
    }

    .hero-showcase .floating-card {
        left: auto;
        right: 0;
        max-width: 85%;
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .hero-showcase .card-1 {
        top: 5%;
        bottom: auto;
        left: 0;
        right: auto;
    }

    .hero-showcase .card-2 {
        top: 42%;
        bottom: auto;
        left: auto;
        right: 0;
    }

    .hero-showcase .card-3 {
        top: auto;
        bottom: 5%;
        left: 0;
        right: auto;
    }
}

@media (max-width: 768px) {
  .hero-showcase .floating-card {
    font-size: 9px;
    padding: 6px 9px;
    border-radius: 8px;
    max-width: 75%;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
  }
}

@media (min-width: 1025px) {
  .hero-showcase .floating-card {
    font-size: 11px;
    padding: 8px 12px;
    border-radius: 9px;
  }

  .hero-showcase .card-1 {
    top: 3%;
    left: -10px;
  }

   .hero-showcase .card-2 {
  top: 42%;
  right: -15px;
  width: 115px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
  box-sizing: border-box;
}

  .hero-showcase .card-3 {
    bottom: 2%;
    left: 10px;
  }
}