/* =======================================================
 * DoppelServices - CSS Mobile Optimisé 
 * Optimisation complète pour smartphones et tablettes
 * ======================================================= */

/* Variables CSS pour la cohérence */
:root {
  --primary-color: #37517e;
  --secondary-color: #42A5F5;
  --text-color: #263238;
  --bg-color: #f5f5f5;
  --white: #ffffff;
  --border-radius: 15px;
  --shadow: 0 2px 16px rgba(66, 165, 245, 0.04);
  --transition: all 0.3s ease;
}

/* ===== BASE MOBILE ===== */
@media (max-width: 768px) {
  
  /* Container adaptable */
  .container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
  }
  
  /* Typographie mobile */
  h1 {
    font-size: 1.8rem !important;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  h2 {
    font-size: 1.5rem !important;
    line-height: 1.4;
    margin-bottom: 0.8rem;
  }
  
  h3 {
    font-size: 1.3rem !important;
    line-height: 1.4;
  }
  
  p, li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
  }
  
  /* Boutons mobile-friendly */
  .btn, .btn-main, .btn-contact, .btn-return {
    min-height: 48px !important;
    padding: 12px 20px !important;
    font-size: 1rem !important;
    border-radius: 25px;
    display: inline-block;
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* ===== HEADER MOBILE ===== */
  #header {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  #header.header-inner-pages {
    background: var(--primary-color);
  }
  
  .logo h1 {
    font-size: 1.4rem !important;
    margin: 0;
    line-height: 1.2;
  }
  
  /* Menu burger amélioré */
  .mobile-nav-toggle {
    font-size: 28px !important;
    color: var(--primary-color);
    cursor: pointer;
    line-height: 0;
    transition: var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  .mobile-nav-toggle:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
  }
  
  /* Navigation mobile overlay */
  .navbar-mobile {
    position: fixed;
    overflow: hidden;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(40, 58, 90, 0.95);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
  }
  
  .navbar-mobile.active {
    opacity: 1;
    visibility: visible;
  }
  
  .navbar-mobile .mobile-nav-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    color: var(--white);
    z-index: 1000;
  }
  
  .navbar-mobile ul {
    display: block;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    background: var(--white);
    max-width: 300px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    text-align: center;
    margin: 0;
    transform: translateY(-30px);
    transition: var(--transition);
  }
  
  .navbar-mobile.active ul {
    transform: translateY(0);
  }
  
  .navbar-mobile ul li {
    margin: 8px 0;
  }
  
  .navbar-mobile a {
    padding: 15px 20px;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    display: block;
    border-radius: 10px;
    transition: var(--transition);
    text-decoration: none;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .navbar-mobile a:hover,
  .navbar-mobile .active {
    color: var(--white);
    background: var(--secondary-color);
    transform: translateY(-2px);
  }
  
  /* ===== HERO SECTION MOBILE ===== */
  #hero {
    padding: 100px 0 60px 0;
    min-height: auto;
  }
  
  #hero .container .row {
    flex-direction: column-reverse;
  }
  
  #hero h1 {
    font-size: 2rem !important;
    margin-bottom: 1rem;
    text-align: center;
  }
  
  #hero h2 {
    font-size: 1.1rem !important;
    margin-bottom: 2rem;
    text-align: center;
    color: #666;
  }
  
  #hero .hero-img {
    margin-bottom: 2rem;
    text-align: center;
  }
  
  #hero .hero-img img {
    max-width: 80%;
    height: auto;
  }
  
  /* ===== SECTIONS MOBILES ===== */
  .section-title {
    text-align: center;
    margin-bottom: 2rem;
  }
  
  .section-title h2 {
    font-size: 1.8rem !important;
    margin-bottom: 1rem;
  }
  
  .section-title p {
    font-size: 1rem;
    color: #666;
  }
  
  /* Cards et boxes */
  .icon-box, .pricing-card, .faq, .legal-content, .pricing-content {
    margin-bottom: 1.5rem;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
  }
  
  .icon-box h4 {
    font-size: 1.2rem !important;
    margin: 1rem 0 0.5rem 0;
  }
  
  .icon-box p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  /* ===== FORMULAIRE MOBILE ===== */
  .contact-form {
    padding: 0;
  }
  
  .contact-form .form-group {
    margin-bottom: 1.5rem;
  }
  
  .contact-form label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-color);
  }
  
  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    min-height: 48px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  
  .contact-form input:focus,
  .contact-form select:focus,
  .contact-form textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
  }
  
  .contact-form textarea {
    min-height: 120px;
    resize: vertical;
  }
  
  .contact-form button {
    width: 100%;
    min-height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
  }
  
  .contact-form button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
  }
  
  /* Checkbox RGPD */
  .form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 1rem 0;
  }
  
  .form-check-input {
    min-width: 18px;
    height: 18px;
    margin-top: 2px;
  }
  
  .form-check-label {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #666;
  }
  
  /* ===== TABLEAUX MOBILE ===== */
  .pricing-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .pricing-table table {
    min-width: 600px;
    font-size: 0.9rem;
  }
  
  .pricing-table th,
  .pricing-table td {
    padding: 8px;
  }
  
  /* ===== FAQ MOBILE ===== */
  .faq-list ul {
    padding: 0;
  }
  
  .faq-list li {
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  
  .faq-list .collapse {
    padding: 15px 20px;
    background: var(--white);
    border: none;
    font-size: 1rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
  }
  
  .faq-list .collapse:hover {
    background: #f8f9fa;
  }
  
  /* ===== FOOTER MOBILE ===== */
  #footer {
    padding: 2rem 0 1rem 0;
  }
  
  .footer-top .row > div {
    margin-bottom: 2rem;
  }
  
  .footer-contact h3 {
    font-size: 1.3rem !important;
    margin-bottom: 1rem;
  }
  
  .footer-contact p {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  .footer-links h4 {
    font-size: 1.1rem !important;
    margin-bottom: 1rem;
  }
  
  .footer-links ul li {
    margin-bottom: 0.5rem;
  }
  
  .footer-links a {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
  }
  
  .social-links a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    margin-right: 10px;
    font-size: 1.2rem;
    transition: var(--transition);
  }
  
  .social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
  }
  
  /* ===== UTILITAIRES MOBILE ===== */
  .d-none-mobile {
    display: none !important;
  }
  
  .text-center-mobile {
    text-align: center !important;
  }
  
  .mb-mobile {
    margin-bottom: 1rem !important;
  }
  
  /* Espacement optimisé */
  .pt-mobile {
    padding-top: 1rem !important;
  }
  
  .pb-mobile {
    padding-bottom: 1rem !important;
  }
  
  /* Images responsive */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Accordéon mobile */
  .accordion-list ul li a {
    padding: 15px 20px;
    font-size: 1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
  }
  
  /* ===== PERFORMANCES MOBILE ===== */
  
  /* Optimisation des animations */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  /* Amélioration de la zone tactile */
  button, a, input, select, textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(66, 165, 245, 0.2);
  }
  
  /* Optimisation du scroll */
  .navbar-mobile ul,
  .pricing-table {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  /* ===== PETITS ÉCRANS (max 480px) ===== */
  @media (max-width: 480px) {
    
    .container {
      padding-left: 10px;
      padding-right: 10px;
    }
    
    h1 {
      font-size: 1.6rem !important;
    }
    
    h2 {
      font-size: 1.3rem !important;
    }
    
    .btn, .btn-main {
      padding: 10px 16px !important;
      font-size: 0.9rem !important;
    }
    
    .icon-box, .pricing-card {
      padding: 15px;
    }
    
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
      font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    .navbar-mobile ul {
      width: 95%;
      padding: 20px 15px;
    }
    
    .navbar-mobile a {
      padding: 12px 15px;
      font-size: 1rem;
    }
  }
}

