/* ===============================================
    RESPONSIVE DESIGN
    Adaptation du layout, de la typographie et des espacements
    pour Tablettes (≤1024px), Téléphones (≤768px)
    et Très petits écrans (≤480px)
================================================ */

/* =================================================
    1. TABLETTES (max-width: 1024px)
================================================= */
@media screen and (max-width: 1024px) {
  /* CONTENEUR */
  .container {
    width: 92%;
  }

  /* HEADER */
  .logo-text {
    font-size: 1.2rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 0.4rem 0.7rem;
  }

  /* HERO */
  .hero {
    grid-template-columns: 1fr;
    gap: 4rem;
    text-align: center;
    padding-top: 100px; /* Ajout : évite que le hero soit sous le header fixe */
  }

  .hero-title {
    font-size: 2.8rem;
    width: 90%;
    margin: 0 auto;
  }

  .hero-desc {
    font-size: 1rem;
    width: 85%;
    margin: 0 auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-right {
    margin-top: 0;
  }

  .hero-cards {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  /* SECTIONS */
  .section {
    margin-top: 5rem;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2.5rem;
  }

  /* SERVICES */
  .service-card {
    padding: 1.8rem;
  }

  .service-card h3 {
    font-size: 1.15rem;
  }

  .icon-service {
    font-size: 2.5rem;
  }

  /* ACCORDIONS */
  .collapsible-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .collapsible-item.card {
    padding: 1.4rem 1.8rem;
  }

  .collapsible-header h3 {
    font-size: 1.2rem;
  }

  /* COMMENT ÇA FONCTIONNE */
  .how-it-works-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
  }

  .how-it-works-item {
    padding: 25px;
  }

  .how-it-works-item .step-number {
    font-size: 3.2rem;
  }

  .how-it-works-item h3 {
    font-size: 1.5rem;
  }

  .how-it-works-item p {
    font-size: 0.95rem;
  }

  /* STATISTIQUES */
  .intro-block {
    padding: 3rem;
  }

  .stats-section {
    padding: 3.5rem 0;
    margin-top: -50px;
    padding-top: calc(3.5rem + 50px);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    padding: 0 15px;
  }

  .stat-number {
    font-size: 3rem;
  }

  .stat-text {
    font-size: 1rem;
  }

  /* CONTACT */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-info {
    padding: 2.5rem;
  }

  /* FOOTER */
  .footer {
    padding: 3rem 0;
  }

  .footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
  }
}

/* =================================================
    2. TÉLÉPHONES (max-width: 768px)
================================================= */
@media screen and (max-width: 768px) {
  /* NAVIGATION MOBILE */
  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--navy-dark);
    position: fixed; /* Modifié : 'fixed' au lieu de 'absolute' pour mieux suivre le scroll */
    top: 80px;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateY(-10px); /* Ajusté pour une animation plus douce */
    transition: all 0.4s ease-out;
  }

  .nav-links.active {
    display: flex;
    transform: translateY(0);
  }

  .nav-links a {
    text-align: center;
    padding: 0.8rem 0;
    font-size: 1.1rem;
  }

  .nav-links a:hover {
    background: var(--navy-soft);
  }

  .nav-links a::after {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  /* HERO */
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .btn-primary,
  .btn-outline {
    width: 100%; /* Modifié : 100% pour être plus cliquable sur petit écran */
    max-width: 300px;
    margin: 0 auto;
  }

  /* SECTIONS */
  .section {
    margin-top: 4rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  /* ACCORDIONS */
  .collapsible-container {
    grid-template-columns: 1fr;
  }

  /* COMMENT ÇA FONCTIONNE */
  .how-it-works-grid {
    grid-template-columns: 1fr;
  }

  /* STATS */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* CONTACT & NOTIFICATIONS */
  .contact-info {
    padding: 1.5rem; /* Réduit pour gagner de la place */
  }

  #notification-container {
    right: 10px;
    left: 10px; /* Centre les notifs sur mobile */
    top: 15px;
  }

  /* FOOTER */
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* =================================================
    3. TRÈS PETITS ÉCRANS (max-width: 480px)
================================================= */
@media screen and (max-width: 480px) {
  .logo-img {
    width: 50px;
    height: 50px;
  }

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

  .btn-primary,
  .btn-outline {
    width: 100%;
  }

  .stat-number {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.6rem; /* Ajout : évite que les longs titres ne sortent de l'écran */
  }
}
