/**
 * Styles Mobile Responsive - Application Native Look
 * Design Mobile-First avec navigation hybride
 * 
 * @package UMOA
 * @version 1.0
 */

/* ============================================================================
   VARIABLES MOBILE
   ============================================================================ */

:root {
    /* Hauteurs de navigation mobile */
    --mobile-top-height: 56px; /* Hauteur du header mobile fixe */
    --mobile-bottom-height: 60px;
    --mobile-safe-area-top: env(safe-area-inset-top, 0px);
    --mobile-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    
    /* Border radius mobile (plus prononcés) */
    --radius-mobile-sm: 12px;
    --radius-mobile-md: 16px;
    --radius-mobile-lg: 20px;
    --radius-mobile-xl: 24px;
    
    /* Transitions fluides 60fps */
    --transition-mobile: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                          opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Couleurs responsive - Option 8 : Sombre élégant */
    --navbar-bg: #1F2937; /* Gris anthracite foncé */
    --navbar-border: #004AAD; /* Bleu UMOA */
    --navbar-border-width: 2px;
    --navbar-text: #FFFFFF; /* Blanc */
    --navbar-accent: #F2C94C; /* Or UMOA */
    --navbar-badge: #EF4444; /* Rouge */
    --navbar-hover: #374151; /* Gris moyen */
    --navbar-radius: 16px; /* Coins arrondis */
}

/* Couleurs responsive pour tablettes */
@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --navbar-border-width: 2px;
    }
}

/* Couleurs responsive pour petits mobiles */
@media (max-width: 480px) {
    :root {
        --navbar-border-width: 1.5px;
    }
}

/* Couleurs responsive pour très petits écrans */
@media (max-width: 360px) {
    :root {
        --navbar-border-width: 1px;
    }
}

/* ============================================================================
   BASE MOBILE - Prévenir zoom auto sur inputs
   ============================================================================ */

@media (max-width: 768px) {
    /* Prévenir le zoom automatique sur les inputs iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="search"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important; /* iOS ne zoom pas si font-size >= 16px */
    }
    
    /* Améliorer le touch target (minimum 44x44px pour accessibilité) */
    button,
    a,
    input[type="button"],
    input[type="submit"],
    .btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Boutons modaux et de fermeture - garantir taille minimale et tactile */
    .modal-close,
    .close-btn,
    .close-modal,
    .alert-close,
    .chat-search-close,
    .filter-bottom-sheet-close,
    .sidebar-close,
    .reply-preview-close,
    .mobile-menu-close {
        min-width: 44px !important;
        min-height: 44px !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        pointer-events: auto !important;
        z-index: 10;
    }
    
    /* Supprimer les effets hover sur mobile (éviter les bugs tactiles) */
    *:hover {
        /* Désactiver les transformations hover sur mobile */
    }
    
    /* Utiliser :active à la place de :hover pour le feedback tactile */
    button:active,
    a:active,
    .btn:active,
    .card:active,
    .nav-link:active {
        transform: scale(0.95);
        opacity: 0.85;
        transition: var(--transition-mobile);
    }
    
    /* Feedback tactile avec ripple effect */
    button,
    .btn,
    .card.clickable,
    .nav-link {
        position: relative;
        overflow: hidden;
    }
    
    /* Ripple effect au touch */
    button::after,
    .btn::after,
    .card.clickable::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s;
        pointer-events: none;
    }
    
    button:active::after,
    .btn:active::after,
    .card.clickable:active::after {
        width: 300px;
        height: 300px;
        transition: width 0.3s, height 0.3s;
    }
    
    /* Vibration légère sur certains éléments (si supporté) */
    button:active,
    .btn:active {
        -webkit-tap-highlight-color: rgba(74, 144, 226, 0.3);
    }
    
    /* Feedback visuel pour les inputs */
    input:focus,
    textarea:focus,
    select:focus {
        transform: scale(1.01);
        transition: transform 0.2s ease;
    }
    
    input:active,
    textarea:active,
    select:active {
        transform: scale(0.99);
    }
}

