/* ============================================
   MENU MOBILE PREMIUM - ARCHIPILOTE
   Design moderne, propre et intuitif
   ============================================ */

/* Variables de couleurs ArchiPilote */
:root {
    --archi-primary: #024430;
    --archi-primary-dark: #003C2F;
    --archi-primary-light: #0A685F;
    --archi-accent: #E0F1F4;
    --archi-accent-2: #AFEAE4;
    --archi-text: #071920;
    --archi-text-light: #4E6770;
    --archi-border: #E5E9EB;
    --archi-bg: #FFFFFF;
    --archi-bg-light: #F8F9FA;
}

/* Overlay de fond */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 25, 32, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Container principal du menu mobile - Premium */
.mobile-header-active.mobile-header-wrapper-style {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 400px !important;
    height: 100vh !important;
    height: 100dvh !important; /* Support viewport dynamique */
    background: var(--archi-bg) !important;
    z-index: 1003 !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-header-active.mobile-header-wrapper-style.sidebar-visible {
    transform: translateX(0) !important;
}

/* Wrapper interne */
.mobile-header-wrapper-style .mobile-header-wrapper-inner {
    padding: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Header du menu avec logo et croix */
.mobile-header-wrapper-style .mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    padding-left: 20px;
    padding-right: 20px;
    border-bottom: none;
    background: var(--archi-bg);
    flex-shrink: 0;
    min-height: 64px;
    margin-bottom: 0 !important;
    position: relative;
}

.mobile-header-wrapper-style .mobile-header-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--archi-primary) 0%, var(--archi-primary-light) 50%, var(--archi-accent-2) 100%);
}

.mobile-header-wrapper-style .mobile-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.mobile-header-wrapper-style .mobile-logo-link:hover {
    opacity: 0.8;
}

.mobile-header-wrapper-style .mobile-logo-img {
    max-height: 40px;
    height: auto;
    width: auto;
    display: block;
}

/* Bouton de fermeture */
.mobile-header-wrapper-style .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--archi-border);
    cursor: pointer;
    color: var(--archi-text);
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.mobile-header-wrapper-style .mobile-menu-close:hover {
    background: var(--archi-accent);
    border-color: var(--archi-primary);
    color: var(--archi-primary);
    transform: rotate(90deg);
}

.mobile-header-wrapper-style .mobile-menu-close:active {
    transform: rotate(90deg) scale(0.95);
}

.mobile-header-wrapper-style .mobile-menu-close svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Zone de contenu scrollable */
.mobile-header-wrapper-style .mobile-header-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.mobile-header-wrapper-style .mobile-menu-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 !important;
}

/* Scrollbar personnalisée */
.mobile-header-wrapper-style .mobile-menu-wrap::-webkit-scrollbar {
    width: 6px;
}

.mobile-header-wrapper-style .mobile-menu-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-header-wrapper-style .mobile-menu-wrap::-webkit-scrollbar-thumb {
    background: var(--archi-border);
    border-radius: 3px;
}

.mobile-header-wrapper-style .mobile-menu-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--archi-text-light);
}

/* Navigation principale */
.mobile-header-wrapper-style .mobile-menu-wrap nav {
    padding: 0;
}

.mobile-header-wrapper-style .mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none !important;
}

/* Items du menu principal */
.mobile-header-wrapper-style .mobile-menu > li {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0 !important;
    width: 100%;
}

.mobile-header-wrapper-style .mobile-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    padding-right: 60px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    font-family: "Manrope", sans-serif;
    color: var(--archi-text);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    min-height: 52px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.mobile-header-wrapper-style .mobile-menu > li > a span {
    flex: 1;
}

/* Indicateur actif */
.mobile-header-wrapper-style .mobile-menu > li > a.active {
    color: var(--archi-primary);
    font-weight: 600;
    background: var(--archi-accent);
}

.mobile-header-wrapper-style .mobile-menu > li > a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--archi-primary);
}

/* Bordure bottom pour les items avec sous-menu actif */
.mobile-header-wrapper-style .mobile-menu > li.has-children.active > a {
    border-bottom: 1px solid #ddd;
}

