/* ==========================================================================
   OPTIMISATIONS MOBILE - MAX3D
   ========================================================================== */

/* Navigation mobile améliorée */
@media (max-width: 991.98px) {
  /* Navbar */
  .navbar-brand img {
    height: 40px !important;
  }

  .navbar-toggler {
    padding: 0.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
  }

  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(194, 0, 0, 0.25);
  }

  .navbar-collapse {
    background: white;
    padding: 1.5rem;
    margin-top: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-item {
    margin: 0.5rem 0;
    text-align: center;
  }

  .nav-link {
    padding: 1rem !important;
    font-size: 1.1rem;
    border-radius: 8px;
  }

  .nav-link:hover {
    background-color: #f8f9fa;
  }

  /* Top bar - Simplifier pour mobile */
  .top-bar {
    font-size: 0.8rem;
    padding: 0.5rem 0 !important;
  }

  .top-bar .container {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .top-bar > div > div:last-child {
    display: none; /* Masquer les horaires sur mobile */
  }

  .top-bar .mx-3 {
    display: none; /* Masquer le séparateur */
  }
}

/* Tablettes et mobiles */
@media (max-width: 768px) {
  /* Ajuster le padding du body pour la navbar */
  body {
    padding-top: 120px;
    font-size: 16px;
    line-height: 1.6;
  }

  /* Paragraphes plus lisibles sur mobile */
  p {
    margin-bottom: 1.25rem;
  }

  /* Titres responsive avec meilleur espacement */
  h1 {
    font-size: 2.25rem !important;
    line-height: 1.25;
    margin-bottom: 1.25rem;
    letter-spacing: -0.3px;
  }

  h2 {
    font-size: 1.85rem !important;
    line-height: 1.35;
    margin-bottom: 1rem;
    letter-spacing: -0.2px;
  }

  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4;
  }

  h5 {
    font-size: 1.25rem !important;
    line-height: 1.5;
  }

  /* Lead text avec meilleure lisibilité */
  .lead {
    font-size: 1.05rem !important;
    line-height: 1.7;
    font-weight: 400;
  }

  /* Hero Section - Optimisée Mobile */
  .hero-section {
    padding: 1.5rem 0 1rem !important;
    min-height: auto !important;
  }

  .hero-section .container {
    padding: 0 1rem;
  }

  .hero-section .row {
    text-align: center;
    gap: 0 !important;
  }

  /* Image en premier sur mobile */
  .hero-section .col-lg-6:first-child {
    order: 2;
    margin-top: 1.5rem;
    padding: 0 0.5rem;
  }

  .hero-section .col-lg-6:last-child {
    order: 1;
    padding: 0 0.5rem;
  }

  /* Image optimisée */
  .hero-section img {
    max-width: 85%;
    height: auto;
    margin: 0 auto;
    display: block;
  }

  /* Titre plus compact */
  .hero-section h1 {
    font-size: 1.85rem !important;
    line-height: 1.2;
    margin-bottom: 1rem !important;
    padding: 0 0.5rem;
  }

  /* Lead text optimisé */
  .hero-section .lead {
    font-size: 1rem !important;
    line-height: 1.6;
    margin-bottom: 1.25rem !important;
    padding: 0 0.5rem;
  }

  /* Liste d'avantages centrée et compacte */
  .hero-section .list-unstyled {
    text-align: left;
    display: inline-block;
    margin: 1.25rem auto 1.5rem !important;
    padding: 0 1rem;
    max-width: 100%;
  }

  .hero-section .list-unstyled li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
  }

  .hero-section .list-unstyled li i {
    font-size: 1.1rem;
  }

  .hero-section .list-unstyled li strong {
    font-weight: 600;
  }

  /* Bouton CTA optimisé */
  .hero-section .btn {
    width: 100%;
    max-width: 320px;
    margin: 0 auto !important;
    display: block;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
  }

  /* Scroll down plus discret */
  .scroll-down {
    margin-top: 1.5rem;
    padding-bottom: 0.75rem;
  }

  .scroll-down i {
    font-size: 1.75rem !important;
    opacity: 0.8;
  }

  /* Espacement harmonieux */
  .hero-section .g-4 {
    gap: 0 !important;
  }

  /* Sections avec min-vh */
  .min-vh-100,
  .min-vh-88 {
    min-height: auto !important;
    /* padding: 3rem 0 !important; */
  }

  /* Phrase d'accroche */
  .phrase-accroche-section {
    padding: 3rem 1rem !important;
  }

  .phrase-accroche-section h2 {
    font-size: 1.6rem !important;
    margin-bottom: 1.5rem;
  }

  .phrase-accroche-section .lead {
    font-size: 1rem !important;
    line-height: 1.7;
    text-align: left;
  }

  .phrase-accroche-section .row > div {
    margin-bottom: 2rem;
  }

  .phrase-accroche-section img {
    max-width: 100%;
    height: auto;
    margin-top: 2rem;
  }

  .phrase-accroche-section .btn {
    width: 100%;
    max-width: 350px;
  }

  /* Qui sommes-nous */
  .qui-sommes-nous-section {
    padding: 3rem 0 !important;
  }

  .qui-sommes-nous-section .col-md-6:first-child {
    order: 1;
    margin-bottom: 2rem;
  }

  .qui-sommes-nous-section .col-md-6:last-child {
    order: 2;
  }

  .qui-sommes-nous-section .btn {
    width: 100%;
    max-width: 350px;
  }

  /* Services */
  #services {
    padding: 3rem 0 !important;
  }

  #services h2 {
    margin-bottom: 2.5rem !important;
    font-size: 1.75rem !important;
  }

  #services .g-4 {
    gap: 1.5rem !important;
  }

  .card {
    margin-bottom: 0;
    border-radius: 12px;
  }

  .card-img-top {
    height: 200px;
    object-fit: cover;
  }

  .card-body {
    padding: 1.25rem;
  }

  .card-title {
    font-size: 1.2rem !important;
    margin-bottom: 0.75rem;
  }

  .card-text {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Formulaire de contact */
  .contact-section {
    padding: 3rem 0 !important;
  }

  .contact-section h2 {
    font-size: 1.75rem !important;
    margin-bottom: 2rem !important;
  }

  .contact-section form {
    padding: 1.5rem !important;
    border-radius: 15px;
  }

  .contact-section .col-md-6 {
    padding: 0;
  }

  .form-label {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }

  .form-control,
  .form-select {
    padding: 0.7rem 1rem;
    font-size: 1rem;
  }

  .form-control::placeholder {
    font-size: 0.9rem;
  }

  .btn[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
  }

  /* Footer mobile */
  footer {
    padding: 2rem 0 1rem !important;
    text-align: center;
  }

  footer .row {
    gap: 2rem;
  }

  footer .col-md-4 {
    margin-bottom: 1.5rem;
  }

  footer h5 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  footer img {
    margin-bottom: 1rem;
  }

  /* Boutons flottants mobile */
  .contact-whatsapp,
  .back-to-top {
    width: 55px;
    height: 55px;
    font-size: 1.3rem;
    margin-bottom: 12px;
  }

  .mb-5.position-fixed {
    margin: 1rem !important;
  }
}

