/* ============================================================
   RESPONSIVE.CSS - Architecture Adaptive Mobile-First PWA
   RÈGLE D'OR : Desktop (>768px) = INTACT / Mobile (<768px) = REFONTE
   ============================================================ */

/* ============================================================
   VARIABLES GLOBALES
   ============================================================ */
:root {
    --mobile-touch-target: 44px;
    --mobile-padding: 12px;
    --mobile-header-height: 120px;
    --mobile-z-overlay: 9999;
    --mobile-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   DESKTOP (>768px) : AUCUNE MODIFICATION
   ============================================================ */
@media screen and (min-width: 769px) {
    /* Cacher le header mobile sur desktop */
    .mobile-header {
        display: none !important;
    }
    
    /* Forcer l'affichage du header desktop */
    .dashboard-header {
        display: flex !important;
    }
}

/* ============================================================
   MOBILE (<768px) : REFONTE COMPLÈTE
   ============================================================ */
@media screen and (max-width: 768px) {
    
    /* ========== FIX CRITIQUES : Overflow & Carte ========== */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative;
        overscroll-behavior: none;
    }
    
    body {
        overflow: hidden !important;
    }

    /* Pages sans carte (ex: a propos) doivent pouvoir défiler */
    body.page-apropos {
        overflow-y: auto !important;
        overscroll-behavior: auto;
    }
    
    /* Carte toujours en arrière-plan fixe */
    #map {
        height: 100vh !important;
        width: 100vw !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1 !important;
        touch-action: none !important;
    }
    
    /* ========== CACHER HEADER DESKTOP SUR MOBILE ========== */
    .dashboard-header {
        display: none !important;
    }
    
    /* ========== NOUVEAU HEADER MOBILE : 2 ÉTAGES ========== */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 2000;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(12px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    /* ÉTAGE 1 : Logo (25%) + Recherche (75%) */
    .mobile-header-top {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }
    
    .mobile-logo {
        flex: 0 0 25%;
        min-width: 25%;
    }
    
    .mobile-logo h1 {
        font-size: 1rem !important;
        margin: 0;
        color: var(--primary);
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-search {
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .mobile-search .search-icon {
        position: absolute;
        left: 12px;
        color: #94a3b8;
        font-size: 0.85rem;
        pointer-events: none;
        z-index: 1;
    }
    
    .mobile-search input {
        width: 100%;
        padding: 10px 10px 10px 36px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 25px;
        color: white;
        font-size: 0.85rem;
        min-height: var(--mobile-touch-target);
        outline: none;
        transition: var(--mobile-transition);
    }
    
    .mobile-search input:focus {
        background: rgba(255, 255, 255, 0.15);
        border-color: var(--primary);
    }
    
    .mobile-search input::placeholder {
        color: #94a3b8;
    }
    
    /* ÉTAGE 2 : Barre d'outils avec scroll horizontal */
    .mobile-header-bottom {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 5px 0;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .mobile-header-bottom::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    /* Boutons de la barre d'outils */
    .mobile-tool-btn {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        color: white;
        font-size: 0.7rem;
        font-weight: 600;
        min-width: 70px;
        min-height: var(--mobile-touch-target);
        cursor: pointer;
        transition: var(--mobile-transition);
        white-space: nowrap;
        touch-action: manipulation;
    }
    
    .mobile-tool-btn i {
        font-size: 1.1rem;
    }
    
    .mobile-tool-btn:active {
        background: rgba(16, 185, 129, 0.3);
        border-color: var(--primary);
        transform: scale(0.95);
    }
    
    /* ========== VUES PLEIN ÉCRAN MOBILE ========== */
    .mobile-full-view {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        z-index: var(--mobile-z-overlay) !important;
        background: white !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-y: auto !important;
        transform: translateY(0) !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Header de la vue plein écran */
    .mobile-full-view-header {
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        background: var(--primary);
        color: white;
        padding: 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 10;
        min-height: 60px;
    }
    
    .mobile-full-view-title {
        font-size: 1.2rem;
        font-weight: 800;
        margin: 0;
        flex: 1;
    }
    
    .mobile-full-view-close {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.3rem;
        transition: var(--mobile-transition);
        touch-action: manipulation;
    }
    
    .mobile-full-view-close:active {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(0.9);
    }
    
    /* Contenu de la vue plein écran */
    .mobile-full-view-content {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        background: #f8fafc;
    }
    
    /* ========== MODALE DÉCOUVRIR (Vue Plein Écran Mobile) ========== */
    #discoverModal.active {
        display: block !important;
    }
    
    #discoverModal .discover-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        background: white !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-y: auto !important;
        transform: none !important;
    }
    
    /* Header de la modale découvrir */
    #discoverModal h2 {
        position: sticky !important;
        top: 0 !important;
        margin: 0 !important;
        padding: 20px 15px !important;
        background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
        color: white !important;
        font-size: 1.3rem !important;
        z-index: 10 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }
    
    #discoverModal p {
        color: #64748b !important;
        padding: 0 15px !important;
        margin: 15px 0 !important;
    }
    
    /* Bouton fermer dans discover */
    #discoverModal .discover-content > button[onclick*="closeDiscover"] {
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: none !important;
        color: white !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        z-index: 11 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.5rem !important;
    }
    
    /* Grid catégories */
    .cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 15px !important;
    }
    
    .cat-card {
        padding: 15px !important;
        min-height: 80px !important;
        border-radius: 12px !important;
    }
    
    .cat-card h3 {
        font-size: 0.9rem !important;
        color: #1e293b !important;
    }
    
    /* Résultats */
    .results-container {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 15px !important;
    }
    
    /* ========== PANNEAU STATS (Vue Plein Écran Mobile) ========== */
    .stats-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        background: white !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-y: auto !important;
        z-index: var(--mobile-z-overlay) !important;
        transform: translateX(100%) !important;
        transition: transform var(--mobile-transition) !important;
    }
    
    .stats-panel.active {
        transform: translateX(0) !important;
    }
    
    /* Header stats */
    .stats-header {
        position: sticky !important;
        top: 0 !important;
        background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
        color: white !important;
        padding: 20px 15px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        z-index: 10 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }
    
    .stats-header h2 {
        font-size: 1.3rem !important;
        margin: 0 !important;
        color: white !important;
    }
    
    .close-btn {
        background: rgba(255, 255, 255, 0.2) !important;
        border: none !important;
        color: white !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.3rem !important;
        cursor: pointer !important;
    }
    
    /* Contenu stats */
    .stats-section {
        padding: 15px !important;
        background: #f8fafc !important;
    }
    
    .stats-section-title {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
        color: #1e293b !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 12px !important;
        border-radius: 10px !important;
        background: white !important;
    }
    
    .stat-label {
        font-size: 0.8rem !important;
        color: #64748b !important;
    }
    
    .stat-value {
        font-size: 1.3rem !important;
        font-weight: 800 !important;
    }
    
    /* ========== POPUPS LEAFLET ========== */
    .leaflet-popup-content-wrapper {
        max-width: 90vw !important;
        border-radius: 12px !important;
    }
    
    .leaflet-popup-content {
        width: 280px !important;
        max-width: 90vw !important;
        margin: 0 !important;
    }
    
    .photo-container {
        height: 140px !important;
    }
    
    .weather-box {
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: center !important;
    }
    
    .weather-item {
        font-size: 0.75rem !important;
    }
    
    .simple-popup-body div {
        font-size: 0.85rem !important;
    }
    
    .btn-maps {
        font-size: 0.85rem !important;
        padding: 10px !important;
        min-height: var(--mobile-touch-target) !important;
    }
    
    /* ========== COMPTEUR VISIBLE ========== */
    .visible-counter {
        top: auto !important;
        bottom: 80px !important;
        right: 10px !important;
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        z-index: 1500 !important;
    }
    
    /* ========== NOTIFICATIONS TOAST ========== */
    .map-toast {
        bottom: 70px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        font-size: 0.85rem !important;
        padding: 12px !important;
        z-index: 1500 !important;
    }
    
    .velo-zone-notif {
        bottom: 120px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        z-index: 1500 !important;
    }
    
    /* ========== CONTRÔLES LEAFLET ========== */
    .leaflet-control-zoom {
        display: none !important;
    }
    
    .leaflet-control-layers {
        top: auto !important;
        bottom: 80px !important;
        right: 10px !important;
    }
    
    .leaflet-control-minimap {
        display: none !important;
    }
    
    /* ========== TUTORIEL BOX ========== */
    .tuto-box {
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        padding: 12px !important;
        border-radius: 12px !important;
        z-index: 1500 !important;
    }
    
    .tuto-title {
        font-size: 0.95rem !important;
    }
    
    .tuto-text {
        font-size: 0.8rem !important;
    }
    
    .tuto-btn, .tuto-skip-btn {
        padding: 10px 18px !important;
        font-size: 0.8rem !important;
        min-height: var(--mobile-touch-target) !important;
    }
    
    /* ========== LOADER ========== */
    #map-loader {
        padding: 15px !important;
    }
    
    .bike-loader {
        font-size: 2.5rem !important;
    }
    
    .loading-text {
        font-size: 0.85rem !important;
    }
    
    /* ========== THEME SELECTOR ========== */
    #themeSelectorPanel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 300px !important;
        z-index: var(--mobile-z-overlay) !important;
    }
    
    .theme-option {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        min-height: var(--mobile-touch-target) !important;
    }
    
    /* ========== ECO PANEL ========== */
    #ecoPanelModal {
        padding: 0 !important;
        z-index: var(--mobile-z-overlay) !important;
    }
    
    .eco-panel-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        padding: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
    }
    
    /* ========== TOUCH OPTIMIZATIONS ========== */
    * {
        touch-action: pan-x pan-y;
    }
    
    #map, .leaflet-container {
        touch-action: none !important;
    }
    
    button, input, select, textarea, a {
        touch-action: manipulation !important;
    }
    
    /* ========== PERFORMANCE : Réduire animations ========== */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ============================================================
   TABLET (769px - 1024px)
   ============================================================ */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .mobile-header {
        display: none !important;
    }
    
    .dashboard-header {
        width: 95% !important;
        padding: 10px 25px !important;
    }
    
    .search-container {
        max-width: 350px;
    }
    
    .cat-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .results-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   LANDSCAPE MOBILE
   ============================================================ */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .mobile-header {
        padding: 6px 10px !important;
    }
    
    .mobile-header-top {
        gap: 8px !important;
    }
    
    .mobile-logo h1 {
        font-size: 0.85rem !important;
    }
    
    .mobile-search input {
        padding: 8px 8px 8px 32px !important;
        font-size: 0.8rem !important;
    }
    
    .mobile-tool-btn {
        padding: 6px 10px !important;
        min-height: 40px !important;
    }
    
    .mobile-tool-btn span {
        font-size: 0.65rem !important;
    }
}

