/* ==========================================
   CORRECTIONS MOBILES SPÉCIFIQUES
   Résolution des problèmes de placement et visibilité
   ========================================== */

/* ==========================================
   1. CORRECTION HERO SECTION - TEXTE COUPÉ
   ========================================== */
@media screen and (max-width: 768px) {
  /* Correction du texte principal Digital Solutions */
  .hero-content {
    width: 100% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
  }

  .hero h1,
  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin-bottom: 1rem !important;
  }

  .hero .gradient-text,
  .hero [style*="background: linear-gradient"] {
    background-clip: text !important;
    -webkit-background-clip: text !important;
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .hero p,
  .hero-description {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    padding: 0 10px !important;
    margin-bottom: 1.5rem !important;
    opacity: 1 !important;
  }
}

/* ==========================================
   2. CORRECTION CARTES DE SERVICES
   ========================================== */
@media screen and (max-width: 768px) {
  .services-grid,
  .service-cards {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 0 !important;
  }

  .service-card,
  .service-card-modern {
    width: 100% !important;
    padding: 1.5rem !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .service-badge {
    position: static !important;
    display: inline-block !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.65rem !important;
  }

  .service-title-modern,
  .service-card h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.3 !important;
  }

  .service-description-modern,
  .service-card p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    opacity: 1 !important;
    color: #333 !important;
  }

  .service-features-modern {
    margin: 1rem 0 !important;
  }

  .service-features-modern li {
    font-size: 0.85rem !important;
    padding-left: 1.5rem !important;
    margin-bottom: 0.5rem !important;
  }
}

/* ==========================================
   3. CORRECTION SECTION STATISTIQUES
   ========================================== */
@media screen and (max-width: 768px) {
  .stats-section,
  .numbers-section {
    padding: 2rem 0 !important;
  }

  .numbers-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    padding: 0 !important;
  }

  .number-item,
  .stat-block {
    padding: 1.25rem !important;
    text-align: center !important;
    min-height: auto !important;
  }

  .number-value,
  .stat-number {
    font-size: 2rem !important;
    line-height: 1 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
  }

  .number-suffix {
    font-size: 1.5rem !important;
    vertical-align: baseline !important;
  }

  .number-label,
  .stat-label {
    font-size: 0.75rem !important;
    line-height: 1.3 !important;
    margin-top: 0.5rem !important;
    opacity: 0.9 !important;
  }
}

/* ==========================================
   4. CORRECTION CARTES DE PRIX
   ========================================== */
@media screen and (max-width: 768px) {
  .pricing-grid,
  .site-types-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 0 !important;
  }

  .pricing-card,
  .site-type-card {
    width: 100% !important;
    margin: 0 !important;
    padding: 1.5rem !important;
    position: relative !important;
  }

  .featured-badge {
    position: absolute !important;
    top: -10px !important;
    right: 15px !important;
    font-size: 0.65rem !important;
    padding: 0.25rem 0.75rem !important;
    z-index: 10 !important;
  }

  .type-features {
    margin: 1rem 0 !important;
    padding: 0 !important;
  }

  .type-features li {
    font-size: 0.85rem !important;
    padding-left: 1.25rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.4 !important;
  }

  .type-price,
  .pricing-price {
    font-size: 1.25rem !important;
    margin-top: 1rem !important;
    padding-top: 1rem !important;
  }
}

/* ==========================================
   5. CORRECTION SECTION TÉMOIGNAGES
   ========================================== */
@media screen and (max-width: 768px) {
  .testimonials-section {
    padding: 2rem 0 !important;
  }

  .testimonial-card {
    padding: 1.5rem !important;
    margin: 0 0 1rem 0 !important;
  }

  .testimonial-content,
  .testimonial-text {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
    display: block !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .testimonial-author {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
  }

  .testimonial-role {
    font-size: 0.8rem !important;
    opacity: 0.8 !important;
  }
}

/* ==========================================
   6. CORRECTION FOOTER
   ========================================== */
@media screen and (max-width: 768px) {
  .footer {
    background: var(--color-dark) !important;
    padding: 2rem 0 1rem 0 !important;
  }

  .footer-content {
    padding: 0 1rem !important;
  }

  .footer h3,
  .footer h4 {
    color: #fff !important;
    font-size: 1.1rem !important;
    margin-bottom: 1rem !important;
    opacity: 1 !important;
  }

  .footer p,
  .footer a,
  .footer li {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
  }

  .footer a:hover {
    color: var(--color-accent) !important;
  }

  .footer-social a {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding-top: 1rem !important;
    margin-top: 2rem !important;
  }

  .footer-bottom p {
    font-size: 0.75rem !important;
    opacity: 0.8 !important;
  }
}

/* ==========================================
   7. CORRECTIONS GLOBALES SUPPLÉMENTAIRES
   ========================================== */
@media screen and (max-width: 768px) {
  /* Forcer la largeur 100% sur tous les contenus principaux */
  main,
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Correction des sections avec background */
  section[style*="background"] {
    background-size: cover !important;
    background-position: center !important;
  }

  /* Améliorer la lisibilité des textes sur fond coloré */
  [style*="background: linear-gradient"] p,
  [style*="background: linear-gradient"] span {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  /* Forcer le bon espacement des boutons CTA */
  .cta-actions,
  .hero-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .cta-actions .btn,
  .hero-buttons .btn {
    width: 100% !important;
    min-height: 48px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0.75rem 1rem !important;
  }

  /* Améliorer l'espacement vertical des sections */
  .section {
    padding: 3rem 0 !important;
  }

  .section:first-child {
    padding-top: 5rem !important; /* Pour éviter le chevauchement avec le header */
  }

  /* Optimiser les images - seulement les images de contenu */
  img:not(svg img):not([width]) {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Correction des grilles flexbox - ciblé pour éviter de casser les cartes */
  .flex-grid {
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  .flex-grid > * {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }
}

/* ==========================================
   8. CORRECTIONS POUR TRÈS PETITS ÉCRANS
   ========================================== */
@media screen and (max-width: 360px) {
  .hero h1 {
    font-size: 1.5rem !important;
  }

  .hero p {
    font-size: 0.9rem !important;
  }

  .number-value {
    font-size: 1.75rem !important;
  }

  .service-card {
    padding: 1rem !important;
  }

  .btn {
    font-size: 0.85rem !important;
    padding: 0.6rem 0.9rem !important;
  }
}

/* ==========================================
   9. OPTIMISATION PERFORMANCES MOBILE
   ========================================== */
@media screen and (max-width: 768px) {
  /* Simplifier les ombres */
  .card,
  .service-card,
  .pricing-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  }
}