/* =================================================================
   CORRECTIONS RESPONSIVE POUR PETITS ÉCRANS (iPhone SE2 - 375px)
   Optimisations pour les écrans de 320px à 414px
   ================================================================= */

/* CORRECTIONS GÉNÉRALES MOBILES */
/* ============================= */

/* Container responsive */
@media (max-width: 414px) {
    .container {
        max-width: 100%;
        padding: 0 15px; /* Réduction du padding latéral */
    }
}

@media (max-width: 375px) {
    .container {
        padding: 0 12px; /* Encore plus réduit pour iPhone SE2 */
    }
}

/* HEADER ET NAVIGATION */
/* =================== */

@media (max-width: 414px) {
    .header {
        padding: 0;
    }
    
    .nav-container {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logo {
        gap: 10px;
        flex-shrink: 0;
    }
    
    .logo img {
        width: 45px;
        height: 45px;
    }
    
    .logo-name {
        font-size: 1.3em;
        line-height: 1.1;
    }
    
    .logo-certif {
        font-size: 0.75em;
        line-height: 1.1;
    }
    
    .contact-cta, .cta-header, .phone-header {
        padding: 8px 12px;
        font-size: 0.85em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
}

@media (max-width: 375px) {
    .nav-container {
        padding: 8px 12px;
    }
    
    .logo img {
        width: 40px;
        height: 40px;
    }
    
    .logo-name {
        font-size: 1.1em;
    }
    
    .logo-certif {
        font-size: 0.7em;
    }
    
    .contact-cta, .cta-header, .phone-header {
        padding: 6px 10px;
        font-size: 0.8em;
        max-width: 100px;
    }
}

/* NAVIGATION MOBILE */
@media (max-width: 414px) {
    .nav-menu {
        top: 100%;
        left: 0;
        right: 0;
        background: var(--warm-white);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        padding: 15px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu.active {
        max-height: 100vh !important;
    }
    
    .nav-menu li {
        margin: 8px 0;
    }
    
    .nav-menu a {
        padding: 12px 15px;
        display: block;
        border-radius: 8px;
        transition: background 0.3s ease;
    }
}

/* HERO SECTIONS */
/* ============= */

@media (max-width: 414px) {
    .hero, .hero-services, .hero-methods, .hero-about, .hero-contact {
        padding: 40px 0;
        min-height: auto;
    }
    
    .hero-container, .hero-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero h1, .hero-services h1, .hero-methods h1, .hero-about h1, .hero-contact h1 {
        font-size: 2em;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 1em;
        margin-bottom: 25px;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 375px) {
    .hero, .hero-services, .hero-methods, .hero-about, .hero-contact {
        padding: 30px 0;
    }
    
    .hero h1, .hero-services h1, .hero-methods h1, .hero-about h1, .hero-contact h1 {
        font-size: 1.8em;
    }
    
    .hero-subtitle {
        font-size: 0.95em;
    }
}

/* BADGES ET CERTIFICATIONS */
/* ======================== */

@media (max-width: 414px) {
    .badges, .credentials, .hero-guarantees {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .badge, .credential-badge, .guarantee-badge {
        padding: 8px 12px;
        font-size: 0.85em;
        text-align: center;
        white-space: normal;
        line-height: 1.3;
    }
    
    .hero-stats {
        flex-direction: row;
        justify-content: space-around;
        gap: 15px;
        margin-top: 20px;
    }
    
    .stat-item {
        text-align: center;
        min-width: 80px;
    }
    
    .stat-number {
        font-size: 1.5em;
        display: block;
    }
    
    .stat-label {
        font-size: 0.8em;
        line-height: 1.2;
    }
}

@media (max-width: 375px) {
    .badge, .credential-badge, .guarantee-badge {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    
    .hero-stats {
        gap: 10px;
    }
    
    .stat-item {
        min-width: 70px;
    }
    
    .stat-number {
        font-size: 1.3em;
    }
    
    .stat-label {
        font-size: 0.75em;
    }
}

/* GRILLES RESPONSIVE */
/* ================== */

@media (max-width: 414px) {
    .services-grid, .problems-grid, .methods-grid, .techniques-grid,
    .help-options, .guarantees-grid, .certif-grid, .expertise-grid,
    .contact-methods .methods-grid, .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-card, .problem-card, .technique-card, .help-card,
    .guarantee-item, .certif-card, .expertise-card, .method-card, .info-card {
        padding: 20px;
        margin: 0;
    }
}

@media (max-width: 375px) {
    .services-grid, .problems-grid, .methods-grid, .techniques-grid,
    .help-options, .guarantees-grid, .certif-grid, .expertise-grid,
    .contact-methods .methods-grid, .info-grid {
        gap: 15px;
    }
    
    .service-card, .problem-card, .technique-card, .help-card,
    .guarantee-item, .certif-card, .expertise-card, .method-card, .info-card {
        padding: 15px;
    }
}

/* BOUTONS ET CTA */
/* ============== */

@media (max-width: 414px) {
    .hero-cta, .cta-buttons {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary, .btn-white {
        width: 100%;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 1em;
        text-align: center;
        justify-content: center;
    }
    
    .problems-cta, .service-cta {
        margin-top: 20px;
    }
    
    .problems-cta .btn-primary, .service-cta .btn-primary {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 375px) {
    .btn-primary, .btn-secondary, .btn-white {
        max-width: 260px;
        padding: 10px 18px;
        font-size: 0.95em;
    }
    
    .hero-cta, .cta-buttons {
        gap: 10px;
    }
}

/* FORMULAIRE DE CONTACT */
/* ===================== */

@media (max-width: 414px) {
    .contact-form-section {
        padding: 40px 0;
    }
    
    .form-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .form-intro {
        text-align: center;
    }
    
    .form-benefits {
        text-align: left;
        font-size: 0.9em;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        width: 100%;
    }
    
    .form-group label {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .form-group input, .form-group select, .form-group textarea {
        padding: 12px;
        font-size: 1em;
        border-radius: 8px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 1.1em;
    }
    
    .checkbox-group {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    
    .checkbox-group label {
        font-size: 0.85em;
        line-height: 1.4;
    }
}

@media (max-width: 375px) {
    .contact-form-section {
        padding: 30px 0;
    }
    
    .form-container {
        gap: 25px;
    }
    
    .form-group input, .form-group select, .form-group textarea {
        padding: 10px;
        font-size: 0.95em;
    }
    
    .submit-btn {
        padding: 12px 18px;
        font-size: 1em;
    }
    
    .checkbox-group label {
        font-size: 0.8em;
    }
}

/* TABLEAUX RESPONSIVE */
/* =================== */

@media (max-width: 414px) {
    .data-table, .table-style {
        font-size: 0.8em;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        margin: 20px -15px;
        padding: 0 15px;
    }
    
    .data-table th, .data-table td,
    .table-style th, .table-style td {
        padding: 8px 6px;
        min-width: 80px;
    }
}

@media (max-width: 375px) {
    .data-table, .table-style {
        font-size: 0.75em;
        margin: 15px -12px;
        padding: 0 12px;
    }
    
    .data-table th, .data-table td,
    .table-style th, .table-style td {
        padding: 6px 4px;
        min-width: 70px;
    }
}

/* SECTIONS SPÉCIALES */
/* ================== */

@media (max-width: 414px) {
    .comparison .vs-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .method-card {
        padding: 20px;
    }
    
    .method-features {
        font-size: 0.9em;
    }
    
    .timeline-item {
        margin-left: 0;
        padding-left: 30px;
    }
    
    .timeline-date {
        position: static;
        background: var(--primary-green);
        color: white;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 0.8em;
        margin-bottom: 10px;
        display: inline-block;
    }
}

@media (max-width: 375px) {
    .method-card {
        padding: 15px;
    }
    
    .method-features {
        font-size: 0.85em;
    }
    
    .timeline-item {
        padding-left: 25px;
    }
}

/* FOOTER RESPONSIVE */
/* ================= */

@media (max-width: 414px) {
    .footer {
        padding: 30px 0 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }
    
    .footer-section h3 {
        margin-bottom: 10px;
        font-size: 1.1em;
    }
    
    .footer-section p {
        font-size: 0.9em;
        line-height: 1.6;
    }
    
    .footer-bottom {
        font-size: 0.8em;
        text-align: center;
        margin-top: 20px;
    }
}

@media (max-width: 375px) {
    .footer {
        padding: 25px 0 12px;
    }
    
    .footer-content {
        gap: 20px;
    }
    
    .footer-section p {
        font-size: 0.85em;
    }
    
    .footer-bottom {
        font-size: 0.75em;
    }
}

/* CTA MOBILE FIXE */
/* =============== */

@media (max-width: 414px) {
    .mobile-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--primary-green);
        padding: 12px 15px;
        display: flex;
        gap: 10px;
        z-index: 1000;
        box-shadow: 0 -3px 15px rgba(0,0,0,0.2);
    }
    
    .mobile-cta a {
        flex: 1;
        background: var(--warm-white);
        color: var(--primary-green);
        padding: 12px 15px;
        border-radius: 25px;
        text-decoration: none;
        font-weight: 600;
        text-align: center;
        font-size: 0.9em;
        transition: all 0.3s ease;
    }
    
    .mobile-cta a:hover {
        background: var(--primary-beige);
        transform: translateY(-2px);
    }
    
    /* Ajouter padding bottom au body pour éviter que le contenu soit masqué */
    body {
        padding-bottom: 70px;
    }
}

@media (max-width: 375px) {
    .mobile-cta {
        padding: 10px 12px;
    }
    
    .mobile-cta a {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    body {
        padding-bottom: 65px;
    }
}

/* CORRECTIONS SPÉCIFIQUES DÉBORDEMENT */
/* =================================== */

@media (max-width: 414px) {
    /* Éviter le débordement horizontal */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Images responsives */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Texte long */
    .hero-title, .section-title, .error-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Conteneurs avec scroll horizontal si nécessaire */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Éviter débordement des éléments positionnés */
    .breadcrumb {
        padding: 10px 15px;
        overflow-x: auto;
    }
    
    .breadcrumb a, .breadcrumb span {
        white-space: nowrap;
    }
}

@media (max-width: 375px) {
    .breadcrumb {
        padding: 8px 12px;
        font-size: 0.85em;
    }
}

/* CORRECTIONS FAQ ET ACCORDÉONS */
/* ============================= */

@media (max-width: 414px) {
    .faq-item {
        margin-bottom: 15px;
    }
    
    .faq-question {
        padding: 15px;
        font-size: 0.95em;
        line-height: 1.4;
    }
    
    .faq-answer {
        padding: 15px;
        font-size: 0.9em;
        line-height: 1.5;
    }
}

@media (max-width: 375px) {
    .faq-question {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .faq-answer {
        padding: 12px;
        font-size: 0.85em;
    }
}

/* CORRECTIONS ERREURS 404/500 */
/* ============================ */

@media (max-width: 414px) {
    .error-container {
        padding: 30px 0;
    }
    
    .error-code {
        font-size: 4em;
        margin-bottom: 15px;
    }
    
    .error-icon {
        font-size: 3em;
        margin-bottom: 20px;
    }
    
    .error-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .error-subtitle {
        font-size: 1em;
        margin-bottom: 25px;
    }
}

@media (max-width: 375px) {
    .error-code {
        font-size: 3.5em;
    }
    
    .error-icon {
        font-size: 2.5em;
    }
    
    .error-title {
        font-size: 1.6em;
    }
    
    .error-subtitle {
        font-size: 0.95em;
    }
}

/* AMÉLIORATIONS UX MOBILE */
/* ======================= */

@media (max-width: 414px) {
    /* Améliorer les zones de clic */
    a, button, .btn-primary, .btn-secondary, .btn-white {
        min-height: 44px; /* Recommandation Apple */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Scroll smooth sur iOS */
    html {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Éviter le zoom sur les inputs iOS */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Focus visible amélioré */
    input:focus, select:focus, textarea:focus, button:focus {
        outline: 2px solid var(--accent-green);
        outline-offset: 2px;
    }
}

/* PRINT STYLES (BONUS) */
/* ==================== */

@media print {
    .header, .footer, .mobile-cta, .hamburger {
        display: none !important;
    }
    
    .container {
        padding: 0;
        max-width: none;
    }
    
    .hero, .section {
        page-break-inside: avoid;
    }
}