/* ========================================
   RESPONSIVE - PREMIUM MOBILE EXPERIENCE
======================================= */
@media (max-width: 1024px) {
    .services-grid,
    .features-grid,
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .portfolio-grid .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* ========================================
       TWEAKS "APP-LIKE" NATIFS 
    ======================================= */
    * {
        -webkit-tap-highlight-color: transparent !important; /* Supprime le carré bleu natif au tap */
    }
    img, svg, .service-card, .feature-card, .portfolio-img {
        user-select: none; /* Empêche le popup "Enregistrer l'image" ou la sélection au long-press */
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
    .btn, .slider-arrow, a {
        touch-action: manipulation; /* Optimise la réactivité du double-tap/zoom */
    }
    .btn:active, .slider-arrow:active, .category-filter:active {
        transform: scale(0.95) !important; /* Feedback "enfoncement" très premium */
        transition: transform 0.1s ease !important;
    }

    /* Navbar & Menu Mobile (Full Screen Overlay) */
    .nav-cta {
        display: none; 
    }
    
    .navbar {
        padding: 0.8rem 5%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .nav-menu {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        z-index: 999;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    .nav-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.5s; }
    
    .nav-menu a {
        display: inline-block;
        padding: 15px 30px;
        font-size: 1.8rem;
        font-weight: 800;
        color: var(--secondary-color);
        border: none;
        font-family: var(--font-title);
    }
    
    .nav-menu a:hover, .nav-menu a:active {
        color: var(--primary-color);
        transform: scale(1.1);
    }
    
    .nav-menu a:after {
        display: none; 
    }
    
    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 10px;
        z-index: 1001; /* Always above the invisible menu */
    }
    
    .hamburger span {
        width: 28px;
        height: 3px;
        background: var(--primary-color);
        margin: 3px 0;
        transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        border-radius: 3px;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        background: var(--secondary-color);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        background: var(--secondary-color);
    }
    
    /* Espacements Globaux */
    .section-padding {
        padding: 4rem 0 !important;
    }
    
    .page-header {
        padding: 100px 0 30px;
        margin-bottom: 2rem;
    }
    
    /* Typographie */
    .hero {
        height: auto !important;
        min-height: 100vh;
        padding-top: 120px;
        padding-bottom: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 2.8rem;
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
        padding: 0 10px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
        line-height: 1.3;
    }
    
    /* PREMIUM APP-LIKE HORIZONTAL SCROLLING for Grids */
    .slider-container {
        position: relative;
    }
    
    .slider-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: var(--white);
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 50%;
        color: var(--primary-color);
        font-size: 1.2rem;
        display: flex; /* Shown on mobile */
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .slider-arrow.prev { left: -10px; }
    .slider-arrow.next { right: -10px; }
    
    .services-grid,
    .portfolio-grid,
    .features-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        gap: 1.5rem;
        padding-bottom: 2rem;
        padding-top: 1rem;
        margin-right: -20px;
        margin-left: -20px;
        padding-left: 20px;
        padding-right: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .services-grid::-webkit-scrollbar,
    .portfolio-grid::-webkit-scrollbar,
    .features-grid::-webkit-scrollbar {
        display: none;
    }
    
    .service-card,
    .portfolio-item,
    .feature-card {
        flex: 0 0 calc(85vw - 20px);
        max-width: 340px;
        scroll-snap-align: center;
        margin-bottom: 0 !important;
        height: 100%;
    }
    
    /* Grilles classiques (qui s'empilent) */
    .stats-grid,
    .references-grid,
    .values-grid,
    .team-grid,
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .story-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Composants Spécifiques */
    .service-card, .feature-card, .value-card {
        padding: 2rem 1.5rem;
        box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    }
    
    .stats-floating {
        padding: 1.5rem 1rem;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 5px;
        border-radius: 15px;
    }
    
    .stat-item {
        width: 32%;
        justify-content: flex-start;
        text-align: center;
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        margin: 0 auto;
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 0px;
    }
    
    .stat-label {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .stat-divider {
        display: none;
    }
    
    .quote-box-modern.glass-panel-dark {
        padding: 2rem 1.5rem;
    }
    
    .quote-split {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem;
        text-align: center;
        width: 100%;
    }
    
    .qc-item {
        justify-content: center;
    }
    
    /* Devis Rapide (Modern Quote) */
    .modern-quote {
        padding: 3rem 0;
        overflow: hidden;
    }
    .quote-text h2 {
        font-size: 1.8rem;
        word-wrap: break-word;
        margin-bottom: 1rem;
    }
    .quote-text p {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    .qc-item i {
        font-size: 2rem;
    }
    .qc-item a {
        font-size: 1.25rem;
    }
    .quote-box-modern.glass-panel-dark {
        padding: 1.5rem;
    }
    .form-group {
        margin-bottom: 1rem;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }
    
    .footer-section h4 {
        margin-bottom: 1rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Catégories de Filtre */
    .categories-wrapper {
        gap: 10px;
        justify-content: center;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 15px;
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .categories-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .category-filter {
        flex: 0 0 auto;
        padding: 10px 20px;
        font-size: 0.95rem;
        white-space: nowrap;
    }
    
    /* Lightbox */
    #lightbox-img {
        max-width: 95% !important;
        max-height: 70vh !important;
    }
    
    #lightbox .fa-times {
        top: 25px !important;
        right: 25px !important;
        font-size: 2.2rem !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px; /* Légèrement plus aéré pour iPhone récent */
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin-bottom: 12px;
        min-height: 50px; /* Touch target Apple HIG */
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .city-tag {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
    
    .logo-img {
        height: 40px;
    }
    
    /* Fix pour empêcher les champs de sortir au clic (focus) */
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Bouton d'envoi et texte sous le bouton */
    .quote-box-modern .btn {
        width: 100%;
        margin-top: 5px;
        white-space: normal;
        height: auto;
        padding: 12px;
    }
    .quote-box-modern .text-muted {
        font-size: 0.75rem;
        display: block;
        margin-top: 10px;
        line-height: 1.4;
    }

    /* Fix pour le Google ReCaptcha qui casse la largeur (304px natifs) sur petits écrans */
    .recaptcha-wrapper {
        display: flex;
        justify-content: center; /* Centre le captcha parfaitement au dessus du bouton */
        overflow: hidden;
        margin-bottom: -15px; /* Compense visuellement la réduction d'échelle */
        width: 100%;
        max-width: 100%;
    }
    .recaptcha-wrapper .g-recaptcha {
        transform: scale(0.72); /* Réduction ultra-compacte */
        transform-origin: center center;
    }
}

