/*
 * CORRECTIFS RESPONSIVE - GELINK INTERNATIONAL
 * Version: 1.0
 * Date: Novembre 2025
 * 
 * INSTRUCTIONS D'UTILISATION:
 * Ajouter cette ligne dans le <head> de index.html APRÈS le style.css principal:
 * <link rel="stylesheet" href="assets/css/style-mobile-fixes.css">
 */

/* ============================================================================
   CORRECTIF 1: HEADER - TEXTE ET LOGOS
   ============================================================================ */

/* Mobile portrait standard (< 576px) */
@media (max-width: 576px) {
  .header-title-inline {
    white-space: normal !important;  /* Permet le retour à la ligne */
    flex-direction: column;
    gap: 4px;
    text-align: center;
    max-width: 100%;
  }
  
  .page-title {
    font-size: 0.75rem !important;
    line-height: 1.2;
    word-break: break-word;
  }
  
  .page-title br {
    display: block;  /* Garder les sauts de ligne */
  }
  
  .phone-link {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
  }
  
  .location {
    display: block;
    font-size: 0.7rem;
  }
  
  .logo-gelink {
    height: 45px !important;
  }
  
  .logo-ordre-geometres img {
    height: 50px !important;
  }
  
  .header-title-inline .blue-line {
    width: 40px !important;
    max-width: 40px;
  }
}

/* Mobile extra small (< 380px) - iPhone SE et similaires */
@media (max-width: 380px) {
  .page-title {
    font-size: 0.7rem !important;
  }
  
  .logo-gelink {
    height: 40px !important;
  }
  
  .logo-ordre-geometres img {
    height: 45px !important;
  }
  
  .logo-area {
    gap: 5px !important;
  }
}

/* Tablette portrait (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .logo-gelink {
    height: 60px !important;
  }
  
  .logo-ordre-geometres img {
    height: 70px !important;
  }
  
  .page-title {
    font-size: 0.95rem;
  }
  
  .header-title-inline .blue-line {
    width: 60px;
  }
}

/* ============================================================================
   CORRECTIF 2: NAVIGATION - MENU DROPDOWN SERVICES
   ============================================================================ */

/* Mobile et tablette */
@media (max-width: 1200px) {
  /* Désactiver le hover CSS, utiliser JavaScript uniquement */
  .services-dropdown:hover .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  /* Menu contrôlé par JavaScript avec classe .mobile-open */
  .services-dropdown.mobile-open .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }
}

/* Mobile portrait */
@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    min-width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1005 !important;
  }
  
  .dropdown-menu a {
    padding: 16px 20px !important;
    font-size: 1rem !important;
    border-bottom: 1px solid #eee;
  }
  
  .dropdown-menu a:last-child {
    border-bottom: none;
  }
  
  /* Overlay sombre derrière le menu */
  .services-dropdown.mobile-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1004;
  }
  
  .dropdown-menu {
    z-index: 1005 !important;
  }
}

/* ============================================================================
   CORRECTIF 3: BANNIÈRE PRINCIPALE (#bandeau-stat) - SANS DÉBORDEMENT
   ============================================================================ */

