/* ============================================================
   responsive.css — Media queries mobile → desktop
   Approche : Mobile First (styles mobile = défaut,
               on élargit pour tablette et desktop)
   ============================================================ */

/* ── TABLETTE (≥ 768px) ───────────────────────────────────── */
@media (min-width: 768px) {

  /* Navbar : afficher la nav (cachée sur mobile) */
  .navbar__nav     { display: flex; }
  .navbar__actions { display: flex; }
  .navbar__toggle  { display: none; }
  .navbar__mobile-menu { display: none !important; }

  /* Hero : 2 colonnes */
  .hero__inner { grid-template-columns: 1fr 1fr; }

  /* Footer : 2 colonnes */
  .footer__top { grid-template-columns: 1fr 1fr; }

  /* Produits, Témoignages & Actualités : 2 colonnes */
  .products-grid, .testimonials-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }

  /* Steps : 2 colonnes */
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid::before { display: none; } /* pas de ligne horizontale */

  /* Trust : 2 colonnes */
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── DESKTOP (≥ 1024px) ───────────────────────────────────── */
@media (min-width: 1024px) {

  /* Produits, Témoignages & Actualités : 3 colonnes */
  .products-grid, .testimonials-grid, .news-grid { grid-template-columns: repeat(3, 1fr); }

  /* Steps : 4 colonnes + ligne décorative */
  .steps-grid { grid-template-columns: repeat(4, 1fr); }
  .steps-grid::before { display: block; }

  /* Trust : 4 colonnes */
  .trust-grid { grid-template-columns: repeat(4, 1fr); }

  /* Footer : layout complet 4 colonnes */
  .footer__top { grid-template-columns: 1.4fr 1fr 1fr 1fr; }

  /* App section : 2 colonnes */
  .app-section__inner { grid-template-columns: 1fr 1fr; }
}

/* ── MOBILE (< 768px) ─────────────────────────────────────── */
/* C'est ici qu'on OVERRIDE les styles desktop pour mobile    */
@media (max-width: 767px) {

  /* ── Variables adaptées ── */
  :root {
    --navbar-height: 60px;
    --space-24: 3rem;
    --space-20: 2.5rem;
    --space-16: 2rem;
  }

  /* Conteneur */
  .container { padding-inline: var(--space-4); }

  /* ── Navbar mobile ── */
  .navbar__nav     { display: none; }
  .navbar__actions { display: none; }
  .navbar__toggle  { display: flex; }

  /* Menu mobile déroulant */
  .navbar__mobile-menu {
    display: block;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    overflow-y: auto;
    padding: var(--space-6) var(--space-4);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 999;
  }

  .navbar__mobile-menu.open {
    transform: translateX(0);
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--clr-dark);
    border-bottom: 1px solid var(--clr-border);
  }

  .mobile-nav-link:last-child { border-bottom: none; }

  .mobile-dropdown {
    padding-left: var(--space-4);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
  }

  .mobile-dropdown.open { max-height: 500px; }

  .mobile-dropdown a {
    display: block;
    padding: var(--space-3) 0;
    font-size: var(--text-base);
    color: var(--clr-mid);
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .mobile-portals {
    margin-top: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .mobile-portal-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--clr-bg);
    border-radius: var(--radius-lg);
    font-weight: 700;
    color: var(--clr-dark);
    font-size: var(--text-sm);
    border: 1px solid var(--clr-border);
  }

  /* ── Hero mobile ── */
  .hero {
    min-height: auto;
    padding: var(--space-16) 0 var(--space-12);
  }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__visual { display: none; } /* Cache le mockup sur mobile */

  .hero__badge  { margin-inline: auto; }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-8);
  }

  /* ── Grilles ── */
  .products-grid, .testimonials-grid, .news-grid { grid-template-columns: 1fr; }
  .steps-grid    { grid-template-columns: 1fr 1fr; }
  .trust-grid    { grid-template-columns: 1fr 1fr; }

  /* ── App section ── */
  .app-section__inner { grid-template-columns: 1fr; }
  .app__phone-visual {
    display: flex;
    transform: scale(0.9);
    margin-top: var(--space-8);
  }

  /* ── Footer ── */
  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal { justify-content: center; }

  /* ── Newsletter ── */
  .newsletter-section { padding: var(--space-12) 0; }
  .newsletter-box {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding: 2.2rem 1.6rem;
    text-align: center;
    border-radius: 24px;
  }
  .newsletter-box__input-wrapper {
    flex-direction: column;
    padding: 0.8rem;
    border-radius: 20px;
    gap: 0.8rem;
  }
  .newsletter-box__input {
    width: 100%;
    text-align: center;
    padding: 0.4rem 0;
  }
  .newsletter-box__input-icon { margin-right: 0; }
  .newsletter-box__btn {
    width: 100%;
    justify-content: center;
    padding: 0.9rem;
  }
  .newsletter-box__privacy {
    text-align: center;
    padding-left: 0;
  }

  /* ── Boutons ── */
  .btn--lg { padding: var(--space-3) var(--space-6); }
}

/* ── Très petit mobile (< 480px) ─────────────────────────── */
@media (max-width: 479px) {
  .steps-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .newsletter-box { padding: 1.8rem 1.2rem; }
}