/* ===== TABLETTES (768px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  
  .container {
    max-width: 100%;
    padding: 0 30px;
  }
  
  /* Navigation tablette */
  .navbar ul {
    gap: 15px;
  }
  
  .navbar a {
    font-size: 0.9rem;
    padding: 8px 15px;
  }
  
  /* Hero section tablette */
  #hero h1 {
    font-size: 2.2rem !important;
  }
  
  #hero h2 {
    font-size: 1.2rem !important;
  }
  
  /* Grille adaptée */
  .row > .col-xl-3,
  .row > .col-lg-4,
  .row > .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
    margin-bottom: 2rem;
  }
}

/* ===== MODE SOMBRE MOBILE ===== */
.dark-theme {
  
  @media (max-width: 768px) {
    
    .navbar-mobile ul {
      background: #2c3e50;
    }
    
    .navbar-mobile a {
      color: var(--white);
    }
    
    .navbar-mobile a:hover,
    .navbar-mobile .active {
      background: var(--secondary-color);
    }
    
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
      background: #34495e;
      border-color: #556b8d;
      color: var(--white);
    }
    
    .contact-form input::placeholder,
    .contact-form textarea::placeholder {
      color: #bdc3c7;
    }
    
    .icon-box,
    .pricing-card,
    .faq,
    .legal-content {
      background: #34495e;
      color: var(--white);
    }
  }
}