/* Mobile portrait */
@media (max-width: 768px) {
  #bandeau-stat {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;  /* ✅ Empêche le débordement */
  }
  
  #bandeau-stat .banner-static {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
  }
  
  #bandeau-stat .banner-overlay {
    position: relative !important;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 10px;  /* ✅ Padding réduit */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    width: 100%;  /* ✅ 100% au lieu de 95% */
    max-width: 100%;
    box-sizing: border-box;  /* ✅ Important pour inclure padding */
  }
  
  /* TITRE PRINCIPAL */
  #bandeau-stat .text-zone {
    margin: 0 0 20px 0 !important;
    transform: none !important;
    animation: none;
    text-align: center;
    width: 100%;
    padding: 0 5px;  /* ✅ Petit padding pour respirer */
    box-sizing: border-box;
  }
  
  #bandeau-stat .text-zone h2 {
    color: white !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: bold;
    margin: 0;
    padding: 0;
  }
  
  #bandeau-stat .text-zone.visible {
    transform: none !important;
    opacity: 1;
  }
  
  /* BLOCS DE SERVICES */
  #bandeau-stat .bloc {
    transform: none !important;
    margin-bottom: 12px;
    background: rgba(33, 150, 243, 0.95);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px 12px;  /* ✅ Padding réduit */
    width: calc(100% - 10px);  /* ✅ Largeur ajustée pour marge */
    max-width: calc(100% - 10px);
    box-sizing: border-box;  /* ✅ Important */
    text-align: center;
    overflow: hidden;  /* ✅ Empêche débordement interne */
  }
  
  #bandeau-stat .bloc h3 {
    color: white !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    font-size: 1.05rem;
    margin-bottom: 10px;
    text-align: center;
    word-wrap: break-word;  /* ✅ Coupe les mots longs */
  }
  
  #bandeau-stat .bloc ul {
    text-align: left;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 10px;
    max-width: 100%;  /* ✅ Pas de dépassement */
    box-sizing: border-box;
  }
  
  #bandeau-stat .bloc ul li {
    color: white !important;
    margin-bottom: 6px;
    line-height: 1.3;
    font-size: 0.9rem;  /* ✅ Légèrement réduit */
    word-wrap: break-word;  /* ✅ Coupe si trop long */
  }
  
  #bandeau-stat .bloc ul li strong {
    color: white !important;
    font-weight: 600;
  }
  
  #bandeau-stat .bloc.visible {
    transform: none !important;
  }
  
  /* CONTENEUR DES BLOCS */
  #bandeau-stat .bloc-container {
    gap: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 5px;  /* ✅ Petit padding */
    box-sizing: border-box;
  }
  
  /* BOUTONS DU BAS */
  #bandeau-stat .bottom-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 5px;  /* ✅ Petit padding */
    box-sizing: border-box;
  }
  
  #bandeau-stat .btn {
    background: white !important;
    color: #2196f3 !important;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 0.95rem;
    text-align: center;
    min-width: 180px;
    max-width: calc(100% - 10px);  /* ✅ Ne déborde pas */
    box-sizing: border-box;
  }
}

/* Mobile extra small (< 400px) */
@media (max-width: 400px) {
  #bandeau-stat {
    min-height: 550px;
  }
  
  #bandeau-stat .banner-overlay {
    padding: 15px 8px;  /* ✅ Encore plus compact */
  }
  
  #bandeau-stat .text-zone h2 {
    font-size: 1rem;
  }
  
  #bandeau-stat .bloc {
    padding: 12px 10px;
  }
  
  #bandeau-stat .bloc h3 {
    font-size: 0.95rem;
  }
  
  #bandeau-stat .bloc ul {
    font-size: 0.85rem;
    padding-left: 18px;
    padding-right: 8px;
  }
  
  #bandeau-stat .bloc ul li {
    font-size: 0.85rem;
    margin-bottom: 5px;
  }
}

/* Mobile paysage */
@media (max-width: 768px) and (orientation: landscape) {
  #bandeau-stat {
    min-height: 400px;
  }
  
  #bandeau-stat .banner-static {
    max-height: 400px !important;
  }
  
  #bandeau-stat .banner-overlay {
    padding: 15px 10px;
  }
  
  #bandeau-stat .text-zone h2 {
    font-size: 1rem;
    margin-bottom: 15px;
  }
  
  #bandeau-stat .bloc {
    padding: 10px 8px;
    margin-bottom: 8px;
  }
  
  #bandeau-stat .bloc h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  #bandeau-stat .bloc ul li {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }
}

/* ============================================================================
   CORRECTIF 4: BOUTONS FLOTTANTS (CTA, WhatsApp, Elfsight)
   ============================================================================ */