/* Hover state */
.mobile-header-wrapper-style .mobile-menu > li > a:hover:not(.active) {
    background: var(--archi-bg-light);
    color: var(--archi-primary);
    padding-left: 24px !important;
}

/* Bouton expand pour sous-menu */
.mobile-header-wrapper-style .mobile-menu > li.has-children .menu-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--archi-text-light);
    transition: all 0.25s ease;
    flex-shrink: 0;
    margin-left: 8px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}


.mobile-header-wrapper-style .mobile-menu > li.has-children .menu-expand:hover {
    background: var(--archi-accent);
    color: var(--archi-primary);
}

.mobile-header-wrapper-style .mobile-menu > li.has-children .menu-expand svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-header-wrapper-style .mobile-menu > li.has-children.active .menu-expand {
    background: var(--archi-accent);
    color: var(--archi-primary);
}

.mobile-header-wrapper-style .mobile-menu > li.has-children.active .menu-expand {
    background: var(--archi-accent);
    color: var(--archi-primary);
}

.mobile-header-wrapper-style .mobile-menu > li.has-children.active .menu-expand svg {
    transform: rotate(180deg);
}

/* Sous-menus */
.mobile-header-wrapper-style .mobile-menu .sub-menu {
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    background: var(--archi-bg-light) !important;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.3s ease !important;
    display: block !important;
    opacity: 0 !important;
    width: 100% !important;
    visibility: visible !important;
}

.mobile-header-wrapper-style .mobile-menu > li.has-children.active .sub-menu,
.mobile-header-wrapper-style .mobile-menu li.has-children.active .sub-menu {
    max-height: 2000px !important;
    padding: 4px 0 0px 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.mobile-header-wrapper-style .mobile-menu .sub-menu li {
    margin: 0;
    padding: 0;
    padding-left: 30px;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 1px solid var(--archi-border);
}

.mobile-header-wrapper-style .mobile-menu .sub-menu li:last-child {
    border-bottom: none;
}

/* Style spécifique pour les items du sous-menu de fonctionnalités */
.mobile-header-wrapper-style .mobile-header-wrapper-inner .mobile-header-content-area .mobile-menu-wrap nav .mobile-menu li ul.features-submenu li {
    padding: 0 0 0 30px !important;
    border-bottom: 1px solid #ddd !important;
}

.mobile-header-wrapper-style .mobile-menu .sub-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 24px 12px 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    font-family: "Manrope", sans-serif;
    color: var(--archi-text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.mobile-header-wrapper-style .mobile-menu .sub-menu li a span {
    flex: 1;
}

/* Indicateur visuel pour sous-items */
.mobile-header-wrapper-style .mobile-menu .sub-menu li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--archi-border);
    transition: all 0.2s ease;
}

.mobile-header-wrapper-style .mobile-menu .sub-menu li a:hover {
    color: var(--archi-primary);
    background: var(--archi-accent);
    padding-left: 0;
}

.mobile-header-wrapper-style .mobile-menu .sub-menu li a:hover::before {
    background: var(--archi-primary);
    width: 8px;
    height: 8px;
}

/* Section des langues - Bloc distinct */
.mobile-header-wrapper-style .mobile-language-section {
    padding: 20px 24px;
    border-top: 1px solid var(--archi-border);
    background: var(--archi-bg-light);
    flex-shrink: 0;
    margin-top: auto;
}

.mobile-header-wrapper-style .mobile-language-flags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.mobile-header-wrapper-style .mobile-language-flag-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--archi-bg);
    transition: all 0.25s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.mobile-header-wrapper-style .mobile-language-flag-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(135deg, var(--archi-primary), var(--archi-primary-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-header-wrapper-style .mobile-language-flag-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.mobile-header-wrapper-style .mobile-language-flag-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 68, 48, 0.15);
    border-color: var(--archi-primary);
}

.mobile-header-wrapper-style .mobile-language-flag-item.active {
    border-color: var(--archi-primary);
    background: var(--archi-accent);
    box-shadow: 0 2px 8px rgba(2, 68, 48, 0.1);
}

