/* 📱 AMÉLIORATIONS MOBILE LILAV 📱 */

/* ============= RESPONSIVE GÉNÉRAL ============= */
@media (max-width: 768px) {
  
  /* Espacement général */
  body {
    font-size: 16px; /* Taille lisible sur mobile */
  }
  
  .container {
    padding: 0 20px;
  }
  
  /* Titres plus lisibles */
  h1 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }
  
  h2 {
    font-size: 1.7rem !important;
    line-height: 1.4 !important;
  }
  
  h3 {
    font-size: 1.3rem !important;
    line-height: 1.4 !important;
  }
  
  p {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }
}

/* ============= MENU MOBILE AMÉLIORÉ ============= */
@media (max-width: 768px) {
  
  /* Menu hamburger plus visible */
  .menu-toggle {
    display: block !important;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem !important;
    padding: 10px !important;
    z-index: 1001;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
  }
  
  /* Navigation mobile */
  nav ul {
    display: none;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px !important;
    padding: 80px 20px !important;
    box-shadow: none;
    z-index: 1000;
    overflow-y: auto;
  }
  
  nav ul.active {
    display: flex !important;
  }
  
  nav ul li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    width: 100%;
    text-align: center;
  }
  
  nav ul li a {
    display: block !important;
    padding: 15px 20px !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: #333 !important;
  }
  
  nav ul li a:hover,
  nav ul li a.active {
    color: #e60000 !important;
    background: rgba(230, 0, 0, 0.05);
    border-radius: 10px;
  }
}

/* ============= FORMULAIRES AMÉLIORÉS ============= */
@media (max-width: 768px) {
  
  /* Labels plus espacés */
  form label {
    font-size: 1rem !important;
    margin-bottom: 8px !important;
    display: block !important;
  }
  
  /* Inputs plus grands et lisibles */
  form input[type="text"],
  form input[type="email"],
  form input[type="tel"],
  form select,
  form textarea {
    width: 100% !important;
    padding: 15px !important;
    font-size: 16px !important; /* Évite le zoom auto sur iOS */
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  
  form input:focus,
  form select:focus,
  form textarea:focus {
    border-color: #e60000 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.1) !important;
  }
  
  /* Boutons submit plus visibles */
  form button[type="submit"],
  form input[type="submit"],
  .submit-button,
  .btn {
    width: 100% !important;
    padding: 18px 25px !important;
    font-size: 1.1rem !important;
    border-radius: 10px !important;
    margin-top: 15px !important;
    cursor: pointer;
  }
  
  /* Grilles de formulaire en 1 colonne */
  .grid-2,
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* ============= CARTES ET GRILLES ============= */
@media (max-width: 768px) {
  
  /* Toutes les grilles en 1 colonne */
  .grid-3,
  .grid-4,
  .services-grid,
  .why-grid,
  .testimonials-grid,
  .clientele-grid-detailed {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  /* Cartes plus espacées */
  .card,
  .service-card,
  .why-card,
  .testimonial-card,
  .client-card-detailed {
    padding: 25px 20px !important;
    margin-bottom: 20px !important;
  }
  
  /* Icônes pas trop grandes */
  .card-icon,
  .service-icon,
  .why-icon {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.8rem !important;
    margin-bottom: 20px !important;
  }
  
  /* Titres de cartes */
  .card h3,
  .service-card h3 {
    font-size: 1.2rem !important;
    margin-bottom: 12px !important;
  }
}

/* ============= SECTIONS ET ESPACEMENTS ============= */
@media (max-width: 768px) {
  
  /* Sections moins hautes sur mobile */
  section {
    padding: 60px 0 !important;
  }
  
  .hero,
  .page-hero {
    padding: 80px 0 !important;
    min-height: auto !important;
  }
  
  /* Titres de section */
  .section-title h2 {
    font-size: 1.8rem !important;
    margin-bottom: 15px !important;
  }
  
  .subtitle {
    font-size: 1rem !important;
    padding: 0 10px !important;
  }
}

/* ============= COORDONNÉES CONTACT ============= */
@media (max-width: 768px) {
  
  /* Numéro de téléphone cliquable */
  a[href^="tel:"] {
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e60000, #cc0000);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.3);
  }
  
  a[href^="tel:"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 0, 0, 0.4);
  }
  
  /* Email cliquable */
  a[href^="mailto:"] {
    color: #e60000 !important;
    text-decoration: underline;
    font-size: 1rem !important;
    word-break: break-all;
  }
  
  /* Info contact mieux espacée */
  .contact-info div {
    margin-bottom: 25px !important;
    padding: 20px !important;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #e60000 !important;
  }
  
  .contact-info i {
    font-size: 1.5rem !important;
    margin-right: 12px !important;
  }
  
  .contact-info strong {
    font-size: 1.1rem !important;
    display: block !important;
    margin-bottom: 8px !important;
  }
  
  .contact-info p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
  }
}

/* ============= FOOTER MOBILE ============= */
@media (max-width: 768px) {
  
  footer .footer-content {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    text-align: center !important;
  }
  
  footer .footer-section {
    padding: 20px 0;
    border-bottom: 1px solid #444;
  }
  
  footer .footer-section:last-child {
    border-bottom: none;
  }
  
  footer .footer-logo {
    height: 50px !important;
    margin-bottom: 15px !important;
  }
  
  footer p {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }
  
  footer h3 {
    font-size: 1.2rem !important;
    margin-bottom: 15px !important;
  }
  
  footer a {
    font-size: 0.95rem !important;
    padding: 8px 0 !important;
  }
  
  .social-links {
    justify-content: center !important;
    gap: 15px !important;
  }
  
  .social-links a {
    width: 45px !important;
    height: 45px !important;
    font-size: 1.2rem !important;
  }
  
  .legal-links {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px !important;
  }
  
  .legal-links a {
    display: inline-block !important;
    margin: 5px !important;
  }
}

/* ============= GALERIE CHANTIERS ============= */
@media (max-width: 768px) {
  
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .gallery-item {
    margin-bottom: 20px !important;
  }
  
  .gallery-item img {
    width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
  }
  
  /* Filtres en colonne */
  .filter-buttons {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  
  .filter-btn {
    width: 100% !important;
    padding: 15px !important;
    font-size: 1rem !important;
  }
}

/* ============= TABLEAUX RESPONSIVE ============= */
@media (max-width: 768px) {
  
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
  }
  
  table thead {
    display: none;
  }
  
  table tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
  }
  
  table td {
    display: block;
    text-align: left !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #f0f0f0;
  }
  
  table td:last-child {
    border-bottom: none;
  }
  
  table td::before {
    content: attr(data-label);
    font-weight: 600;
    display: inline-block;
    margin-right: 10px;
    color: #e60000;
  }
}