/* Mobile portrait standard */
@media (max-width: 576px) and (orientation: portrait) {
  .sticky-cta {
    bottom: 150px !important;
    right: 10px !important;
    padding: 8px 12px !important;
    font-size: 0.7rem !important;
    min-width: auto;
  }
  
  .sticky-cta1 {
    bottom: 85px !important;
    right: 10px !important;
    padding: 6px !important;
  }
  
  .whatsapp-btn {
    bottom: 190px !important;
    right: 10px !important;
  }
  
  .whatsapp-btn img {
    width: 38px !important;
    height: 38px !important;
  }
  
  .elfsight-app-c5f0f7e4-c3aa-4543-83ea-96087fe2bf7f {
    transform: scale(0.85) !important;
  }
}

/* Mobile extra small */
@media (max-width: 360px) {
  .sticky-cta,
  .sticky-cta1,
  .whatsapp-btn {
    transform: scale(0.9);
  }
  
  .sticky-cta {
    bottom: 145px !important;
    font-size: 0.65rem !important;
    padding: 6px 10px !important;
  }
  
  .sticky-cta1 {
    bottom: 80px !important;
  }
  
  .whatsapp-btn {
    bottom: 185px !important;
  }
  
  .whatsapp-btn img {
    width: 35px !important;
    height: 35px !important;
  }
}

/* Mobile paysage (< 768px width et < 500px height) */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 768px) {
  .sticky-cta,
  .sticky-cta1,
  .whatsapp-btn {
    transform: scale(0.8);
  }
  
  .sticky-cta {
    bottom: 110px !important;
    padding: 6px 10px !important;
    font-size: 0.65rem !important;
  }
  
  .sticky-cta1 {
    bottom: 65px !important;
  }
  
  .whatsapp-btn {
    bottom: 150px !important;
  }
}

/* Tablette portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .sticky-cta {
    bottom: 170px !important;
    right: 20px !important;
    padding: 10px 16px;
    font-size: 0.8rem;
  }
  
  .sticky-cta1 {
    bottom: 100px !important;
    right: 20px !important;
  }
  
  .whatsapp-btn {
    bottom: 210px !important;
    right: 20px !important;
  }
}

/* ============================================================================
   CORRECTIF 5: SERVICE CARDS - DÉSACTIVATION FLIP 3D
   ============================================================================ */

/* Tablette et mobile */
@media (max-width: 1024px) {
  .service-card {
    perspective: none !important;
    width: 100% !important;
    max-width: 400px;
    height: auto !important;
    min-height: auto;
    display: block;
  }
  
  .card-front,
  .card-back {
    transform: none !important;
    position: relative !important;
    backface-visibility: visible !important;
  }
  
  .card-front {
    width: 100%;
    height: auto;
  }
  
  .card-back {
    transform: none !important;
    padding: 15px;
    background: rgba(33, 150, 243, 0.05);
    margin-top: 10px;
    border-radius: 8px;
    width: 100%;
    display: block;
  }
  
  /* Désactiver les effets hover */
  .service-card:hover .card-front {
    transform: none !important;
  }
  
  .service-card:hover .card-back {
    transform: none !important;
  }
}

/* Mobile portrait */
@media (max-width: 576px) {
  .service-card {
    max-width: 100%;
    margin: 0 auto 20px;
  }
  
  .card-front img {
    height: auto;
    max-height: 250px;
  }
  
  .card-back p {
    font-size: 1rem;
  }
}

/* ============================================================================
   CORRECTIF 6: CARROUSEL - HAUTEUR ADAPTATIVE
   ============================================================================ */

/* Mobile portrait */
@media (max-width: 576px) {
  .carousel-item {
    height: 250px !important;
  }
  
  .carousel-item img {
    height: 250px !important;
    max-height: 250px;
    width: 100%;
    object-fit: cover;
  }
}

/* Mobile paysage */
@media (max-width: 768px) and (orientation: landscape) {
  .carousel-item {
    height: 300px !important;
    max-height: 300px;
  }
  
  .carousel-item img {
    height: 300px !important;
    max-height: 300px;
    object-fit: cover;
  }
}

