/* ========================================
   OPTIMISATIONS MOBILE - Plaquiste O.Guery
   ======================================== */

/* ===== AMÉLIORATIONS GÉNÉRALES MOBILE ===== */
@media (max-width: 768px) {
    
    /* Corps de texte plus lisible sur mobile */
    body {
        font-size: 16px;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Container avec padding optimisé pour mobile */
    .container {
        padding: 0 20px;
        max-width: 100%;
    }

    /* ===== NAVBAR MOBILE ===== */
    .navbar {
        padding: 0.5rem 0;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .nav-menu {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 16px 16px;
    }

    .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* Burger menu amélioré */
    .mobile-menu-toggle {
        padding: 8px;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }

    /* ===== HERO SECTION MOBILE ===== */
    .hero {
        min-height: 100vh;
        padding-top: 80px;
    }

    .hero .container {
        padding: 0 24px;
    }

    .hero-content {
        padding: 80px 0 60px;
        max-width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
        text-align: center;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
        justify-content: center;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
        padding: 1rem 2rem;
        font-size: 1rem;
        justify-content: center;
    }

    .hero-features {
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 3rem;
        align-items: center;
    }

    .feature-item {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    /* ===== SECTIONS MOBILE ===== */
    section {
        padding: 3rem 0;
    }

    .section-header {
        text-align: center;
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .section-description {
        font-size: 1rem;
        white-space: normal;
    }

    /* ===== SERVICE TILES MOBILE ===== */
    .services-tiles {
        gap: 2rem;
    }

    .service-tile {
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .service-tile-image {
        height: 220px;
    }

    .service-tile-content {
        padding: 1.5rem;
    }

    .service-tile h4 {
        font-size: 1.35rem;
        margin-bottom: 0.75rem;
    }

    .service-tile p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .service-tile ul {
        font-size: 0.9rem;
    }

    .service-tag {
        font-size: 0.8rem;
        padding: 5px 14px;
    }

    /* ===== STATS MOBILE ===== */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-tile {
        padding: 1.5rem;
        text-align: center;
    }

    .stat-icon-lite {
        margin: 0 auto 1rem;
    }

    .stat-tile-value {
        font-size: 2rem;
    }

    .stat-tile-label {
        font-size: 0.95rem;
    }

    /* ===== CONTACT INFO MOBILE ===== */
    .contact-info {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .info-card {
        padding: 1.75rem 1.25rem;
    }

    .info-card h3 {
        font-size: 1.1rem;
    }

    .info-card p {
        font-size: 1rem;
        word-break: break-word;
    }

    .info-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    /* ===== FORMULAIRE MOBILE ===== */
    .contact-form {
        padding: 0;
    }

    .contact-form input,
    .contact-form textarea,
    .contact-form select {
        padding: 0.875rem;
        font-size: 16px; /* Évite le zoom sur iOS */
        border-radius: 8px;
    }

    .contact-form textarea {
        min-height: 140px;
    }

    .contact-form .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }

    /* ===== AVIS CLIENTS MOBILE ===== */
    .review-card {
        padding: 1.5rem;
        min-width: 280px;
        max-width: 320px;
    }

    .review-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .review-author strong {
        font-size: 0.95rem;
    }

    /* ===== FOOTER MOBILE ===== */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        padding: 0;
    }

    .footer-title {
        font-size: 1.5rem;
    }

    .footer-description,
    .footer-links,
    .footer-contact {
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding-top: 2rem;
    }

    .footer-legal {
        gap: 1.5rem;
    }

    /* ===== BOUTONS TACTILES ===== */
    .btn,
    .nav-link,
    .mobile-menu-toggle,
    a {
        min-height: 44px; /* Taille minimale pour touch */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* ===== SCROLL INDICATOR MOBILE ===== */
    .scroll-indicator {
        bottom: 1.5rem;
        font-size: 0.85rem;
    }

    /* ===== OPTIMISATION PERFORMANCES MOBILE ===== */
    * {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
        touch-action: manipulation;
    }

    /* Réduction des animations sur mobile pour performances */
    .service-tile,
    .stat-tile,
    .info-card {
        transition-duration: 0.3s; /* Plus rapide sur mobile */
    }
}

/* ===== PETITS MOBILES (iPhone SE, etc.) ===== */
@media (max-width: 375px) {
    
    .hero-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .hero-buttons .btn,
    .contact-form .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .service-tile-image {
        height: 200px;
    }

    .service-tile-content {
        padding: 1.25rem;
    }

    .stat-tile-value {
        font-size: 1.75rem;
    }

    .review-card {
        min-width: 260px;
        padding: 1.25rem;
    }

    .footer-title {
        font-size: 1.35rem;
    }
}

/* ===== GRANDS MOBILES / PETITES TABLETTES ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    
    .hero-content {
        max-width: 600px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .services-tiles {
        gap: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .contact-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }

    .footer-description,
    .footer-links,
    .footer-contact {
        text-align: left;
    }
}

/* ===== MODE PAYSAGE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }

    .hero-content {
        padding: 60px 0 40px;
    }

    .hero-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 2rem;
    }

    .feature-item {
        width: auto;
        max-width: 200px;
    }
}

/* ===== AMÉLIORATION ACCESSIBILITÉ MOBILE ===== */
@media (max-width: 768px) {
    
    /* Focus visible amélioré */
    button:focus-visible,
    a:focus-visible,
    input:focus-visible {
        outline: 3px solid #2563eb;
        outline-offset: 4px;
    }

    /* Texte sélectionnable facilement */
    p, li, span {
        user-select: text;
        -webkit-user-select: text;
    }

    /* Liens et boutons bien espacés */
    .nav-link,
    .footer-links a {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
    }
}

/* ===== SAFE AREA POUR iPhone X+ ===== */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .navbar {
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
        }

        .hero .container,
        .container {
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
        }

        .footer {
            padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
        }
    }
}

/* ===== DARK MODE (si souhaité plus tard) ===== */
@media (prefers-color-scheme: dark) {
    /* Préparé pour le dark mode si besoin */
}

/* ===== AMÉLIORATION LISIBILITÉ SOLEIL ===== */
@media (max-width: 768px) {
    .hero-title,
    .hero-subtitle {
        text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    }

    .btn-primary {
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    }
}

/* ===== OPTIMISATION MENU MOBILE ===== */
@media (max-width: 768px) {
    .nav-menu.active {
        animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Menu fermé visuellement */
    .nav-menu:not(.active) {
        pointer-events: none;
    }
}

/* ===== AMÉLIORATION IMAGES MOBILE ===== */
@media (max-width: 768px) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }

    .service-tile-image img,
    .hero::before {
        object-fit: cover;
        object-position: center;
    }
}

/* ===== ESPACEMENT TACTILE ===== */
@media (max-width: 768px) {
    /* Espace entre éléments cliquables */
    .info-card,
    .service-tile,
    .stat-tile {
        margin-bottom: 1rem;
    }

    /* Boutons bien espacés */
    .hero-buttons > * + * {
        margin-top: 0;
    }
}