/* ============= STATS ET COMPTEURS ============= */
@media (max-width: 768px) {
  
  .stats,
  .stat-card {
    text-align: center !important;
    padding: 20px 15px !important;
  }
  
  .stats .counter,
  .stat-card .counter {
    font-size: 2.5rem !important;
    margin-bottom: 10px !important;
  }
  
  .stats p,
  .stat-card p {
    font-size: 0.95rem !important;
  }
}

/* ============= BOUTONS ET CTA ============= */
@media (max-width: 768px) {
  
  .btn,
  .cta-button {
    width: 100% !important;
    padding: 16px 20px !important;
    font-size: 1rem !important;
    text-align: center !important;
    margin: 10px 0 !important;
  }
  
  /* Groupe de boutons */
  .button-group {
    flex-direction: column !important;
    gap: 10px !important;
  }
  
  .button-group .btn {
    width: 100% !important;
  }
}

/* ============= MODAL MOBILE ============= */
@media (max-width: 768px) {
  
  .modal-content {
    width: 95% !important;
    max-width: none !important;
    margin: 20px auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 20px !important;
  }
  
  .modal-close {
    top: 10px !important;
    right: 10px !important;
    font-size: 2rem !important;
    width: 40px !important;
    height: 40px !important;
  }
  
  .modal img {
    width: 100% !important;
    height: auto !important;
  }
}

/* ============= IMAGES RESPONSIVE ============= */
@media (max-width: 768px) {
  
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  .logo {
    height: 45px !important;
  }
}

/* ============= ANIMATIONS DÉSACTIVÉES SUR MOBILE (PERFORMANCE) ============= */
@media (max-width: 768px) {
  
  * {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
  }
  
  /* Désactiver les effets complexes */
  .why-card:hover .why-icon,
  .client-card-detailed:hover .client-icon-detailed {
    transform: scale(1.05) !important; /* Au lieu de rotation 360° */
  }
}

/* ============= ACCESSIBILITÉ TOUCH ============= */
@media (max-width: 768px) {
  
  /* Zone de clic plus grande */
  a,
  button {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Espacement entre éléments cliquables */
  a + a,
  button + button {
    margin-left: 10px !important;
  }
}

/* ============= SCROLL OPTIMISÉ ============= */
@media (max-width: 768px) {
  
  html {
    scroll-padding-top: 80px !important;
  }
  
  body {
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ============= FIX ZOOM IOS ============= */
@media (max-width: 768px) {
  
  /* Empêche le zoom auto sur les inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ============= PERFORMANCES ============= */
@media (max-width: 768px) {
  
  /* Optimisation GPU */
  .card,
  .btn,
  img {
    will-change: auto;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
}