/* Tablette portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .carousel-item {
    height: 350px;
  }
  
  .carousel-item img {
    height: 350px;
    object-fit: cover;
  }
}

/* ============================================================================
   CORRECTIF 7: FOOTER - ESPACEMENT
   ============================================================================ */

/* Tablette */
@media (max-width: 1200px) {
  .footer-container {
    gap: 20px 40px !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column !important;
    gap: 20px !important;
  }
  
  .footer-col {
    width: 100%;
    flex: 1 1 100%;
  }
  
  .footer-center h4,
  .footer-left h4,
  .footer-right h4 {
    font-size: 1rem;
  }
}

/* ============================================================================
   CORRECTIF 8: GRILLES VIDÉOS ET SERVICES
   ============================================================================ */

/* Mobile portrait */
@media (max-width: 576px) {
  .videos-grid-6 {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  
  .video-box video {
    max-height: 200px;
  }
}

/* Tablette portrait */
@media (min-width: 577px) and (max-width: 1024px) {
  .videos-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Services Section */
@media (max-width: 768px) {
  .services-section,
  .services-section1 {
    grid-template-columns: 1fr !important;
  }
  
  .service-item {
    border-left: none !important;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .service-item:last-child {
    border-bottom: none;
  }
}

/* Tablette portrait - 2 colonnes */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .services-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

/* ============================================================================
   CORRECTIF 9: TABLETTE PAYSAGE SPÉCIFIQUE
   ============================================================================ */

@media (min-width: 768px) and (max-width: 1200px) and (orientation: landscape) {
  .main-nav ul li a {
    font-size: 0.95rem !important;
    padding: 8px 12px !important;
  }
  
  #bandeau-stat .text-zone h2 {
    font-size: 1.5rem;
  }
  
  .videos-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-container {
    flex-direction: row;
    gap: 20px 50px;
  }
}

/* ============================================================================
   CORRECTIF 10: PERFORMANCE - DÉSACTIVATION ANIMATIONS LOURDES
   ============================================================================ */

/* Mobile et tablette - désactiver animations gourmandes */
@media (max-width: 1024px) {
  /* Désactiver parallax */
  .sidebar {
    transform: none !important;
  }
  
  /* Simplifier les animations */
  .service-card,
  .carousel-item,
  .btn-submit {
    will-change: auto;
  }
  
  /* Réduire les ombres complexes */
  .service-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

/* ============================================================================
   CORRECTIF 11: ACCESSIBILITÉ - ZONES DE TOUCH
   ============================================================================ */

/* Augmenter les zones de touch sur mobile */
@media (max-width: 768px) and (pointer: coarse) {
  .main-nav ul li a,
  .dropdown-menu a,
  .btn,
  .btn-video {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .burger-wrapper {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ============================================================================
   CORRECTIF 12: TEXTES - LISIBILITÉ SUR PETITS ÉCRANS
   ============================================================================ */

@media (max-width: 576px) {
  /* Augmenter légèrement la taille de police de base */
  body {
    font-size: 16px;
  }
  
  /* Ajuster les titres */
  h1 {
    font-size: 1.5rem !important;
    line-height: 1.3;
  }
  
  h2 {
    font-size: 1.3rem !important;
    line-height: 1.3;
  }
  
  h3 {
    font-size: 1.1rem !important;
    line-height: 1.3;
  }
  
  /* Espacements entre paragraphes */
  p {
    margin-bottom: 1rem;
    line-height: 1.6;
  }
}

/* ============================================================================
   CORRECTIF 13: SCROLL HORIZONTAL - PRÉVENTION
   ============================================================================ */

/* Empêcher tout scroll horizontal */
@media (max-width: 1200px) {
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }
  
  * {
    max-width: 100%;
  }
  
  /* Forcer les images à respecter la largeur */
  img {
    max-width: 100% !important;
    height: auto;
  }
  
  /* Cas spécifiques */
  #services h2::after {
    width: 100% !important;
    max-width: 90vw;
  }
}

/* ============================================================================
   FIN DES CORRECTIFS
   ============================================================================ */