/* ============================================================
   CLASSES UTILITAIRES
   ============================================================ */
.mobile-only {
    display: none !important;
}

@media screen and (max-width: 768px) {
    .mobile-only {
        display: initial !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

@media screen and (min-width: 769px) {
    .desktop-only {
        display: initial !important;
    }
}


/* ============================================================
   MEDIA QUERY PRINCIPAL: Mobile (≤768px)
   ============================================================ */
@media screen and (max-width: 768px) {
    
    /* ========== FIX CRITIQUE #1: Overflow Horizontal ========== */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    body {
        overflow-y: auto !important;
        overflow: hidden !important; /* Pour map.html */
    }
    
    /* ========== FIX CRITIQUE #2: Carte Leaflet Mobile ========== */
    #map {
        height: 100vh !important;
        width: 100vw !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1 !important;
        touch-action: none !important; /* Empêche le zoom de la page */
    }
    
    /* ========== HEADER NAVIGATION (index.html) ========== */
    .nav {
        padding: 0 var(--mobile-padding) !important;
        top: 20px !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logo {
        font-size: 1.5rem !important;
    }
    
    .lang-switch {
        padding: 6px 15px !important;
        font-size: 0.75rem !important;
        min-height: var(--mobile-touch-target);
    }
    
    /* ========== HERO SECTION (index.html) ========== */
    .hero {
        padding: 0 var(--mobile-padding) !important;
        height: 100vh !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.1 !important;
    }
    
    .hero-typewriter {
        font-size: 1.3rem !important;
        min-height: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
        padding: 12px 20px !important;
        max-width: 100% !important;
    }
    
    .actions-row {
        flex-direction: column !important;
        width: 100%;
        gap: 15px !important;
    }
    
    .cta-btn {
        padding: 14px 35px !important;
        font-size: 1rem !important;
        width: 100%;
        max-width: 320px;
        justify-content: center;
        min-height: var(--mobile-touch-target);
    }
    
    /* ========== DASHBOARD HEADER (map.html) ========== */
    .dashboard-header {
        position: fixed !important;
        top: 10px !important;
        left: 2% !important;
        width: 96% !important;
        padding: 10px 15px !important;
        border-radius: 25px !important;
        transform: none !important;
        flex-wrap: wrap;
        z-index: 2000 !important;
        gap: 10px;
    }
    
    .brand h1 {
        font-size: 1.1rem !important;
    }
    
    /* Navigation Links - Burger Menu Style */
    .nav-links {
        order: 4;
        width: 100%;
        flex-direction: column;
        display: none; /* Caché par défaut, activé par JS */
        background: rgba(15, 23, 42, 0.98);
        padding: 15px;
        border-radius: var(--mobile-border-radius);
        margin-top: 10px;
        gap: 10px;
    }
    
    .nav-links.open {
        display: flex !important;
    }
    
    .nav-links a {
        margin: 0 !important;
        padding: 12px !important;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        text-align: center;
        min-height: var(--mobile-touch-target);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Burger Menu Button */
    .burger-menu {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
    }
    
    .burger-menu span {
        width: 100%;
        height: 3px;
        background: white;
        border-radius: 10px;
        transition: all 0.3s linear;
    }
    
    .burger-menu.open span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .burger-menu.open span:nth-child(2) {
        opacity: 0;
    }
    
    .burger-menu.open span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Search Container */
    .search-container {
        order: 3;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .search-container input {
        width: 100% !important;
        padding: 10px 10px 10px 35px !important;
        font-size: 0.9rem !important;
        min-height: var(--mobile-touch-target);
    }
    
    /* Actions Buttons */
    .actions {
        order: 2;
        flex-wrap: wrap;
        gap: 5px !important;
        justify-content: flex-end;
    }
    
    .btn-tool {
        padding: 10px !important;
        min-width: var(--mobile-touch-target);
        min-height: var(--mobile-touch-target);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-tool i {
        font-size: 1rem !important;
    }
    
    .btn-discover {
        padding: 8px 15px !important;
        font-size: 0.8rem !important;
        min-height: 38px;
    }
    
    .btn-discover span {
        display: none; /* Cache texte sur mobile */
    }
    
    /* ========== MODALES & OVERLAYS ========== */
    .discover-modal {
        padding: var(--mobile-padding) !important;
    }
    
    .discover-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important;
        max-height: 85vh !important;
        border-radius: var(--mobile-border-radius) !important;
    }
    
    .discover-content h2 {
        font-size: 1.8rem !important;
        margin-bottom: 10px !important;
    }
    
    .discover-content p {
        font-size: 0.9rem !important;
    }
    
    /* Category Grid */
    .cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .cat-card {
        padding: 12px !important;
        min-height: 90px;
    }
    
    .cat-card h3 {
        font-size: 0.85rem !important;
    }
    
    .cat-icon {
        font-size: 1.5rem !important;
    }
    
    /* Results Container */
    .results-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .result-card {
        border-radius: var(--mobile-border-radius) !important;
    }
    
    /* ========== STATS PANEL ========== */
    .stats-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        padding: 15px !important;
        overflow-y: auto !important;
        z-index: 3000 !important;
    }
    
    .stats-header h2 {
        font-size: 1.3rem !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 12px !important;
        border-radius: 10px !important;
    }
    
    .stat-label {
        font-size: 0.85rem !important;
    }
    
    .stat-value {
        font-size: 1.3rem !important;
    }
    
    /* ========== THEME SELECTOR PANEL ========== */
    #themeSelectorPanel {
        top: auto !important;
        bottom: 80px !important;
        right: 10px !important;
        left: auto !important;
        width: auto !important;
        min-width: 150px;
    }
    
    .theme-option {
        padding: 12px 20px !important;
        font-size: 0.85rem !important;
        min-height: var(--mobile-touch-target);
    }
    
    /* ========== LEAFLET POPUPS ========== */
    .leaflet-popup-content-wrapper {
        max-width: 90vw !important;
    }
    
    .leaflet-popup-content {
        width: 280px !important;
        max-width: 90vw !important;
    }
    
    .photo-container {
        height: 140px !important;
    }
    
    /* Weather Box */
    .weather-box {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .weather-item {
        font-size: 0.75rem !important;
    }
    
    /* Simple Popup Body */
    .simple-popup-body div {
        font-size: 0.85rem !important;
    }
    
    .btn-maps {
        font-size: 0.85rem !important;
        padding: 10px !important;
        min-height: var(--mobile-touch-target);
    }
    
    /* ========== VISIBLE COUNTER ========== */
    .visible-counter {
        top: auto !important;
        bottom: 20px !important;
        right: 10px !important;
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
    }
    
    /* ========== TOAST NOTIFICATIONS ========== */
    .map-toast {
        bottom: 70px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        font-size: 0.85rem !important;
        padding: 12px !important;
    }
    
    .velo-zone-notif {
        bottom: 120px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
    }
    
    /* ========== LEAFLET CONTROLS ========== */
    .leaflet-control-zoom {
        display: none !important; /* Utiliser pinch-zoom natif */
    }
    
    .leaflet-control-layers {
        top: auto !important;
        bottom: 10px !important;
        right: 10px !important;
    }
    
    .leaflet-control-minimap {
        display: none !important; /* Trop petit sur mobile */
    }
    
    /* ========== TUTORIEL BOX ========== */
    .tuto-box {
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        padding: 15px !important;
        border-radius: var(--mobile-border-radius) !important;
    }
    
    .tuto-title {
        font-size: 1rem !important;
    }
    
    .tuto-text {
        font-size: 0.85rem !important;
    }
    
    .tuto-btn, .tuto-skip-btn {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
        min-height: var(--mobile-touch-target);
    }
    
    /* ========== LOADER ========== */
    #map-loader {
        padding: var(--mobile-padding) !important;
    }
    
    .bike-loader {
        font-size: 2.5rem !important;
    }
    
    .loading-text {
        font-size: 0.85rem !important;
    }
    
    /* ========== CARNET PAGE (Favoris) ========== */
    .container {
        width: 100% !important;
        padding: 0 var(--mobile-padding) !important;
        margin-top: 100px !important;
    }
    
    .top-section {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .heatmap-container {
        width: 100% !important;
        height: 200px !important;
    }
    
    .card-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .card {
        padding: 15px !important;
    }
    
    /* ========== À PROPOS PAGE ========== */
    .section-card {
        padding: 20px !important;
        border-radius: var(--mobile-border-radius) !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    .tech-tags {
        gap: 8px !important;
    }
    
    .tag {
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
    }
    
    .btn-float {
        bottom: 15px !important;
        right: 15px !important;
        padding: 12px 20px !important;
        font-size: 0.85rem !important;
        min-height: var(--mobile-touch-target);
    }
    
    /* ========== VIDEO BACKGROUND ========== */
    .video-bg {
        object-fit: cover !important;
        height: 100vh !important;
    }
    
    /* ========== SCALE ITEMS ========== */
    .score-scale {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .scale-item {
        width: 100% !important;
        padding: 8px !important;
        font-size: 0.85rem !important;
    }
    
    /* ========== ECO PANEL MODAL ========== */
    #ecoPanelModal {
        padding: var(--mobile-padding) !important;
    }
    
    .eco-panel-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important;
        max-height: 85vh !important;
        border-radius: var(--mobile-border-radius) !important;
    }
    
    /* ========== PERFORMANCE: Reduce animations on low-end ========== */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* ========== FIX: Empêcher le zoom de la page (touch) ========== */
    * {
        touch-action: pan-x pan-y;
    }
    
    #map, .leaflet-container {
        touch-action: none !important;
    }
    
    /* Boutons et inputs doivent permettre le touch */
    button, input, select, textarea, a {
        touch-action: manipulation !important;
    }
}

/* ============================================================
   MEDIA QUERY: Tablets (769px - 1024px)
   ============================================================ */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    
    .dashboard-header {
        width: 95% !important;
        padding: 10px 25px !important;
    }
    
    .search-container {
        max-width: 350px;
    }
    
    .cat-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .results-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   MEDIA QUERY: Landscape Mobile (orientation)
   ============================================================ */
@media screen and (max-width: 768px) and (orientation: landscape) {
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-typewriter {
        font-size: 1.1rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.85rem !important;
        padding: 10px 15px !important;
    }
    
    .dashboard-header {
        padding: 8px 12px !important;
    }
    
    .brand h1 {
        font-size: 1rem !important;
    }
    
    .tuto-box {
        max-height: 40vh !important;
        overflow-y: auto !important;
    }
}

/* ============================================================
   CLASSES UTILITAIRES POUR JS
   ============================================================ */
.mobile-menu-open {
    overflow: hidden !important;
}

.desktop-only {
    display: none !important;
}

@media screen and (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: initial !important;
    }
    
    .burger-menu {
        display: none !important;
    }
}

@media screen and (max-width: 768px) {
    .mobile-only {
        display: initial !important;
    }
    
    /* ========== POPUP LISTE DES GARES - MOBILE ========== */
    .stations-list-popup {
        max-width: 95% !important;
        max-height: 85vh !important;
        border-radius: 15px !important;
    }
    
    .stations-list-header {
        padding: 15px 18px !important;
    }
    
    .stations-list-title {
        font-size: 1.1rem !important;
        gap: 8px !important;
    }
    
    .stations-list-close {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }
    
    .stations-list-content {
        padding: 15px !important;
    }
    
    .station-item {
        padding: 12px !important;
        margin-bottom: 10px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .station-info {
        width: 100% !important;
    }
    
    .station-name {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
    }
    
    .station-score {
        flex-wrap: wrap !important;
    }
    
    .score-badge {
        font-size: 0.85rem !important;
        padding: 3px 10px !important;
    }
    
    .score-label {
        font-size: 0.8rem !important;
    }
    
    .station-actions {
        width: 100% !important;
        justify-content: flex-end !important;
    }
    
    .station-action-btn {
        width: 40px !important;
        height: 40px !important;
        min-height: var(--mobile-touch-target) !important;
    }
    
    /* Position du compteur sur mobile */
    .visible-counter {
        top: 130px !important;
        right: 10px !important;
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        gap: 6px !important;
    }
}