.form-control,
.form-select {
  font-size: 1rem;
  padding: 0.75rem;
}

textarea.form-control {
  min-height: 120px;
}

.contact-section .btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

/* Boutons flottants */
.position-fixed.bottom-0.end-0 {
  margin: 1rem !important;
}

.contact-whatsapp,
.back-to-top {
  width: 50px;
  height: 50px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 0.5rem !important;
}

.contact-whatsapp i,
.back-to-top i {
  font-size: 1.5rem;
}

/* Footer */
footer {
  padding: 2rem 0 !important;
  font-size: 0.9rem;
}

footer .col-md-4 {
  margin-bottom: 1.5rem;
  text-align: center;
}

footer img {
  margin-bottom: 1rem;
}

footer h5 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Petits mobiles */
@media (max-width: 576px) {
  /* Navbar encore plus compacte */
  body {
    padding-top: 120px;
  }

  .navbar-brand img {
    height: 35px !important;
  }

  .top-bar {
    font-size: 0.75rem;
  }

  /* Textes */
  h1 {
    font-size: 1.75rem !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  body {
    font-size: 0.95rem;
  }

  /* Hero */
  .hero-section img {
    max-width: 250px;
  }

  .hero-section .btn,
  .phrase-accroche-section .btn,
  .qui-sommes-nous-section .btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }

  /* Sections */
  section {
    padding: 2rem 0 !important;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Cards services */
  .card-img-top {
    max-height: 180px;
  }

  /* Formulaire */
  .col-md-2,
  .col-md-5,
  .col-md-6,
  .col-md-12 {
    margin-bottom: 1rem;
  }

  .form-control,
  .form-select {
    font-size: 0.95rem;
  }

  /* Boutons flottants plus petits */
  .contact-whatsapp,
  .back-to-top {
    width: 45px;
    height: 45px;
  }

  .contact-whatsapp i,
  .back-to-top i {
    font-size: 1.25rem;
  }

  /* Footer */
  footer {
    font-size: 0.85rem;
  }

  footer .col-md-4 {
    margin-bottom: 1rem;
  }
}

/* Très petits écrans */
@media (max-width: 375px) {
  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.35rem !important;
  }

  .hero-section img {
    max-width: 220px;
  }

  .navbar-brand img {
    height: 30px !important;
  }

  .contact-whatsapp,
  .back-to-top {
    width: 40px;
    height: 40px;
  }
}

/* Orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .min-vh-100,
  .min-vh-88 {
    min-height: auto !important;
    padding: 1rem 0 !important;
  }

  .hero-section {
    padding: 1rem 0 !important;
  }

  .scroll-down {
    display: none;
  }
}

/* Amélioration de la performance tactile */
@media (hover: none) and (pointer: coarse) {
  /* Augmenter la zone de touch pour les liens et boutons */
  .btn,
  .nav-link,
  a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Désactiver les effets hover sur mobile */
  .btn:hover i,
  .service-card:hover {
    transform: none;
  }

  /* Meilleure zone de touch pour le formulaire */
  .form-control,
  .form-select,
  .form-check-input {
    min-height: 48px;
  }

  .form-check-label {
    padding-left: 0.5rem;
  }
}

/* Optimisation des images pour mobile */
@media (max-width: 768px) {
  img {
    max-width: 100%;
    height: auto;
  }

  /* Lazy loading hint */
  img[loading="lazy"] {
    background: #f0f0f0;
  }
}

/* Mode sombre préféré (bonus) */
@media (prefers-color-scheme: dark) {
  /* Optionnel : ajouter un mode sombre si souhaité */
}

/* Réduction du mouvement pour accessibilité */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-down,
  .animate__animated {
    animation: none !important;
  }
}