.mobile-header-wrapper-style .mobile-language-flag-item.active::before {
    opacity: 1;
}

/* Responsive - Petits écrans */
@media (max-width: 480px) {
    .mobile-header-wrapper-style {
        max-width: 100%;
    }
    
    .mobile-header-wrapper-style .mobile-header-top {
        padding: 14px 20px;
        min-height: 60px;
    }
    
    .mobile-header-wrapper-style .mobile-logo-img {
        max-height: 36px;
    }
    
    .mobile-header-wrapper-style .mobile-menu > li > a {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .mobile-header-wrapper-style .mobile-menu .sub-menu li {
        padding-left: 30px;
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .mobile-header-wrapper-style .mobile-menu .sub-menu li a {
        padding: 10px 20px 10px 0;
        font-size: 14px;
    }
    
    .mobile-header-wrapper-style .mobile-language-section {
        padding: 16px 20px;
    }
    
    .mobile-header-wrapper-style .mobile-language-flag-item {
        width: 44px;
        height: 44px;
    }
    
    .mobile-header-wrapper-style .mobile-language-flag-item img {
        width: 28px;
        height: 28px;
    }
}

/* Responsive - Très petits écrans */
@media (max-width: 360px) {
    .mobile-header-wrapper-style .mobile-header-top {
        padding: 12px 16px;
        min-height: 56px;
    }
    
    .mobile-header-wrapper-style .mobile-logo-img {
        max-height: 32px;
    }
    
    .mobile-header-wrapper-style .mobile-menu > li > a {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .mobile-header-wrapper-style .mobile-menu .sub-menu li {
        padding-left: 30px;
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .mobile-header-wrapper-style .mobile-menu .sub-menu li a {
        padding: 10px 16px 10px 0;
        font-size: 13px;
    }
    
    .mobile-header-wrapper-style .mobile-language-section {
        padding: 14px 16px;
    }
    
    .mobile-header-wrapper-style .mobile-language-flags {
        gap: 12px;
    }
    
    .mobile-header-wrapper-style .mobile-language-flag-item {
        width: 40px;
        height: 40px;
    }
    
    .mobile-header-wrapper-style .mobile-language-flag-item img {
        width: 24px;
        height: 24px;
    }
}

/* Animation d'entrée pour les items */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li {
    animation: slideInRight 0.4s ease forwards;
}

.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li:nth-child(1) { animation-delay: 0.05s; }
.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li:nth-child(2) { animation-delay: 0.1s; }
.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li:nth-child(3) { animation-delay: 0.15s; }
.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li:nth-child(4) { animation-delay: 0.2s; }
.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li:nth-child(5) { animation-delay: 0.25s; }
.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li:nth-child(6) { animation-delay: 0.3s; }
.mobile-header-wrapper-style.sidebar-visible .mobile-menu > li:nth-child(7) { animation-delay: 0.35s; }

/* Prévenir le scroll du body quand le menu est ouvert */
body.mobile-menu-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Amélioration de l'accessibilité */
.mobile-header-wrapper-style .mobile-menu > li > a:focus,
.mobile-header-wrapper-style .mobile-menu .sub-menu li a:focus,
.mobile-header-wrapper-style .mobile-menu-close:focus {
    outline: 2px solid var(--archi-primary);
    outline-offset: 2px;
}

/* Support RTL */
[dir="rtl"] .mobile-header-wrapper-style {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

[dir="rtl"] .mobile-header-active.mobile-header-wrapper-style.sidebar-visible {
    transform: translateX(0) !important;
}

[dir="rtl"] .mobile-header-wrapper-style .mobile-menu > li > a.active::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .mobile-header-wrapper-style .mobile-menu .sub-menu li a {
    padding-right: 48px;
    padding-left: 24px;
}

[dir="rtl"] .mobile-header-wrapper-style .mobile-menu .sub-menu li a::before {
    left: auto;
    right: 32px;
}

[dir="rtl"] .mobile-header-wrapper-style .mobile-menu .sub-menu li a:hover {
    padding-right: 52px;
    padding-left: 24px;
}