/* ============================================================================
   NAVIGATION DESKTOP - Masquer sur mobile
   ============================================================================ */

@media (max-width: 768px) {
    .navbar-desktop {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .navbar-mobile-top,
    .navbar-mobile-bottom,
    .mobile-menu-overlay,
    nav.navbar-mobile-top,
    nav.navbar-mobile-bottom {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* ============================================================================
   NAVIGATION MOBILE - TOP BAR (Header Fixe Professionnel)
   ============================================================================ */

.navbar-mobile-top {
    width: 100%;
    max-width: 100vw;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;     /* Centre verticalement */
    justify-content: space-between;
    background: var(--navbar-bg, #1F2937); /* Fond sombre élégant - responsive */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Ombre subtile pour le thème sombre */
    box-sizing: border-box;
    margin: 0;
    padding: 0 !important;
    padding-top: env(safe-area-inset-top, 0px); /* Juste ce qu'il faut pour l'encoche */
    border: var(--navbar-border-width, 2px) solid var(--navbar-border, #004AAD); /* Bordure bleu UMOA sur les 4 côtés - responsive */
    border-radius: 0 0 var(--navbar-radius, 16px) var(--navbar-radius, 16px); /* Coins arrondis en bas */
    overflow-x: hidden;
    /* Hauteur fixe pour éviter les espaces vides */
    height: 56px !important;
    overflow: hidden;
    line-height: normal !important;
}

@media (max-width: 768px) {
    .navbar-mobile-top {
        display: flex; /* Garder flex pour maintenir la structure du header */
    }
}

.mobile-top-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important; /* Centre les éléments verticalement */
    justify-content: space-between;
    height: 100%; /* Occupe toute la hauteur du parent */
    padding: 0 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; /* Inclure le padding dans la largeur */
    margin: 0;
}

/* Bouton Hamburger */
.mobile-menu-toggle {
    background: none;
    border: none;
    padding: 0 !important;
    cursor: pointer;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 100% !important; /* Occupe toute la hauteur pour se centrer */
    min-width: 40px;
    max-width: 40px;
    z-index: 1001;
    transition: var(--transition-mobile);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* Feedback visuel sur mobile */
    touch-action: manipulation; /* Optimiser les interactions tactiles */
    user-select: none; /* Empêcher la sélection de texte */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Limiter la zone de touch à la taille du bouton */
    position: relative;
    overflow: visible;
    margin: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    /* S'assurer que le bouton ne déborde pas */
    contain: layout style;
    line-height: 1 !important;
    vertical-align: middle !important;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--navbar-text, #1F2937); /* Texte/icônes - gris anthracite - responsive */
    border-radius: 2px;
    transition: var(--transition-mobile);
    transform-origin: center;
    pointer-events: none; /* Empêcher les spans d'intercepter les clics */
    -webkit-tap-highlight-color: transparent; /* Supprimer le highlight sur mobile */
    /* Espacement entre les lignes du hamburger */
    margin: 3px 0;
    display: block;
    flex-shrink: 0;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Logo mobile */
.mobile-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0; /* Permet au logo de se réduire si nécessaire */
    padding: 0 10px;
}

.mobile-logo-img {
    height: 32px;
    max-width: 120px;
    object-fit: contain;
}

/* Actions top (chat, panier, notifications) */
.mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-icon-link {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px;
    height: 100% !important; /* Oblige l'élément à occuper toute la hauteur pour se centrer */
    min-width: 40px;
    color: var(--navbar-text, #1F2937); /* Texte/icônes - gris anthracite - responsive */
    text-decoration: none;
    border-radius: var(--radius-mobile-sm);
    transition: var(--transition-mobile);
    flex-shrink: 0;
    box-sizing: border-box;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    line-height: 1 !important;
    vertical-align: middle !important;
}

.mobile-icon-link:hover {
    background-color: var(--navbar-hover, #374151); /* Hover gris moyen - responsive */
}

.mobile-icon-link:active {
    background-color: var(--navbar-hover, #374151); /* Hover gris moyen - responsive */
    transform: scale(0.95);
}

.mobile-icon-link svg {
    width: 22px;
    height: 22px;
}

.mobile-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--navbar-badge, #EF4444); /* Badges notifications - rouge - responsive */
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--navbar-bg, #1F2937); /* Bordure sombre pour fond sombre - responsive */
}

/* ============================================================================
   BARRE DE RECHERCHE MOBILE
   ============================================================================ */

.mobile-search-bar {
    width: 100%;
    background: var(--navbar-bg, #1F2937); /* Fond sombre élégant - responsive */
    border: var(--navbar-border-width, 2px) solid var(--navbar-border, #004AAD); /* Bordure bleu UMOA sur les 4 côtés - responsive */
    border-radius: var(--navbar-radius, 16px); /* Coins arrondis */
    padding: 10px 15px;
    box-sizing: border-box;
    animation: slideDown 0.3s ease-out;
    margin: 8px 12px; /* Marge pour l'effet arrondi */
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-search-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex: 1;
}

.mobile-search-back {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navbar-text, #1F2937); /* Texte/icônes - gris anthracite - responsive */
    border-radius: var(--radius-mobile-sm);
    transition: var(--transition-mobile);
    flex-shrink: 0;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

.mobile-search-back:hover {
    background-color: var(--navbar-hover, #374151); /* Hover gris moyen - responsive */
}

.mobile-search-back:active {
    background-color: var(--navbar-hover, #374151); /* Hover gris moyen - responsive */
    transform: scale(0.95);
}

.mobile-search-back svg {
    width: 20px;
    height: 20px;
}

.mobile-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2); /* Bordure semi-transparente pour thème sombre */
    border-radius: var(--radius-mobile-md);
    font-size: 16px; /* Évite le zoom automatique sur iOS */
    color: var(--navbar-text, #FFFFFF); /* Texte blanc - responsive */
    background: rgba(255, 255, 255, 0.1); /* Fond semi-transparent pour thème sombre */
    outline: none;
    transition: var(--transition-mobile);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.mobile-search-input:focus {
    border-color: var(--navbar-accent, #F2C94C);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.2);
}

.mobile-search-submit {
    background: var(--navbar-accent, #F2C94C); /* Accents - or UMOA - responsive */
    border: none;
    padding: 10px 15px;
    border-radius: var(--radius-mobile-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1F2937; /* Texte sombre pour contraste avec or */
    transition: var(--transition-mobile);
    flex-shrink: 0;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    font-weight: 600;
}

.mobile-search-submit:hover {
    background: #F5D76E; /* Or UMOA clair */
}

.mobile-search-submit:active {
    background: #E6C042; /* Or UMOA foncé */
    transform: scale(0.95);
}

.mobile-search-submit svg {
    width: 20px;
    height: 20px;
}

/* ============================================================================
   MENU HAMBURGER OVERLAY - Design Moderne & Élégant
   ============================================================================ */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7); /* Overlay plus sombre pour thème sombre */
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 340px;
    height: 100%;
    background: var(--navbar-bg, #1F2937); /* Fond sombre élégant - responsive */
    border-right: var(--navbar-border-width, 2px) solid var(--navbar-border, #004AAD); /* Bordure bleu UMOA - responsive */
    border-radius: 0 var(--navbar-radius, 16px) var(--navbar-radius, 16px) 0; /* Coins arrondis à droite */
    box-shadow: 
        4px 0 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 74, 173, 0.2);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

/* Header du menu avec couleur bleu UMOA - thème sombre élégant */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--navbar-border, #004AAD); /* Bleu UMOA - thème sombre élégant */
    color: var(--navbar-text, #FFFFFF); /* Texte blanc */
    box-shadow: 0 4px 12px rgba(0, 74, 173, 0.4);
    position: relative;
    overflow: hidden;
    border-radius: 0 var(--navbar-radius, 16px) 0 0; /* Coins arrondis en haut à droite */
}

.mobile-menu-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1); /* Overlay simple sans gradient */
    pointer-events: none;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Bouton de fermeture élégant */
.mobile-menu-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hover uniquement sur écrans non tactiles */
@media (hover: hover) and (pointer: fine) {
    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.4);
        transform: rotate(90deg) scale(1.05);
    }
}

.mobile-menu-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(0.95);
}

.mobile-menu-close svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Navigation avec espacement élégant */
.mobile-menu-nav {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Liens du menu avec design moderne - thème sombre élégant */
.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: var(--navbar-text, #FFFFFF); /* Texte blanc - responsive */
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05); /* Fond semi-transparent pour thème sombre */
    border: 2px solid rgba(0, 74, 173, 0.3); /* Bordure bleu UMOA semi-transparente */
    border-radius: var(--radius-mobile-md); /* Coins arrondis */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(242, 201, 76, 0.1); /* Overlay or UMOA simple */
    transition: left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

/* Icônes avec style moderne - thème sombre */
.mobile-menu-link svg {
    width: 22px;
    height: 22px;
    color: var(--navbar-accent, #F2C94C); /* Or UMOA - responsive */
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 1px 2px rgba(242, 201, 76, 0.3));
}

/* Hover uniquement sur écrans non tactiles - thème sombre */
@media (hover: hover) and (pointer: fine) {
    .mobile-menu-link:hover {
        background: var(--navbar-hover, #374151); /* Hover gris moyen - responsive */
        border-color: var(--navbar-accent, #F2C94C); /* Or UMOA */
        transform: translateX(4px);
        box-shadow: 
            0 4px 12px rgba(242, 201, 76, 0.2),
            0 0 0 3px rgba(242, 201, 76, 0.15);
    }

    .mobile-menu-link:hover::before {
        left: 100%;
    }

    .mobile-menu-link:hover svg {
        color: var(--navbar-accent, #F2C94C); /* Or UMOA */
        transform: scale(1.1);
        filter: drop-shadow(0 2px 4px rgba(242, 201, 76, 0.4));
    }
}

.mobile-menu-link:active {
    background: var(--navbar-hover, #374151); /* Hover gris moyen - responsive */
    border-color: var(--navbar-accent, #F2C94C); /* Or UMOA */
    transform: translateX(2px) scale(0.98);
    box-shadow: 
        0 2px 8px rgba(242, 201, 76, 0.25),
        0 0 0 3px rgba(242, 201, 76, 0.2);
}

.mobile-menu-link span {
    flex: 1;
    letter-spacing: -0.2px;
}

/* Lien primaire avec or UMOA - thème sombre élégant */
.mobile-menu-link-primary {
    background: var(--navbar-accent, #F2C94C); /* Or UMOA - thème sombre élégant */
    color: #1F2937; /* Texte sombre pour contraste avec or */
    margin: 8px 16px;
    border: 2px solid var(--navbar-accent, #F2C94C);
    border-radius: var(--radius-mobile-md); /* Coins arrondis */
    box-shadow: 
        0 4px 12px rgba(242, 201, 76, 0.3),
        0 0 0 3px rgba(242, 201, 76, 0.15);
    position: relative;
    overflow: hidden;
    font-weight: 700;
}

.mobile-menu-link-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2); /* Overlay simple sans gradient */
    transition: left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.mobile-menu-link-primary svg {
    color: #1F2937; /* Texte sombre pour contraste */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Hover uniquement sur écrans non tactiles */
@media (hover: hover) and (pointer: fine) {
    .mobile-menu-link-primary:hover {
        background: #F5D76E; /* Or UMOA clair */
        transform: translateY(-2px);
        box-shadow: 
            0 6px 20px rgba(242, 201, 76, 0.4),
            0 0 0 3px rgba(242, 201, 76, 0.25);
    }

    .mobile-menu-link-primary:hover::before {
        left: 100%;
    }

    .mobile-menu-link-primary:hover svg {
        transform: scale(1.1);
    }
}

.mobile-menu-link-primary:active {
    background: #E6C042; /* Or UMOA foncé */
    transform: translateY(0) scale(0.98);
}

/* Lien danger avec style élégant - thème sombre */
.mobile-menu-link-danger {
    color: #EF4444; /* Rouge */
    border-color: rgba(239, 68, 68, 0.4); /* Bordure rouge semi-transparente */
    background: rgba(239, 68, 68, 0.1); /* Fond rouge semi-transparent pour thème sombre */
}

.mobile-menu-link-danger svg {
    color: #EF4444; /* Rouge */
    filter: drop-shadow(0 1px 2px rgba(239, 68, 68, 0.3));
}

/* Hover uniquement sur écrans non tactiles */
@media (hover: hover) and (pointer: fine) {
    .mobile-menu-link-danger:hover {
        background: rgba(239, 68, 68, 0.2); /* Fond rouge plus visible */
        border-color: #EF4444;
        box-shadow: 
            0 4px 12px rgba(239, 68, 68, 0.25),
            0 0 0 3px rgba(239, 68, 68, 0.15);
    }

    .mobile-menu-link-danger:hover svg {
        transform: scale(1.1);
        filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.4));
    }
}

.mobile-menu-link-danger:active {
    background: rgba(239, 68, 68, 0.25); /* Fond rouge plus visible */
    border-color: #EF4444;
    transform: translateX(2px) scale(0.98);
}

/* Animations d'entrée en cascade pour les liens du menu - Optimisé */
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link {
    animation: slideInFromLeft 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(7) { animation-delay: 0.4s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(8) { animation-delay: 0.45s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(9) { animation-delay: 0.5s; }
.mobile-menu-overlay.active .mobile-menu-nav .mobile-menu-link:nth-child(n+10) { animation-delay: 0.55s; }

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation pour le header */
.mobile-menu-overlay.active .mobile-menu-header {
    animation: slideDownFade 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Amélioration du scroll pour un défilement plus fluide - thème sombre */
.mobile-menu-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05); /* Track semi-transparent pour thème sombre */
    border-radius: 10px;
}

.mobile-menu-content::-webkit-scrollbar-thumb {
    background: var(--navbar-accent, #F2C94C); /* Or UMOA - thème sombre élégant */
    border-radius: 10px;
    box-shadow: 0 0 4px rgba(242, 201, 76, 0.3);
}

/* Hover uniquement sur écrans non tactiles */
@media (hover: hover) and (pointer: fine) {
    .mobile-menu-content::-webkit-scrollbar-thumb:hover {
        background: #F5D76E; /* Or UMOA clair */
        box-shadow: 0 0 6px rgba(242, 201, 76, 0.5);
    }
}

/* ============================================================================
   NAVIGATION MOBILE - BOTTOM BAR
   ============================================================================ */

.navbar-mobile-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px !important; /* Hauteur idéale pour icône + petit texte */
    background-color: var(--navbar-bg, #1F2937); /* Fond sombre élégant - responsive */
    border: var(--navbar-border-width, 2px) solid var(--navbar-border, #004AAD); /* Bordure bleu UMOA sur les 4 côtés - responsive */
    border-radius: var(--navbar-radius, 16px) var(--navbar-radius, 16px) 0 0; /* Coins arrondis en haut */
    z-index: 999;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2); /* Ombre subtile pour le thème sombre */
    padding: 0 !important;
    padding-top: 0 !important;
    /* On utilise uniquement le padding nécessaire pour l'encoche système */
    padding-bottom: env(safe-area-inset-bottom, 10px);
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important; /* Centre le groupe icône+texte verticalement */
    justify-content: space-around;
    line-height: normal !important;
}

@media (max-width: 768px) {
    .navbar-mobile-bottom {
        display: flex;
        justify-content: space-around;
        align-items: center; /* Centre les icônes verticalement */
    }
}

.mobile-bottom-link {
    flex: 1;
    display: flex !important;
    flex-direction: column !important; /* Met l'icône au-dessus du texte */
    align-items: center !important;    /* Centre horizontalement l'icône et le texte */
    justify-content: center !important; /* Centre l'ensemble verticalement */
    height: 100% !important; /* Oblige l'élément à occuper toute la hauteur pour se centrer */
    padding: 0 !important;
    padding-top: 0 !important;
    margin: 0 !important;
    margin-top: 0 !important;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: clamp(0.5rem, 1.2vw, 0.625rem); /* Texte responsive entre 8px et 10px */
    font-weight: 500;
    transition: var(--transition-mobile);
    position: relative;
    gap: 4px !important; /* Espace entre l'icône et le texte */
    border-radius: var(--radius-mobile-sm);
    max-width: 100%;
    overflow: hidden;
    line-height: 1 !important;
    vertical-align: middle !important;
}

.mobile-bottom-link:hover {
    background-color: var(--navbar-hover, #374151); /* Hover gris moyen - responsive */
    color: rgba(255, 255, 255, 0.8);
}

/* Wrapper pour les icônes avec badges */
.mobile-bottom-link .icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-bottom-link:active {
    color: var(--navbar-accent, #F2C94C); /* Accents - or UMOA - responsive */
    transform: scale(0.95);
    background-color: var(--navbar-hover, #374151);
}

.mobile-bottom-link.active {
    color: var(--navbar-accent, #F2C94C); /* Accents - or UMOA - icône active - responsive */
    background-color: rgba(242, 201, 76, 0.1); /* Fond or semi-transparent */
}

.mobile-bottom-link[data-page="home"].active,
.mobile-bottom-link[data-page="marketplace"].active,
.mobile-bottom-link[data-page="myshop"].active,
.mobile-bottom-link[data-page="chat"].active,
.mobile-bottom-link[data-page="profile"].active,
.mobile-bottom-link[data-page="login"].active {
    color: var(--navbar-accent, #F2C94C); /* Accents - or UMOA - icône active - responsive */
    background-color: rgba(242, 201, 76, 0.1); /* Fond or semi-transparent */
}

/* Indicateur visuel pour l'onglet actif - petit point or sous l'icône */
.mobile-bottom-link.active::after {
    content: '';
    position: absolute;
    bottom: clamp(1px, 0.3vw, 3px);
    width: clamp(2.5px, 0.6vw, 3.5px);
    height: clamp(2.5px, 0.6vw, 3.5px);
    background-color: var(--navbar-accent, #F2C94C);
    border-radius: 50%;
    box-shadow: 0 0 clamp(2px, 0.5vw, 4px) rgba(242, 201, 76, 0.6);
}

.mobile-bottom-link svg {
    width: clamp(18px, 4.5vw, 22px); /* Icônes responsive entre 18px et 22px */
    height: clamp(18px, 4.5vw, 22px);
    stroke-width: 2;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    line-height: 1 !important;
}

.mobile-bottom-link span:not(.mobile-bottom-badge) {
    font-size: 10px !important; /* Taille compacte pour mobile */
    font-weight: 500;
    line-height: 1 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-bottom-badge {
    position: absolute;
    top: clamp(1px, 0.3vw, 3px);
    right: calc(50% - clamp(16px, 4vw, 20px));
    background: var(--navbar-badge, #EF4444);
    color: white;
    border-radius: clamp(6px, 1.5vw, 8px);
    min-width: clamp(14px, 3.5vw, 18px);
    height: clamp(14px, 3.5vw, 18px);
    font-size: clamp(0.5rem, 1.1vw, 0.625rem);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(2px, 0.5vw, 4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: clamp(1.5px, 0.4vw, 2.5px) solid var(--navbar-bg, #1F2937);
}

/* Badges dynamiques pour la bottom nav - Style iOS/Android standard */
.nav-badge {
    position: absolute;
    top: clamp(-5px, -1vw, -3px);
    right: clamp(-7px, -1.5vw, -5px);
    background-color: var(--navbar-badge, #EF4444);
    color: white;
    font-size: clamp(0.5rem, 1.1vw, 0.625rem);
    font-weight: bold;
    min-width: clamp(12px, 3vw, 16px);
    height: clamp(12px, 3vw, 16px);
    border-radius: clamp(6px, 1.5vw, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1px, 0.2vw, 2px) clamp(2px, 0.4vw, 3px);
    border: clamp(1px, 0.3vw, 2px) solid var(--navbar-bg, #1F2937);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Animation "pop" quand le badge change */
.badge-bump {
    animation: pulse-badge 0.3s ease-out;
}

@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ============================================================================
   RESPONSIVE NAVBAR BOTTOM - Media Queries pour différentes tailles d'écran
   ============================================================================ */

/* Très petits écrans (jusqu'à 360px) */
@media (max-width: 360px) {
    .mobile-bottom-link {
        padding: 2px 1px;
        gap: 1px;
    }
    
    .mobile-bottom-link svg {
        width: 16px;
        height: 16px;
    }
    
    .mobile-bottom-link span:not(.mobile-bottom-badge) {
        font-size: 0.45rem; /* 7.2px */
    }
    
    .mobile-bottom-badge {
        min-width: 12px;
        height: 12px;
        font-size: 0.45rem;
        right: calc(50% - 14px);
    }
    
    .nav-badge {
        min-width: 10px;
        height: 10px;
        font-size: 0.45rem;
    }
}

/* Petits écrans (361px à 480px) */
@media (min-width: 361px) and (max-width: 480px) {
    .mobile-bottom-link svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-bottom-link span:not(.mobile-bottom-badge) {
        font-size: 0.5rem; /* 8px */
    }
}

/* Écrans moyens (481px à 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .mobile-bottom-link svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-bottom-link span:not(.mobile-bottom-badge) {
        font-size: 0.5625rem; /* 9px */
    }
}

/* Grands écrans mobiles (641px à 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .mobile-bottom-link svg {
        width: 22px;
        height: 22px;
    }
    
    .mobile-bottom-link span:not(.mobile-bottom-badge) {
        font-size: 0.625rem; /* 10px */
    }
    
    .mobile-bottom-link {
        gap: 3px;
        padding: 5px 3px;
    }
}

/* ============================================================================
   CONTENU PRINCIPAL - Ajustements pour mobile
   ============================================================================ */

@media (max-width: 768px) {
    body {
        padding-top: 0; /* Pas de padding-top car header est sticky */
        padding-bottom: calc(var(--mobile-bottom-height) + var(--mobile-safe-area-bottom));
    }
    
    .main-content {
        padding: 16px 12px;
        padding-top: calc(56px + 16px); /* Hauteur du header sticky (56px) + padding */
        min-height: calc(100vh - 56px - var(--mobile-bottom-height));
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Grilles responsive - Stack vertical sur mobile */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    /* Page boutique et profil : 1 colonne (évite débordement) */
    .shop-container .products-grid,
    .shop-content .products-grid,
    .profile-public-container .articles-grid,
    .profile-content .articles-grid {
        grid-template-columns: 1fr !important;
        width: 100%;
        max-width: 100%;
    }
    .shop-container .product-card,
    .shop-content .product-card,
    .profile-public-container .product-card,
    .profile-content .product-card {
        max-width: 100% !important;
        min-width: 0;
    }
    
    /* Flexbox containers - Stack vertical */
    .flex-row {
        flex-direction: column !important;
    }
    
    .flex-container {
        flex-wrap: wrap;
    }
    
    /* Formulaires - Full width sur mobile */
    form {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
        margin-right: 0;
        margin-bottom: 16px;
    }
    
    /* Cartes avec border-radius plus prononcés */
    .card {
        border-radius: var(--radius-mobile-lg);
        margin-bottom: 16px;
    }
    
    .card:hover {
        transform: none; /* Pas de hover sur mobile */
    }
    
    .card:active {
        transform: scale(0.98);
        transition: var(--transition-mobile);
    }
    
    /* Boutons avec border-radius plus prononcés */
    .btn {
        border-radius: var(--radius-mobile-md);
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .btn:active {
        transform: scale(0.97);
    }
    
    /* Formulaires */
    .form-control {
        border-radius: var(--radius-mobile-md);
        padding: 14px 16px;
        font-size: 16px; /* Prévenir zoom iOS */
    }
    
    /* Barre de progression pour longs formulaires */
    .form-progress {
        height: 4px;
        background: var(--gray-200);
        border-radius: var(--radius-full);
        margin-bottom: 1.5rem;
        overflow: hidden;
    }
    
    .form-progress-bar {
        height: 100%;
        background: #7B2CBF; /* Violet UMOA - couleur unie */
        border-radius: var(--radius-full);
        transition: width 0.3s ease;
        width: 0%;
    }
    
    .long-form {
        position: relative;
    }
    
    /* Tables responsive - Converties en Cards */
    table.table-converted {
        display: none !important;
    }
    
    .table-cards-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .table-card {
        background: white;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-mobile-lg);
        padding: 16px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
        transition: var(--transition-mobile);
    }
    
    .table-card:active {
        transform: scale(0.98);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .table-card-item {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .table-card-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .table-card-item:first-child {
        padding-top: 0;
    }
    
    .table-card-label {
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.875rem;
        flex: 0 0 40%;
        margin-right: 12px;
    }
    
    .table-card-value {
        flex: 1;
        text-align: right;
        color: var(--text-color);
        font-size: 0.9375rem;
        word-break: break-word;
    }
    
    /* Tables classiques (fallback si pas de conversion JS) */
    table:not(.table-converted) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    table:not(.table-converted) thead {
        display: none;
    }
    
    table:not(.table-converted) tbody {
        display: block;
    }
    
    table:not(.table-converted) tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-mobile-md);
        padding: 12px;
        background: white;
    }
    
    table:not(.table-converted) td {
        display: block;
        text-align: right;
        padding: 8px 0;
        border: none;
    }
    
    table:not(.table-converted) td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--text-muted);
    }
    
    /* Listes - Full width */
    ul, ol {
        padding-left: 20px;
    }
    
    /* Images responsive */
    img {
        max-width: 100%;
        height: auto;
        border-radius: var(--radius-mobile-md);
    }
    
    /* Modals - Full screen sur mobile */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: var(--radius-mobile-lg) var(--radius-mobile-lg) 0 0 !important;
        max-height: 90vh;
    }
    
    /* Input groups - Stack vertical */
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: var(--radius-mobile-md);
        margin-bottom: 8px;
    }
    
    .input-group .btn {
        border-radius: var(--radius-mobile-md);
        width: 100%;
    }
}

/* ============================================================================
   TRANSITIONS FLUIDES ENTRE PAGES
   ============================================================================ */

@media (max-width: 768px) {
    /* Transition de page */
    body {
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    body.page-transitioning {
        opacity: 0.7;
    }
    
    /* Animation d'apparition du contenu */
    .main-content > * {
        animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ============================================================================
   UTILITAIRES MOBILE
   ============================================================================ */

@media (max-width: 768px) {
    /* Masquer certains éléments sur mobile */
    .desktop-only {
        display: none !important;
    }
    
    /* Afficher uniquement sur mobile */
    .mobile-only {
        display: block !important;
    }
    
    /* Espacement mobile */
    .mobile-spacing-sm {
        margin-bottom: 12px;
    }
    
    .mobile-spacing-md {
        margin-bottom: 16px;
    }
    
    .mobile-spacing-lg {
        margin-bottom: 24px;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* ============================================================================
   PULL-TO-REFRESH
   ============================================================================ */

.pull-to-refresh-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.pull-to-refresh-icon {
    width: 32px;
    height: 32px;
    color: var(--blue-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.pull-to-refresh-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pull-to-refresh-indicator.ready .pull-to-refresh-text {
    color: var(--blue-medium);
}

.pull-to-refresh-indicator.refreshing .pull-to-refresh-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================================
   OPTIMISATIONS PERFORMANCE 60FPS
   ============================================================================ */

@media (max-width: 768px) {
    /* Utiliser transform et opacity pour les animations (GPU accelerated) */
    .mobile-menu-content,
    .mobile-menu-overlay,
    .mobile-bottom-link,
    .mobile-menu-link {
        will-change: transform, opacity;
    }
    
    /* Forcer l'accélération GPU */
    .mobile-menu-content {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* Optimiser les transitions */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

