/* ═══════════════════════════════════════════════════════════
   COMMERCIFY HEADER - VERSION SIMPLIFIÉE
   Structure conservée, CSS simplifié, responsive Bootstrap DashLite
   ═══════════════════════════════════════════════════════════ */

:root {
    --header-bg-light: #f5f6fa;
    --header-bg-dark: #1f2b3a;
    --header-border-light: #e5e9f2;
    --header-border-dark: #364a63;
    --text-secondary-light: #8091a7;
    --text-secondary-dark: #b7c2d0;
    --cfy-orange: #FF8C00;
    --cfy-gold: #FFD700;
    /* Espacement uniforme entre tous les éléments du Header Top */
    --header-top-gap: 0.5rem;
    /* Offset latéral de référence (logo/menu et actions login/dashboard) */
    --cfy-header-edge-offset: 10px;
}

/* ═══════════════════════════════════════════════════════════
   SURCHARGE PERFORMANCE - Désactiver les règles coûteuses
   ═══════════════════════════════════════════════════════════ */

/* Désactiver backdrop-filter et transitions (très coûteux en CPU) */
/* Protection contre le zoom : header toujours dans le cadre */
.catalog-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: none !important;
    transform: none !important;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
    /* background géré par PHP depuis la session */
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    padding-inline-start: var(--cfy-header-edge-offset, 10px) !important;
    padding-inline-end: var(--cfy-header-edge-offset, 10px) !important;
}

/* Désactiver les effets scrolled (pas de collapse) */
.catalog-header.scrolled {
    padding: inherit !important;
}

.catalog-header.scrolled .catalog-logo,
.catalog-header.scrolled .header-logo-img {
    height: inherit !important;
    width: inherit !important;
    max-width: inherit !important;
}

/* ═══════════════════════════════════════════════════════════
   ALIGNEMENT GLOBAL - AUCUNE MARGE LATERALE POUR LES HEADERS
   ═══════════════════════════════════════════════════════════ */

/* Supprimer les paddings horizontaux pour coller le header aux bords (comme le footer) */
.nk-header .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   STRUCTURE CONSERVÉE - Ne touche PAS à .catalog-header
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   PROTECTION GLOBALE CONTRE LE ZOOM ET DÉBORDEMENTS
   =══════════════════════════════════════════════════════════ */
/* Protection : navigation center ne doit jamais dépasser */
.header-nav-center {
  max-width: 100%;
  overflow-x: hidden;
}

/* Protection : tous les boutons de navigation doivent rester dans le cadre */
.catalog-nav-item {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Protection : logo et actions doivent rester dans le cadre */
.header-logo-section,
.header-actions {
  max-width: 100%;
  overflow: hidden;
}

.header-wrap-codepen {
    width: 100%;
    max-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--header-top-gap, 0.5rem);
    flex-wrap: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
}

.header-wrap-codepen > * {
    align-self: center;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════
   BOUTON MENU DASHLITE
   ═══════════════════════════════════════════════════════════ */

.nk-nav-toggle.d-xl-none {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: linear-gradient(180deg, #FF9A3E 0%, #FF7F11 100%);
    border-radius: 0;
    flex-shrink: 0;
    margin-inline-start: var(--cfy-header-edge-offset, 10px);
}

.nk-nav-toggle.d-xl-none svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   SECTION LOGO
   ═══════════════════════════════════════════════════════════ */

/* Bouton recherche déplacé vers la section logo */
.line-logo-left .btn-search-header-tablet {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    overflow: visible;
    height: 100%;
    width: auto;
    min-width: 0;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

/* LOUPE OPTIMISÉE - TAILLE FIXE pour smartphones paysage */
@media (min-width: 576px) and (max-width: 767px) {
    .line-logo-left .search-icon-header-tablet {
        height: 20px !important;
        width: 20px !important;
        max-height: 20px !important;
        max-width: 20px !important;
        min-height: 20px !important;
        min-width: 20px !important;
        aspect-ratio: 1;
        stroke: var(--cfy-gold);
        fill: none;
        stroke-width: 2px;
        transition: none !important;
        transform: none !important;
    }
    
    .line-logo-left .btn-search-header-tablet {
        width: 30px !important;
        height: 30px !important;
        max-width: 30px !important;
        max-height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        padding: 5px !important;
    }
    
    .line-logo-left .btn-search-header-tablet:hover .search-icon-header-tablet,
    .line-logo-left .catalog-nav-item-search-tablet.active .search-icon-header-tablet {
        transform: none !important;
        height: 20px !important;
        width: 20px !important;
        max-height: 20px !important;
        max-width: 20px !important;
    }
}

/* LOUPE OPTIMISÉE occupant la hauteur maximale du header (pour autres viewports) */
.line-logo-left .search-icon-header-tablet {
    height: 100% !important;
    width: auto !important;
    max-width: none !important;
    aspect-ratio: 1;
    stroke: var(--cfy-gold);
    fill: none;
    stroke-width: 2px;
    transition: transform 0.2s ease;
    transform: scaleX(-1); /* INVERSION HORIZONTALE */
}

/* EFFET HOVER : retour à l'orientation normale */
.line-logo-left .btn-search-header-tablet:hover .search-icon-header-tablet {
    transform: scaleX(1) !important; /* RETOUR À L'ORIENTATION NORMALE */
}

/* BACKGROUND JAUNE pour bouton recherche actif */
.line-logo-left .catalog-nav-item-search-tablet.active {
    background: #FFD700 !important;
    color: #000000 !important;
    border: 2px solid #FFD700 !important;
}

/* EFFET HOVER sur bouton actif : orientation normale avec agrandissement */
.line-logo-left .catalog-nav-item-search-tablet.active:hover .search-icon-header-tablet {
    transform: scaleX(1) scale(1.1) !important; /* ORIENTATION NORMALE + AGRANDISSEMENT */
}

/* RÈGLE GÉNÉRALE pour bouton recherche actif */
.catalog-nav-item-search-tablet.active,
.btn-search-header-tablet.catalog-nav-item-search-tablet.active {
    background: #FFD700 !important;
    color: #000000 !important;
    border: 2px solid #FFD700 !important;
}

/* RÈGLE GÉNÉRALE HOVER pour tous les breakpoints */
.btn-search-header-tablet:hover .search-icon-header-tablet,
.catalog-nav-item:hover .search-icon-header,
.catalog-nav-item-search-tablet:hover .search-icon-header-tablet {
    transform: scaleX(1) !important;
}

/* Loupe active - pas de filter (GPU) */
.line-logo-left .catalog-nav-item-search-tablet.active .search-icon-header-tablet {
    stroke: #FFFFFF;
    stroke-width: 2.5px;
    transform: scaleX(-1) scale(1.1); /* INVERSION + LÉGER AGRANDISSEMENT */
}

.header-logo-section {
    display: flex;
    align-items: center;
    gap: var(--header-top-gap, 0.5rem);
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    height: 100%;
    margin-inline-start: var(--cfy-header-edge-offset, 10px);
}

.line-logo,
.line-logo-left {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

.line-logo-left {
    gap: var(--header-top-gap, 0.5rem);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    height: 100%;
}

.catalog-logo {
    height: 100%;
    width: 150%;
    max-height: 100%;
    object-fit: contain;
    flex-shrink: 1;
}

.header-flag-btn-after-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

/* Bouton flag déplacé vers la section actions - adapter le style */
.header-actions .header-flag-btn-after-logo {
    padding: clamp(0.3rem, 0.5vw, 0.5rem);
    border-radius: 0;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    white-space: nowrap;
}

.flag-img-after-logo {
    height: 32px;
    width: auto;
    max-width: 42px;
    object-fit: contain;
}

/* Lien Mappemonde */
.header-actions .mappemonde-link {
    padding: clamp(0.35rem, 0.55vw, 0.6rem) clamp(0.55rem, 0.8vw, 0.8rem);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    border-radius: 0;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, text-decoration 0.2s ease;
    color: #ffffff !important;
    text-decoration: underline;
}

/* Menu Jump (header top) : même police, taille et espacement que Carte du monde */
.catalog-header .catalog-selector-trigger {
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}
.catalog-header .catalog-selector-trigger i {
    font-size: 0.8125rem;
}

/* Style hover pour thème dashlite (fond noir) - mode clair */
.header-actions .mappemonde-link:hover,
.header-actions .mappemonde-link:focus-visible {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.1) !important;
    text-decoration: underline double;
}

/* Surcharge pour thèmes avec fond clair (gradient ou couleur claire) */
.catalog-header[style*="gradient"] .header-actions .mappemonde-link,
.catalog-header[style*="rgb(77, 26, 10)"] .header-actions .mappemonde-link,
.catalog-header[style*="rgb(109, 42, 14)"] .header-actions .mappemonde-link {
    color: #ffffff !important;
}

.catalog-header[style*="gradient"] .header-actions .mappemonde-link:hover,
.catalog-header[style*="gradient"] .header-actions .mappemonde-link:focus-visible,
.catalog-header[style*="rgb(77, 26, 10)"] .header-actions .mappemonde-link:hover,
.catalog-header[style*="rgb(77, 26, 10)"] .header-actions .mappemonde-link:focus-visible,
.catalog-header[style*="rgb(109, 42, 14)"] .header-actions .mappemonde-link:hover,
.catalog-header[style*="rgb(109, 42, 14)"] .header-actions .mappemonde-link:focus-visible {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.15) !important;
    text-decoration: underline double;
}

body.dark-mode .header-actions .mappemonde-link,
[data-bs-theme="dark"] .header-actions .mappemonde-link {
    color: #e9edf5;
}

body.dark-mode .header-actions .mappemonde-link:hover,
body.dark-mode .header-actions .mappemonde-link:focus-visible,
[data-bs-theme="dark"] .header-actions .mappemonde-link:hover,
[data-bs-theme="dark"] .header-actions .mappemonde-link:focus-visible {
    color: #0d1117;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-decoration: underline double;
}

/* CACHER le drapeau du header quand le bouton menu dashlite est visible (< 1200px) */
@media (max-width: 1199.98px) {
    .header-flag-btn-after-logo,
    .btn-lang-header {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .flag-img-after-logo {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION CENTER - CATALOGUES
   ═══════════════════════════════════════════════════════════ */

.header-nav-center {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 0.5vw, 0.5rem);
    flex: 1 1 auto;
    justify-content: center;
    margin: 0 clamp(0.5rem, 1vw, 1rem);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

.catalog-nav-item {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 0.5vw, 0.5rem);
    padding: clamp(0.4rem, 0.5vw, 0.5rem) clamp(0.6rem, 1vw, 1rem);
    text-decoration: none;
    color: var(--text-secondary-light);
    font-weight: 500;
    font-size: clamp(0.7rem, 0.7vw, 0.875rem);
    border-radius: 0;
    white-space: nowrap;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.catalog-nav-item:hover:not(.active) {
    background: #000000;
    color: #ffffff;
}

.catalog-nav-item.active {
    background: #000000;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 1rem 2rem;
    flex-direction: column;
    gap: 0.25rem;
}

.catalog-nav-item.active .catalog-label-top {
    font-family: cursive !important;
    color: #FFD700 !important;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1;
    transform: translateZ(0);
}

.catalog-nav-item.active i {
    color: #ffffff;
    font-size: 1.25rem;
}

.catalog-nav-item.active .catalog-label-text {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

/* Bouton Recherche */
.catalog-nav-item-search {
    padding: 0.5rem;
    width: auto;
    min-width: auto;
}

.search-icon-header {
    width: 20px;
    height: 20px;
    stroke: var(--cfy-gold);
    fill: none;
}

.catalog-nav-item-search.active .search-icon-header {
    width: 24px;
    height: 24px;
    stroke: #FFFFFF;
}

/* Bouton Dashboard */
.catalog-nav-item-dashboard {
    background: #000000;
    color: #FFD700;
    font-weight: 800;
    border: 2px solid #FFD700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.catalog-nav-item-dashboard:hover:not(.active) {
    background: #000000;
    color: #FFD700;
    border-color: #FFD700;
}

.catalog-nav-item-dashboard.active {
    background: linear-gradient(180deg, #FF9A3E 0%, #FF7F11 100%);
    border-color: #FF7F11;
}

.dashboard-label-multiline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    gap: 0;
}

.dashboard-line1,
.dashboard-line2 {
    color: #FFD700;
    font-weight: 800;
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    line-height: 1;
    display: block;
}

.catalog-nav-item-dashboard.active .dashboard-line1,
.catalog-nav-item-dashboard.active .dashboard-line2 {
    color: #ffffff;
    font-size: 1.25rem;
}

/* Bouton Hyper Profil */
/* ═══════════════════════════════════════════════════════════
   BOUTON HYPERPROFIL - STYLES COMPLETS
   =══════════════════════════════════════════════════════════ */
.catalog-nav-item-hyperprofil {
    position: relative;
    background: linear-gradient(135deg, #09c2de 0%, #08a8c0 100%);
    color: #ffffff;
    font-weight: 800;
    border: 2px solid #09c2de;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(9, 194, 222, 0.3);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: visible;
}

.catalog-nav-item-hyperprofil:hover:not(.active) {
    background: linear-gradient(135deg, #08a8c0 0%, #078e9e 100%);
    border-color: #078e9e;
    box-shadow: 0 4px 12px rgba(9, 194, 222, 0.5);
    transform: translateY(-1px);
}

.catalog-nav-item-hyperprofil.active {
    background: linear-gradient(135deg, #09c2de 0%, #07b8d4 50%, #06aec8 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 16px rgba(9, 194, 222, 0.6), 0 0 20px rgba(9, 194, 222, 0.4);
    transform: translateY(-1px);
}

.hyperprofil-active-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 2px solid #09c2de;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(9, 194, 222, 0.5);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(9, 194, 222, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 12px rgba(9, 194, 222, 0.7);
    }
}

.hyperprofil-active-badge i {
    color: #09c2de;
    font-size: 0.75rem;
    font-weight: 900;
}

.hyperprofil-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-nav-item-hyperprofil:hover .hyperprofil-icon-wrapper {
    transform: rotate(15deg) scale(1.1);
}

.hyperprofil-icon-wrapper i {
    color: #ffffff;
    font-size: 0.875rem;
    text-shadow: none;
}

.catalog-nav-item-hyperprofil.active .hyperprofil-icon-wrapper i {
    color: #ffffff;
    font-size: 1.25rem;
    text-shadow: none;
}

.hyperprofil-label-multiline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    gap: 0;
}

.hyperprofil-line1,
.hyperprofil-line2 {
    color: #ffffff;
    font-weight: 800;
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    line-height: 1;
    display: block;
    text-shadow: none;
    transition: color 0.2s ease, font-size 0.2s ease;
}

.catalog-nav-item-hyperprofil.active .hyperprofil-line1,
.catalog-nav-item-hyperprofil.active .hyperprofil-line2 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 900;
    text-shadow: none;
}

/* ═══════════════════════════════════════════════════════════
   ACTIONS SECTION (DROITE)
   ═══════════════════════════════════════════════════════════ */

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--header-top-gap, 0.5rem);
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    flex-wrap: nowrap;
    margin-inline-end: var(--cfy-header-edge-offset, 10px) !important;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.3rem, 0.5vw, 0.5rem);
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    white-space: nowrap;
}

.cfy-sticky-header-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}
.header-sticky-filters-toggle-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 215, 0, 0.55);
    background: rgba(0, 0, 0, 0.86);
    color: #ffd700;
    border-radius: 0;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.header-sticky-filters-toggle-btn:hover,
.header-sticky-filters-toggle-btn:focus-visible {
    background: #6b5a4a;
    border-color: #ffd700;
    color: #ffd700;
}
.header-sticky-filters-toggle-btn.active {
    background: #ffd700;
    color: #000000;
    border-color: #ffd700;
}
.header-sticky-filters-toggle-btn.is-loading {
    opacity: 0.78;
    pointer-events: none;
}
.header-sticky-filters-toggle-icon {
    width: 18px;
    height: 18px;
}
.header-sticky-filters-feedback {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    font-size: 0.65rem;
    line-height: 1.2;
    color: #ffcf66;
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid rgba(255, 207, 102, 0.45);
    padding: 0.2rem 0.4rem;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 4;
}
.header-sticky-filters-feedback.is-visible {
    opacity: 1;
    transform: translateY(0);
}
body.dark-mode .header-sticky-filters-toggle-btn,
body[data-bs-theme='dark'] .header-sticky-filters-toggle-btn {
    background: #000000;
    color: #ffd700;
    border-color: #ffd700;
}
body.dark-mode .header-sticky-filters-toggle-btn.active,
body[data-bs-theme='dark'] .header-sticky-filters-toggle-btn.active {
    background: #ffd700;
    color: #000000;
    border-color: #ffd700;
}

.catalog-nav-item-search-tablet,
.catalog-nav-item-dashboard-tablet {
    display: none;
}

/* Styles de base pour le bouton dashboard-tablet - Fond noir, texte/bordure or */
.catalog-nav-item-dashboard-tablet {
    background: #000000;
    color: #FFD700;
    font-weight: 600;
    border: 1px solid #FFD700;
    border-radius: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Hover Dashboard : couleur bien soutenue, claire et légèrement orangée */
.catalog-nav-item-dashboard-tablet:hover:not(.active) {
    background: #6b5a4a;
    color: #FFD700;
    border-color: #FFD700;
}

.catalog-nav-item-dashboard-tablet.active {
    background: #000000;
    color: #FFD700;
    border-color: #FFD700;
}

/* Mode sombre - Dashboard tablet : même rendu que light (noir/or, hover orangé) — cohérent avec le bouton Login */
body.dark-mode .catalog-nav-item-dashboard-tablet,
body[data-bs-theme='dark'] .catalog-nav-item-dashboard-tablet {
    background: #000000 !important;
    color: #FFD700 !important;
    border-color: #FFD700 !important;
}

body.dark-mode .catalog-nav-item-dashboard-tablet:hover:not(.active),
body[data-bs-theme='dark'] .catalog-nav-item-dashboard-tablet:hover:not(.active) {
    background: #6b5a4a !important;
    color: #FFD700 !important;
    border-color: #FFD700 !important;
}

body.dark-mode .catalog-nav-item-dashboard-tablet.active,
body[data-bs-theme='dark'] .catalog-nav-item-dashboard-tablet.active {
    background: #000000 !important;
    color: #FFD700 !important;
    border-color: #FFD700 !important;
}

/* ═══════════════════════════════════════════════════════════
   BOUTON VISITEUR / BADGE CONNECTÉ - Charte graphique
   Light: fond or, texte noir. Hover: fond noir, texte/bordure or.
   Dark: idem (bouton reste or, hover = fond noir, texte or).
   ═══════════════════════════════════════════════════════════ */
.btn-visitor-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #FFD700;
    color: #000000;
    border: 2px solid #FFD700;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    margin-inline-start: var(--cfy-header-edge-offset, 10px);
}
.btn-visitor-header:hover,
.btn-visitor-header:focus-visible {
    background: #000000;
    border-color: #FFD700;
    color: #FFD700;
}
.btn-visitor-header:hover .visitor-name-header,
.btn-visitor-header:focus-visible .visitor-name-header {
    color: #FFD700;
}

/* Bouton LOGIN uniquement : état par défaut = noir/or (inverse du visiteur connecté), hover = fond orange-jaune */
.catalog-header .btn-visitor-header.btn-visitor-no-modal,
.catalog-header .btn-visitor-header[data-tablet-label] {
    background: #000000 !important;
    color: #FFD700 !important;
    border-color: #FFD700 !important;
}
.catalog-header .btn-visitor-header.btn-visitor-no-modal:hover,
.catalog-header .btn-visitor-header.btn-visitor-no-modal:focus-visible,
.catalog-header .btn-visitor-header[data-tablet-label]:hover,
.catalog-header .btn-visitor-header[data-tablet-label]:focus-visible {
    background: #FFD700 !important;
    color: #000000 !important;
    border-color: #FFD700 !important;
}
.catalog-header .btn-visitor-header.btn-visitor-no-modal:hover .visitor-btn-label-default,
.catalog-header .btn-visitor-header.btn-visitor-no-modal:hover .visitor-btn-label-hover,
.catalog-header .btn-visitor-header.btn-visitor-no-modal:focus-visible .visitor-btn-label-default,
.catalog-header .btn-visitor-header.btn-visitor-no-modal:focus-visible .visitor-btn-label-hover,
.catalog-header .btn-visitor-header[data-tablet-label]:hover .visitor-btn-label-default,
.catalog-header .btn-visitor-header[data-tablet-label]:hover .visitor-btn-label-hover,
.catalog-header .btn-visitor-header[data-tablet-label]:focus-visible .visitor-btn-label-default,
.catalog-header .btn-visitor-header[data-tablet-label]:focus-visible .visitor-btn-label-hover {
    color: #000000 !important;
}

/* Avatar visiteur connecté : taille max que le bouton peut accueillir */
.btn-visitor-header:not(.btn-visitor-no-modal) {
    min-height: 44px;
    padding: 0.35rem 0.85rem;
}
.visitor-avatar-img-header {
    width: 36px;
    height: 36px;
    max-height: calc(100% - 0.25rem);
    border-radius: 0;
    border: none;
    object-fit: cover;
    flex-shrink: 0;
}

/* Slug : noir par défaut (light + dark), or au hover */
.visitor-name-header {
    font-size: 0.875rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.05em;
}
body.dark-mode .btn-visitor-header .visitor-name-header,
body[data-bs-theme='dark'] .btn-visitor-header .visitor-name-header,
[data-bs-theme="dark"] .btn-visitor-header .visitor-name-header {
    color: #000000;
}
body.dark-mode .btn-visitor-header:hover .visitor-name-header,
body.dark-mode .btn-visitor-header:focus-visible .visitor-name-header,
body[data-bs-theme='dark'] .btn-visitor-header:hover .visitor-name-header,
body[data-bs-theme='dark'] .btn-visitor-header:focus-visible .visitor-name-header,
[data-bs-theme="dark"] .btn-visitor-header:hover .visitor-name-header,
[data-bs-theme="dark"] .btn-visitor-header:focus-visible .visitor-name-header {
    color: #FFD700;
}

/* Bouton « login » (ex-badge non connecté) : au hover afficher « login » */
.btn-visitor-no-modal .visitor-btn-label-hover {
    display: none;
}
.btn-visitor-no-modal:hover .visitor-btn-label-default,
.btn-visitor-no-modal:focus-visible .visitor-btn-label-default {
    display: none;
}
.btn-visitor-no-modal:hover .visitor-btn-label-hover,
.btn-visitor-no-modal:focus-visible .visitor-btn-label-hover {
    display: inline;
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary-light);
    cursor: pointer;
    border-radius: 0;
    width: 36px;
    height: 36px;
}

.mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
}

/* ═══════════════════════════════════════════════════════════
   MODE SOMBRE
   ═══════════════════════════════════════════════════════════ */

body.dark-mode .catalog-nav-item,
body[data-bs-theme='dark'] .catalog-nav-item {
    color: var(--text-secondary-dark);
}

body.dark-mode .catalog-nav-item:hover:not(.active),
body[data-bs-theme='dark'] .catalog-nav-item:hover:not(.active) {
    background: #000000;
    color: #ffffff;
}

body.dark-mode .catalog-nav-item.active,
body[data-bs-theme='dark'] .catalog-nav-item.active {
    background: #000000;
    color: #ffffff;
}

body.dark-mode .mobile-nav-toggle,
body[data-bs-theme='dark'] .mobile-nav-toggle {
    color: var(--text-secondary-dark);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - MOBILE FIRST
   ═══════════════════════════════════════════════════════════ */

/* 📱 SMARTPHONES PORTRAIT (xs) - 0px-575px */
@media (max-width: 575px) {
    /* Assurer que le header a une hauteur optimale et que tout tient */
    .catalog-header {
        min-height: 48px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Padding déjà supprimé globalement - pas besoin de le réappliquer ici */
    .nk-header .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .header-wrap-codepen {
        gap: var(--header-top-gap, 0.5rem);
        padding-right: 0;
        padding-left: 0;
        min-height: 44px;
        align-items: center;
    }
    
    /* Bouton menu compact */
    .nk-nav-toggle.d-xl-none {
        width: 28px;
        height: 28px;
        min-width: 28px;
        flex-shrink: 0;
        padding: 0;
    }
    
    .nk-nav-toggle.d-xl-none svg {
        width: 14px;
        height: 14px;
    }
    
    /* Logo compact mais visible */
    .catalog-logo {
        height: 22px;
        max-width: 100px;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .flag-img-after-logo {
        display: none;
    }
    
    .header-flag-btn-after-logo {
        display: none;
    }
    
    .line-logo-left {
        gap: var(--header-top-gap, 0.5rem);
        flex-shrink: 1;
        min-width: 0;
    }
    
    .header-logo-section {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        margin-left: 0 !important;
        margin-right: auto !important;
        justify-content: flex-start !important;
        order: 1;
    }
    
    /* Forcer l'ordre dans header-logo-section */
    .logo-wrapper {
        order: 1;
    }
    
    .btn-search-header-tablet {
        order: 2;
    }
    
    .header-nav-center {
        display: none;
    }
    
    /* Actions section optimisée */
    .header-actions {
        gap: var(--header-top-gap, 0.5rem);
        margin-right: 10px !important;
        margin-left: auto;
        padding-right: 0 !important;
        align-items: center;
        justify-content: flex-end;
        flex-shrink: 0;
        order: 2;
    }
    
    /* Forcer l'ordre dans header-actions */
    .header-flag-btn-after-logo {
        order: 1;
    }
    
    .catalog-nav-item-dashboard-tablet {
        order: 2;
    }
    
    .btn-visitor-header {
        order: 3;
    }
    
    .header-action-btn {
        padding: 0.3rem !important;
        min-width: auto;
        flex-shrink: 0;
    }
    
    /* Bouton dashboard compact mais visible - Positionné tout à droite */
    .catalog-nav-item-dashboard-tablet {
        display: inline-flex !important;
        order: 999 !important;
        margin-right: -0.4rem !important;
        padding: 0.3rem 0.45rem !important;
        font-size: 0.5rem !important;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .catalog-nav-item-dashboard-tablet .dashboard-line1,
    .catalog-nav-item-dashboard-tablet .dashboard-line2 {
        font-size: 0.5rem !important;
        line-height: 1 !important;
        letter-spacing: 0.05em !important;
    }
    
    /* Cacher le bouton recherche sur très petits écrans pour faire de la place */
    .catalog-nav-item-search-tablet {
        display: none !important;
    }
    
    /* Masquer Menu Jump sur smartphone et tablette (incluant iPad Mini) */
    .catalog-selector-trigger {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Masquer Carte du monde sur smartphone et tablette (incluant iPad Mini) */
    .mappemonde-link {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Bouton visiteur optimisé */
    .btn-visitor-header {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.65rem !important;
        min-width: auto;
        max-width: 90px;
        gap: 0.3rem;
        flex-shrink: 0;
        background: #FFD700 !important;
        color: #000000 !important;
        border: 2px solid #FFD700 !important;
        margin-left: 10px !important; /* Gap de 10px avec le bouton dashboard */
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Afficher le label court sur mobile - RÈGLES RENFORCÉES */
    .btn-visitor-header.mobile-label-enabled .visitor-name-header,
    .btn-visitor-header.mobile-label-enabled .visitor-avatar-img-header,
    .btn-visitor-header.mobile-label-enabled .visitor-btn-label-default,
    .btn-visitor-header.mobile-label-enabled .visitor-btn-label-hover,
    .btn-visitor-header[data-mobile-label] .visitor-name-header,
    .btn-visitor-header[data-mobile-label] .visitor-avatar-img-header,
    .btn-visitor-header[data-mobile-label] .visitor-btn-label-default,
    .btn-visitor-header[data-mobile-label] .visitor-btn-label-hover {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* Masquer le texte par défaut */
    .btn-visitor-header.mobile-label-enabled {
        font-size: 0 !important;
        text-indent: -9999px !important;
    }
    
    .btn-visitor-header.mobile-label-enabled::before,
    .btn-visitor-header[data-mobile-label]::before {
        content: attr(data-mobile-label) !important;
        font-weight: 900 !important;
        font-size: 1.1rem !important;
        color: #000000 !important;
        background: transparent !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        height: 100% !important;
        text-indent: 0 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        line-height: 1 !important;
    }
    
    .visitor-avatar-img-header {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0;
    }
    
    .visitor-name-header {
        font-size: 0.65rem !important;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 1;
    }
    
    /* Centrer le SVG V dans le bouton visiteur */
    .visitor-v-svg,
    .visitor-v-svg-simple {
        display: block !important;
        margin: 0 auto !important;
    }
}

/* 📱 SMARTPHONES PAYSAGE (sm) - 576px-767px */
@media (min-width: 576px) and (max-width: 767px) {
    /* Assurer que le header a une hauteur optimale et que tout tient */
    .catalog-header {
        min-height: 52px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Padding déjà supprimé globalement - pas besoin de le réappliquer ici */
    .nk-header .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .header-wrap-codepen {
        gap: var(--header-top-gap, 0.5rem);
        padding-right: 0;
        padding-left: 0;
        min-height: 48px;
        align-items: center;
    }
    
    /* Bouton menu */
    .nk-nav-toggle.d-xl-none {
        width: 32px;
        height: 32px;
        min-width: 32px;
        flex-shrink: 0;
        padding: 0;
    }
    
    .nk-nav-toggle.d-xl-none svg {
        width: 16px;
        height: 16px;
    }
    
    /* Logo optimisé */
    .catalog-logo {
        height: 26px;
        max-width: 140px;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .flag-img-after-logo {
        display: none;
    }
    
    .header-flag-btn-after-logo {
        display: none;
    }
    
    .line-logo-left {
        gap: var(--header-top-gap, 0.5rem);
        flex-shrink: 1;
        min-width: 0;
    }
    
    .header-logo-section {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        margin-left: 0 !important;
        margin-right: auto !important;
        justify-content: flex-start !important;
        order: 1;
    }
    
    /* Forcer l'ordre dans header-logo-section */
    .logo-wrapper {
        order: 1;
    }
    
    .btn-search-header-tablet {
        order: 2;
    }
    
    .header-nav-center {
        display: none;
    }
    
    /* Actions section optimisée */
    .header-actions {
        gap: var(--header-top-gap, 0.5rem);
        margin-right: 10px !important;
        margin-left: auto;
        padding-right: 0 !important;
        align-items: center;
        justify-content: flex-end;
        flex-shrink: 0;
        order: 2;
    }
    
    /* Forcer l'ordre dans header-actions */
    .header-flag-btn-after-logo {
        order: 1;
    }
    
    .catalog-nav-item-dashboard-tablet {
        order: 2;
    }
    
    .btn-visitor-header {
        order: 3;
    }
    
    .header-action-btn {
        padding: 0.35rem !important;
        min-width: auto;
        flex-shrink: 0;
    }
    
    /* Bouton recherche compact */
    .catalog-nav-item-search-tablet {
        display: inline-flex !important;
        padding: 0.35rem !important;
        min-width: auto;
    }
    
    .search-icon-header-tablet {
        height: 85% !important;
        width: auto !important;
        aspect-ratio: 1;
        stroke-width: 1.5px;
        transform: scaleX(-1); /* INVERSION HORIZONTALE */
        transition: transform 0.2s ease;
    }

    /* Background jaune mobile pour recherche active */
    .catalog-nav-item-search-tablet.active {
        background: #FFD700 !important;
        color: #000000 !important;
        border: 2px solid #FFD700 !important;
    }

    /* Hover mobile */
    .btn-search-header-tablet:hover .search-icon-header-tablet {
        transform: scaleX(1) !important;
    }
    
    /* Bouton dashboard - Positionné tout à droite contre l'écran */
    .catalog-nav-item-dashboard-tablet {
        display: inline-flex !important;
        order: 999 !important;
        margin-right: -0.5rem !important;
        padding: 0.35rem 0.55rem !important;
        font-size: 0.6rem !important;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .catalog-nav-item-dashboard-tablet .dashboard-line1,
    .catalog-nav-item-dashboard-tablet .dashboard-line2 {
        font-size: 0.6rem !important;
        line-height: 1 !important;
        letter-spacing: 0.08em !important;
    }
    
    /* Masquer Menu Jump sur smartphone et tablette (incluant iPad Mini) */
    .catalog-selector-trigger {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Masquer Carte du monde sur smartphone et tablette (incluant iPad Mini) */
    .mappemonde-link {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Bouton visiteur optimisé */
    .btn-visitor-header {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.7rem !important;
        min-width: auto;
        max-width: 110px;
        gap: 0.35rem;
        flex-shrink: 0;
        background: #FFD700 !important;
        color: #000000 !important;
        border: 2px solid #FFD700 !important;
        margin-left: 10px !important; /* Gap de 10px avec le bouton dashboard */
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Afficher le label court sur mobile - RÈGLES RENFORCÉES */
    .btn-visitor-header.mobile-label-enabled .visitor-name-header,
    .btn-visitor-header.mobile-label-enabled .visitor-avatar-img-header,
    .btn-visitor-header.mobile-label-enabled .visitor-btn-label-default,
    .btn-visitor-header.mobile-label-enabled .visitor-btn-label-hover,
    .btn-visitor-header[data-mobile-label] .visitor-name-header,
    .btn-visitor-header[data-mobile-label] .visitor-avatar-img-header,
    .btn-visitor-header[data-mobile-label] .visitor-btn-label-default,
    .btn-visitor-header[data-mobile-label] .visitor-btn-label-hover {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* Masquer le texte par défaut */
    .btn-visitor-header.mobile-label-enabled {
        font-size: 0 !important;
        text-indent: -9999px !important;
    }
    
    .btn-visitor-header.mobile-label-enabled::before,
    .btn-visitor-header[data-mobile-label]::before {
        content: attr(data-mobile-label) !important;
        font-weight: 900 !important;
        font-size: 1.15rem !important;
        color: #000000 !important;
        background: transparent !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        height: 100% !important;
        text-indent: 0 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        line-height: 1 !important;
    }
    
    .visitor-avatar-img-header {
        width: 18px !important;
        height: 18px !important;
        flex-shrink: 0;
    }
    
    .visitor-name-header {
        font-size: 0.7rem !important;
        max-width: 85px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 1;
    }
    
    /* Centrer le SVG V dans le bouton visiteur */
    .visitor-v-svg,
    .visitor-v-svg-simple {
        display: block !important;
        margin: 0 auto !important;
    }
}

/* 📟 TABLETTES (md) - 768px-1024px (incluant iPad Mini) */
@media (min-width: 768px) and (max-width: 1024px) {
    .header-wrap-codepen {
        gap: var(--header-top-gap, 0.5rem);
        overflow: visible;
    }
    
    .catalog-header {
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .nk-nav-toggle.d-xl-none {
        width: 44px;
        height: 44px;
        min-height: 44px;
    }
    
    .nk-nav-toggle.d-xl-none svg {
        width: 22px;
        height: 22px;
    }
    
    .catalog-logo {
        height: 44px;
        max-width: 220px;
    }
    
    .flag-img-after-logo {
        height: 28px;
        max-width: 36px;
    }
    
    .line-logo-left {
        gap: var(--header-top-gap, 0.5rem);
    }
    
    /* Forcer l'ordre d'affichage uniforme */
    .header-logo-section {
        order: 1;
    }
    
    .logo-wrapper {
        order: 1;
    }
    
    .btn-search-header-tablet {
        order: 2;
    }
    
    .catalog-selector-trigger {
        order: 3;
    }
    
    .header-actions {
        order: 2;
    }
    
    .header-flag-btn-after-logo {
        order: 1;
    }
    
    .catalog-nav-item-dashboard-tablet {
        order: 2;
    }
    
    .btn-visitor-header {
        order: 3;
    }
    
    .header-nav-center {
        gap: 0.25rem;
        margin: 0 0.5rem;
    }
    
    .header-nav-center .catalog-nav-item-search,
    .header-nav-center .catalog-nav-item-dashboard {
        display: none;
    }
    
    /* Code original commenté - Bouton hyperprofil caché globalement */
    /*
    .header-nav-center .catalog-nav-item-hyperprofil {
        display: none;
    }
    */
    
    .catalog-nav-item {
        padding: 0.3rem 0.6rem;
        font-size: 0.6rem;
        gap: 0.25rem;
    }
    
    .catalog-nav-item.active {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
    
    .catalog-nav-item.active .catalog-label-top {
        font-family: cursive !important;
        color: #FFD700 !important;
        font-size: 0.4rem;
    }
    
    .catalog-nav-item.active i {
        font-size: 0.75rem;
    }
    
    .catalog-nav-item.active .catalog-label-text {
        font-size: 0.75rem;
    }
    
    .search-icon-header,
    .search-icon-header-tablet {
        height: 60% !important;
        width: auto !important;
        max-height: 16px !important;
        max-width: 16px !important;
        aspect-ratio: 1;
        stroke-width: 2px;
        transform: scaleX(-1); /* INVERSION HORIZONTALE */
        transition: transform 0.2s ease;
    }
    
    /* Bouton loupe à la hauteur max du header — plus gros sur tablette */
    .line-logo-left .btn-search-header-tablet {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        max-width: 52px !important;
        max-height: 52px !important;
        padding: 10px !important;
    }
    
    .line-logo-left .search-icon-header-tablet {
        width: 32px !important;
        height: 32px !important;
        max-height: 32px !important;
        max-width: 32px !important;
        aspect-ratio: 1;
    }

    /* Hover tablettes */
    .btn-search-header-tablet:hover .search-icon-header-tablet,
    .catalog-nav-item:hover .search-icon-header {
        transform: scaleX(1) !important;
    }
    
    .catalog-nav-item-search.active .search-icon-header {
        width: 18px;
        height: 18px;
    }
    
    .dashboard-line1,
    .dashboard-line2 {
        font-size: 0.6rem;
    }
    
    .catalog-nav-item-dashboard.active .dashboard-line1,
    .catalog-nav-item-dashboard.active .dashboard-line2 {
        font-size: 0.75rem;
    }
    
    /* Code original commenté - Bouton hyperprofil caché globalement */
    /*
    .hyperprofil-line1,
    .hyperprofil-line2 {
        font-size: 0.6rem;
    }
    
    .catalog-nav-item-hyperprofil.active .hyperprofil-line1,
    .catalog-nav-item-hyperprofil.active .hyperprofil-line2 {
        font-size: 0.75rem;
    }
    */
    
    .header-actions {
        gap: var(--header-top-gap, 0.5rem);
        overflow: visible;
        flex-shrink: 0;
    }
    
    .catalog-nav-item-search-tablet,
    .catalog-nav-item-dashboard-tablet {
        display: inline-flex;
    }
    
    .catalog-nav-item-dashboard-tablet {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .catalog-nav-item-dashboard-tablet .dashboard-line1,
    .catalog-nav-item-dashboard-tablet .dashboard-line2 {
        font-size: 0.85rem;
    }
    
    /* ─── BOUTON VISITEUR TABLETTE : RESET COMPLET ─── */
    /* Même comportement que desktop, libellé « login » affiché directement */
    .btn-visitor-header {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        min-width: auto;
        flex-shrink: 0;
        overflow: visible;
        white-space: nowrap;
        margin-left: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .btn-visitor-header[data-tablet-label] {
        font-size: 0.875rem !important;
        text-indent: 0 !important;
        max-height: none !important;
        max-width: none !important;
    }
    
    .btn-visitor-header[data-tablet-label]::before {
        content: none !important;
        display: none !important;
    }
    
    .btn-visitor-header[data-tablet-label] .visitor-btn-label-default {
        display: none !important;
    }
    
    .btn-visitor-header[data-tablet-label] .visitor-btn-label-hover {
        display: inline !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
        height: auto !important;
        position: static !important;
        left: auto !important;
    }
    
    .visitor-avatar-img-header {
        width: 28px;
        height: 28px;
    }
    
    .visitor-name-header {
        font-size: 0.75rem;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
}

/* 💻 HD (lg) - 992px-1199px */
@media (min-width: 992px) and (max-width: 1199px) {
    .header-wrap-codepen {
        gap: var(--header-top-gap, 0.5rem);
    }
    
    .catalog-logo {
        height: 24px;
        max-width: 100px;
    }
    
    .nk-nav-toggle.d-xl-none {
        width: 24px;
        height: 24px;
    }
    
    .nk-nav-toggle.d-xl-none svg {
        width: 12px;
        height: 12px;
    }
    
    .flag-img-after-logo {
        height: 24px;
        max-width: 32px;
    }
    
    .line-logo-left {
        gap: var(--header-top-gap, 0.5rem);
    }
    
    .header-nav-center {
        gap: 0.3rem;
        margin: 0 0.5rem;
    }
    
    .catalog-nav-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    
    .catalog-nav-item.active {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
    
    .catalog-nav-item.active .catalog-label-top {
        font-family: cursive !important;
        color: #FFD700 !important;
        font-size: 0.5rem;
    }
    
    .catalog-nav-item.active i {
        font-size: 0.85rem;
    }
    
    .catalog-nav-item.active .catalog-label-text {
        font-size: 0.85rem;
    }
    
    .search-icon-header,
    .search-icon-header-tablet {
        height: 95% !important;
        width: auto !important;
        aspect-ratio: 1;
        stroke-width: 2px;
        transform: scaleX(-1); /* INVERSION HORIZONTALE */
        transition: transform 0.2s ease;
    }
    
    .catalog-nav-item-search.active .search-icon-header {
        width: 20px;
        height: 20px;
    }
    
    .dashboard-line1,
    .dashboard-line2 {
        font-size: 0.7rem;
    }
    
    .catalog-nav-item-dashboard.active .dashboard-line1,
    .catalog-nav-item-dashboard.active .dashboard-line2 {
        font-size: 0.85rem;
    }
    
    /* Code original commenté - Bouton hyperprofil caché globalement */
    /*
    .hyperprofil-line1,
    .hyperprofil-line2 {
        font-size: 0.7rem;
    }
    
    .catalog-nav-item-hyperprofil.active .hyperprofil-line1,
    .catalog-nav-item-hyperprofil.active .hyperprofil-line2 {
        font-size: 0.85rem;
    }
    */
}

/* 🖥️ FHD (xl) - 1200px-1539px */
@media (min-width: 1200px) and (max-width: 1539px) {
    .header-wrap-codepen {
        gap: var(--header-top-gap, 0.5rem);
    }
    
    .catalog-logo {
        height: 28px;
        max-width: 120px;
    }
    
    .flag-img-after-logo {
        height: 28px;
        max-width: 36px;
    }
    
    .header-nav-center {
        gap: 0.4rem;
        margin: 0 0.75rem;
    }
    
    .catalog-nav-item {
        padding: 0.45rem 0.9rem;
        font-size: 0.75rem;
        gap: 0.35rem;
    }
    
    .catalog-nav-item.active {
        font-size: 1rem;
        padding: 0.8rem 1.6rem;
    }
    
    .catalog-nav-item.active .catalog-label-top {
        font-family: cursive !important;
        color: #FFD700 !important;
        font-size: 0.55rem;
    }
    
    .catalog-nav-item.active i {
        font-size: 1rem;
    }
    
    .catalog-nav-item.active .catalog-label-text {
        font-size: 1rem;
    }
    
    .search-icon-header,
    .search-icon-header-tablet {
        height: 95% !important;
        width: auto !important;
        aspect-ratio: 1;
        stroke-width: 2px;
        transform: scaleX(-1); /* INVERSION HORIZONTALE */
        transition: transform 0.2s ease;
    }
    
    .catalog-nav-item-search.active .search-icon-header {
        width: 22px;
        height: 22px;
    }
    
    .dashboard-line1,
    .dashboard-line2 {
        font-size: 0.75rem;
    }
    
    .catalog-nav-item-dashboard.active .dashboard-line1,
    .catalog-nav-item-dashboard.active .dashboard-line2 {
        font-size: 1rem;
    }
    
    /* Code original commenté - Bouton hyperprofil caché globalement */
    /*
    .hyperprofil-line1,
    .hyperprofil-line2 {
        font-size: 0.75rem;
    }
    
    .catalog-nav-item-hyperprofil.active .hyperprofil-line1,
    .catalog-nav-item-hyperprofil.active .hyperprofil-line2 {
        font-size: 1rem;
    }
    */
}

/* 🖥️ 2K (xxl) - 1540px-2559px */
@media (min-width: 1540px) and (max-width: 2559px) {
    .header-wrap-codepen {
        gap: var(--header-top-gap, 0.5rem);
    }
    
    .catalog-logo {
        height: 32px;
        max-width: 150px;
    }
    
    .flag-img-after-logo {
        height: 32px;
        max-width: 42px;
    }
    
    .header-nav-center {
        gap: 0.5rem;
        margin: 0 1rem;
    }
    
    .catalog-nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        gap: 0.5rem;
    }
    
    .catalog-nav-item.active {
        font-size: 1.25rem;
        padding: 1rem 2rem;
    }
    
    .catalog-nav-item.active .catalog-label-top {
        font-family: cursive !important;
        color: #FFD700 !important;
        font-size: 0.65rem;
    }
    
    .catalog-nav-item.active i {
        font-size: 1.25rem;
    }
    
    .catalog-nav-item.active .catalog-label-text {
        font-size: 1.25rem;
    }
    
    .search-icon-header,
    .search-icon-header-tablet {
        height: 100% !important;
        width: auto !important;
        aspect-ratio: 1;
        stroke-width: 2.5px;
        transform: scaleX(-1); /* INVERSION HORIZONTALE */
        transition: transform 0.2s ease;
    }
    
    .catalog-nav-item-search.active .search-icon-header {
        width: 24px;
        height: 24px;
    }
    
    .dashboard-line1,
    .dashboard-line2 {
        font-size: 0.875rem;
    }
    
    .catalog-nav-item-dashboard.active .dashboard-line1,
    .catalog-nav-item-dashboard.active .dashboard-line2 {
        font-size: 1.25rem;
    }
    
    /* Code original commenté - Bouton hyperprofil caché globalement */
    /*
    .hyperprofil-line1,
    .hyperprofil-line2 {
        font-size: 0.875rem;
    }
    
    .catalog-nav-item-hyperprofil.active .hyperprofil-line1,
    .catalog-nav-item-hyperprofil.active .hyperprofil-line2 {
        font-size: 1.25rem;
    }
    */
}

/* 🖥️ 4K/8K - 2560px+ */
@media (min-width: 2560px) {
    .header-wrap-codepen {
        gap: var(--header-top-gap, 0.5rem);
    }
    
    .catalog-logo {
        height: 40px;
        max-width: 200px;
    }
    
    .nk-nav-toggle.d-xl-none {
        width: 40px;
        height: 40px;
    }
    
    .nk-nav-toggle.d-xl-none svg {
        width: 20px;
        height: 20px;
    }
    
    .flag-img-after-logo {
        height: 40px;
        max-width: 54px;
    }
    
    .header-nav-center {
        gap: 0.625rem;
        margin: 0 1.25rem;
    }
    
    .catalog-nav-item {
        padding: 0.625rem 1.25rem;
        font-size: 1.125rem;
        gap: 0.625rem;
    }
    
    .catalog-nav-item.active {
        font-size: 1.5625rem;
        padding: 1.25rem 2.5rem;
    }
    
    .catalog-nav-item.active .catalog-label-top {
        font-family: cursive !important;
        color: #FFD700 !important;
        font-size: 0.8125rem;
    }
    
    .catalog-nav-item.active i {
        font-size: 1.5625rem;
    }
    
    .catalog-nav-item.active .catalog-label-text {
        font-size: 1.5625rem;
    }
    
    .search-icon-header,
    .search-icon-header-tablet {
        height: 120% !important;
        width: auto !important;
        aspect-ratio: 1;
        stroke-width: 3px;
        transform: scaleX(-1); /* INVERSION HORIZONTALE */
        transition: transform 0.2s ease;
    }
    
    .catalog-nav-item-search.active .search-icon-header {
        width: 30px;
        height: 30px;
    }
    
    .dashboard-line1,
    .dashboard-line2 {
        font-size: 1.125rem;
    }
    
    .catalog-nav-item-dashboard.active .dashboard-line1,
    .catalog-nav-item-dashboard.active .dashboard-line2 {
        font-size: 1.5625rem;
    }
    
    /* Code original commenté - Bouton hyperprofil caché globalement */
    /*
    .hyperprofil-line1,
    .hyperprofil-line2 {
        font-size: 1.125rem;
    }
    
    .catalog-nav-item-hyperprofil.active .hyperprofil-line1,
    .catalog-nav-item-hyperprofil.active .hyperprofil-line2 {
        font-size: 1.5625rem;
    }
    */
    
    .btn-visitor-header {
        padding: 0.5rem 1rem;
        font-size: 1.125rem;
        margin-left: 10px !important; /* Gap de 10px avec le bouton dashboard */
    }
    
    .visitor-avatar-img-header {
        width: 44px;
        height: 44px;
    }
    
    .visitor-name-header {
        font-size: 1.125rem;
    }
    
    .mobile-nav-toggle {
        width: 45px;
        height: 45px;
    }
    
    .mobile-nav-toggle svg {
        width: 30px;
        height: 30px;
    }
}

/* ═══════════════════════════════════════════════════════════
   MODAL MAPPÉMONDE (fullscreen lazy)
   ═══════════════════════════════════════════════════════════ */
#mappemonde {
    position: relative;
    z-index: 1099;
}

/* Carte du monde : PLEIN ÉCRAN SANS EXCEPTION — overlay et fenêtre 100vw × 100vh */
.map-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.map-modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.map-modal {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    background: #ffffff;
    color: #0e1525;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

body.dark-mode .map-modal,
[data-bs-theme="dark"] .map-modal {
    background: #0d1117;
    color: #e9edf5;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.map-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 8px 10px;
    padding-right: 5rem;
    padding-left: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.map-modal-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.map-modal-logo {
    height: 32px;
    width: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.map-view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
}

.map-view-btn {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.03);
    color: inherit;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    outline: none;
}

.map-view-btn:hover,
.map-view-btn:focus-visible {
    background: rgba(75, 123, 255, 0.12);
    border-color: rgba(75, 123, 255, 0.35);
}

.map-view-btn.is-active {
    background: rgba(75, 123, 255, 0.2);
    border-color: rgba(75, 123, 255, 0.5);
    color: #4b7bff;
}

body.dark-mode .map-view-btn,
[data-bs-theme="dark"] .map-view-btn {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .map-view-btn:hover,
body.dark-mode .map-view-btn:focus-visible,
[data-bs-theme="dark"] .map-view-btn:hover,
[data-bs-theme="dark"] .map-view-btn:focus-visible {
    background: rgba(75, 123, 255, 0.2);
    border-color: rgba(75, 123, 255, 0.4);
}

body.dark-mode .map-view-btn.is-active,
[data-bs-theme="dark"] .map-view-btn.is-active {
    background: rgba(75, 123, 255, 0.3);
    border-color: rgba(75, 123, 255, 0.6);
    color: #6b8fff;
}

/* Bouton DASHBOARD avec style distinctif */
.map-dashboard-btn {
    border: 2px solid #DAA520;
    background: linear-gradient(135deg, #DAA520 0%, #FFD700 100%);
    color: #1a1a1a;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    margin-left: 12px;
    margin-right: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.3);
}

.map-dashboard-btn:hover,
.map-dashboard-btn:focus-visible {
    background: linear-gradient(135deg, #FFD700 0%, #DAA520 100%);
    border-color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.5);
}

.map-dashboard-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(218, 165, 32, 0.4);
}

body.dark-mode .map-dashboard-btn,
[data-bs-theme="dark"] .map-dashboard-btn {
    background: linear-gradient(135deg, #DAA520 0%, #FFD700 100%);
    color: #1a1a1a;
    border-color: #FFD700;
}

body.dark-mode .map-dashboard-btn:hover,
body.dark-mode .map-dashboard-btn:focus-visible,
[data-bs-theme="dark"] .map-dashboard-btn:hover,
[data-bs-theme="dark"] .map-dashboard-btn:focus-visible {
    background: linear-gradient(135deg, #FFD700 0%, #DAA520 100%);
    border-color: #FFD700;
    box-shadow: 0 4px 16px rgba(218, 165, 32, 0.6);
}

body.dark-mode .map-modal-header,
[data-bs-theme="dark"] .map-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* ═══════════════════════════════════════════════════════════
   Modal Mappemonde V3 — header et footer type Dashboard, onglets dans le body
   ═══════════════════════════════════════════════════════════ */
.map-modal-overlay .map-mappemonde-header {
    position: relative !important;
    background: #101924 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: clamp(16px, 2vw, 22px) clamp(16px, 2vw, 24px) !important;
    padding-right: 8rem !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    min-height: 80px !important;
    max-height: 180px !important;
    overflow: hidden !important;
}
.map-modal-overlay .map-mappemonde-header .container-fluid {
    flex: 1 !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-header-inner {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    gap: 0.5rem 1.5rem !important;
    min-width: 0 !important;
    width: 100% !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-logo-link {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-logo {
    height: 54px !important;
    width: auto !important;
    max-height: 100% !important;
    border: 10px solid #000000 !important;
    display: block !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-title {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    width: max-content !important;
    max-width: calc(100% - 4rem) !important;
    text-align: center !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    color: #ffcc00 !important;
    border-bottom: 2px solid rgba(255, 204, 0, 0.55) !important;
    padding-bottom: 0.35rem !important;
    z-index: 1 !important;
    pointer-events: none !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn,
.map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn,
.map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 2px solid #ffcc00 !important;
    border-radius: 0 !important;
    color: #e9ecef !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease !important;
    z-index: 20 !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn { right: 14rem !important; }
.map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn { right: 9.75rem !important; }
.map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn { right: 5.5rem !important; }
.map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn:hover,
.map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn:hover,
.map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: #ffcc00 !important;
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.05) !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-close {
    position: absolute !important;
    top: 50% !important;
    right: 1.25rem !important;
    transform: translateY(-50%) !important;
    background: #0d0d0d !important;
    border: 2px solid #ffcc00 !important;
    border-radius: 0 !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    cursor: pointer !important;
    z-index: 20 !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-close:hover {
    background: #ffcc00 !important;
    color: #0d0d0d !important;
    transform: translateY(-50%) scale(1.06) !important;
}
.map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn-icon,
.map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn .dashboard-modal-search-btn-icon,
.map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn .theme-icon {
    width: 28px !important;
    height: 28px !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Onglets dans le body (Carte, Recherche, Complétude) — angles droits, espacés */
.map-modal-body .map-modal-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.12);
    padding: 0 0 0.5rem 0;
    margin: 0 0 0.75rem 0;
    list-style: none;
}
body.dark-mode .map-modal-body .map-modal-tabs,
[data-bs-theme="dark"] .map-modal-body .map-modal-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.15);
}
.map-modal-body .map-modal-tabs .nav-item {
    margin: 0;
}
/* Light mode : VRAIMENT lisible — texte noir, pas de jaune */
.map-modal-body .map-modal-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: transparent;
    color: #333333 !important;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    opacity: 0.8;
    transition: all 0.2s ease;
}
.map-modal-body .map-modal-tabs .nav-link:hover {
    background: #f5f5f5 !important;
    color: #111111 !important;
    opacity: 1;
}
.map-modal-body .map-modal-tabs .nav-link.active {
    color: #111111 !important;
    background: #e9ecef !important;
    border-bottom-color: #333333 !important;
    opacity: 1;
}
/* Light mode explicite pour écraser le reste */
body.light-mode .map-modal-body .map-modal-tabs .nav-link,
body:not(.dark-mode):not([data-bs-theme="dark"]) .map-modal-body .map-modal-tabs .nav-link {
    color: #333333 !important;
    background: transparent !important;
    opacity: 0.8 !important;
}
body.light-mode .map-modal-body .map-modal-tabs .nav-link:hover,
body:not(.dark-mode):not([data-bs-theme="dark"]) .map-modal-body .map-modal-tabs .nav-link:hover {
    background: #f5f5f5 !important;
    color: #111111 !important;
    opacity: 1 !important;
}
body.light-mode .map-modal-body .map-modal-tabs .nav-link.active,
body:not(.dark-mode):not([data-bs-theme="dark"]) .map-modal-body .map-modal-tabs .nav-link.active {
    color: #111111 !important;
    background: #e9ecef !important;
    border-bottom-color: #333333 !important;
    opacity: 1 !important;
}

/* Dark mode : contraste élevé pour visibilité */
body.dark-mode .map-modal-body .map-modal-tabs .nav-link,
[data-bs-theme="dark"] .map-modal-body .map-modal-tabs .nav-link {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    opacity: 0.9 !important;
}
body.dark-mode .map-modal-body .map-modal-tabs .nav-link:hover,
[data-bs-theme="dark"] .map-modal-body .map-modal-tabs .nav-link:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}
body.dark-mode .map-modal-body .map-modal-tabs .nav-link.active,
[data-bs-theme="dark"] .map-modal-body .map-modal-tabs .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 204, 0, 0.25) !important;
    border-bottom-color: #ffcc00 !important;
    opacity: 1 !important;
}
.map-modal-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.map-tab-pane {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}
.map-tab-pane.active {
    display: flex !important;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}
.map-tab-pane .map-canvas {
    flex: 1;
    min-height: 200px;
}
.map-tab-pane-completude .map-legend {
    display: flex !important;
}

/* Footer Mappemonde V3 — type Dashboard */
.map-modal-overlay .map-mappemonde-footer {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem 1rem !important;
    border-top: 1px solid rgba(255, 204, 0, 0.2) !important;
    background: #0a0a0a !important;
    padding: 0.75rem 1.25rem !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0 0.5rem !important;
    font-size: 0.8rem !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link {
    color: #e9ecef !important;
    text-decoration: none !important;
    padding: 0.2rem 0 !important;
    border-bottom: 1px solid transparent !important;
    transition: color 0.2s ease, border-color 0.2s ease !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link:hover {
    color: #ffcc00 !important;
    border-bottom-color: rgba(255, 204, 0, 0.5) !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link-tour {
    font-weight: 600 !important;
    color: #ffcc00 !important;
    border-bottom: 1px solid rgba(255, 204, 0, 0.4) !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link-tour:hover {
    color: #fff !important;
    border-bottom-color: #ffcc00 !important;
}
/* Footer actions — même structure que #dashboardModal */
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-sep {
    color: rgba(255, 255, 255, 0.35) !important;
}
/* Bouton Retour — identique au modèle (optionsModal / Dashboard) */
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    min-width: 7rem !important;
    padding: 0.5rem 0.9rem !important;
    background: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.45) !important;
    border-radius: 0 !important;
    color: #e9ecef !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-back-btn .dashboard-modal-footer-back-btn-icon {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
}
.map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-back-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 204, 0, 0.6) !important;
    color: #ffcc00 !important;
}
/* Bouton Fermer — copie exacte du modèle #dashboardModal (dark: bordure orange, hover BG + texte) */
.map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer,
body.dark-mode .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer,
body:not(.light-mode) .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer {
    background: #0d0d0d !important;
    border: 2px solid #ffcc00 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    padding: 0.65rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease !important;
}
.map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer:hover,
body.dark-mode .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer:hover,
body:not(.light-mode) .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer:hover {
    background: rgba(255, 204, 0, 0.25) !important;
    border-color: #ffcc00 !important;
    color: #ffcc00 !important;
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    transform: scale(1.02) !important;
}
.map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer:focus-visible,
body.dark-mode .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer:focus-visible,
body:not(.light-mode) .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.5) !important;
}

/* Light mode — header/footer Mappemonde V3 */
body.light-mode .map-modal-overlay .map-mappemonde-header {
    background: #eef0f3 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-title {
    color: #1a1d21 !important;
    border-bottom-color: rgba(184, 134, 11, 0.6) !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn,
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn,
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn {
    background: transparent !important;
    border: 2px solid #b8860b !important;
    color: #1a1d21 !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn:hover,
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn:hover,
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    border-color: #b8860b !important;
    color: #1a1d21 !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-close {
    background: #1a1d21 !important;
    border: 2px solid #b8860b !important;
    color: #ffffff !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-header .dashboard-modal-close:hover {
    background: #ffcc00 !important;
    border-color: #b8860b !important;
    color: #1a1d21 !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer {
    background: #eef0f3 !important;
    border-top-color: rgba(184, 134, 11, 0.3) !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link {
    color: #1a1d21 !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link:hover {
    color: #b8860b !important;
    border-bottom-color: rgba(184, 134, 11, 0.5) !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link-tour {
    color: #b8860b !important;
    border-bottom-color: rgba(184, 134, 11, 0.4) !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-link-tour:hover {
    color: #1a1d21 !important;
    border-bottom-color: #b8860b !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav-sep {
    color: rgba(0, 0, 0, 0.35) !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-back-btn {
    border-color: rgba(0, 0, 0, 0.2) !important;
    color: #1a1d21 !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-back-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    border-color: #b8860b !important;
    color: #1a1d21 !important;
}
/* White mode : bouton Fermer fond noir comme le modèle Dashboard */
body.light-mode .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer,
body.light-mode .map-modal-overlay .map-mappemonde-footer .btn.commercify-modal-btn-fermer {
    background: #1a1d21 !important;
    border: 2px solid #b8860b !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease !important;
}
body.light-mode .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer:hover,
body.light-mode .map-modal-overlay .map-mappemonde-footer .btn.commercify-modal-btn-fermer:hover {
    background: rgba(255, 204, 0, 0.2) !important;
    border-color: #b8860b !important;
    color: #1a1d21 !important;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.3) !important;
}

[dir="rtl"] .map-modal-overlay .map-mappemonde-header {
    padding-left: 8rem !important;
    padding-right: clamp(16px, 2vw, 24px) !important;
}
[dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn { right: auto !important; left: 14rem !important; }
[dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn { right: auto !important; left: 9.75rem !important; }
[dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn { right: auto !important; left: 5.5rem !important; }
[dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-close { right: auto !important; left: 1.25rem !important; }

/* Footer modal Mappemonde (legacy / fallback) */
.map-modal-footer,
.map-modal .modal-footer:not(.map-mappemonde-footer) {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 6px 10px !important;
    margin: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

body.dark-mode .map-modal-footer,
body.dark-mode .map-modal .modal-footer:not(.map-mappemonde-footer),
[data-bs-theme="dark"] .map-modal-footer,
[data-bs-theme="dark"] .map-modal .modal-footer:not(.map-mappemonde-footer) {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.map-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.map-beta {
    font-size: 0.72rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: linear-gradient(120deg, #ffcc70, #ffa45c);
    color: #1a1f2b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.map-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    margin-left: 0;
    border: 1px solid rgba(255, 204, 0, 0.45);
    background: #141c26;
    color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 20;
}

.map-close-btn:hover,
.map-close-btn:focus-visible {
    background: #e6b800;
    color: #000000;
    transform: scale(1.05);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.25);
}

body.dark-mode .map-close-btn {
    background: #141c26;
    border-color: rgba(255, 204, 0, 0.45);
    color: #f8f9fa;
}

body.dark-mode .map-close-btn:hover,
body.dark-mode .map-close-btn:focus-visible,
[data-bs-theme="dark"] .map-close-btn:hover,
[data-bs-theme="dark"] .map-close-btn:focus-visible {
    background: #e6b800;
    color: #000000;
}

[dir="rtl"] .map-modal-header {
    padding-right: 10px;
    padding-left: 5rem;
}
[dir="rtl"] .map-modal-logo-link {
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .map-close-btn {
    right: auto;
    left: 1.5rem;
}

.map-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 10px 4px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    max-height: none !important;
}

.map-modal-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.map-canvas {
    position: relative;
    background: radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.03), transparent 45%), #f7f9fc;
    border-radius: 0;
    padding: 4px 0;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden;
    flex: 1 1 auto !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    will-change: contents;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    isolation: isolate;
}

.map-canvas.collapsed {
    display: none;
}

.map-panel:not(.collapsed) {
    flex: 1;
    display: grid;
    min-height: 0;
}

body.dark-mode .map-canvas,
[data-bs-theme="dark"] .map-canvas {
    background: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.05), transparent 45%), #0f172a;
}

.map-svg {
    width: 100%;
    height: 100%;
    display: block;
    /* Optimisation GPU */
    will-change: contents;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.map-svg path,
.map-svg .map-dot {
    fill: #c2c9d6;
    stroke: #94a3b8;
    stroke-width: 0.4;
    /* Optimisation: utiliser transform au lieu de fill/stroke pour meilleure performance GPU */
    transition: opacity 120ms ease;
    cursor: pointer;
    /* Optimisation GPU */
    will-change: opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Force l'accélération matérielle */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.map-svg .is-active:not(.map-path-with-data):not(.map-path-empty):not(.map-dot-with-data):not(.map-dot-empty),
.map-svg path:hover:not(.map-path-with-data):not(.map-path-empty),
.map-svg .map-dot:hover:not(.map-dot-with-data):not(.map-dot-empty) {
    fill: #FF8C00;
    stroke: #FFD700;
    stroke-width: 0.6;
    /* Optimisation: maintenir l'accélération GPU */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.dark-mode .map-svg path,
body.dark-mode .map-svg .map-dot,
[data-bs-theme="dark"] .map-svg path,
[data-bs-theme="dark"] .map-svg .map-dot {
    fill: #223044;
    stroke: #5b708f;
}

body.dark-mode .map-svg path:hover,
body.dark-mode .map-svg .map-dot:hover,
[data-bs-theme="dark"] .map-svg path:hover,
[data-bs-theme="dark"] .map-svg .map-dot:hover {
    fill: #FFA500;
    stroke: #FFD700;
    stroke-width: 0.6;
}

.map-tooltip {
    position: absolute;
    pointer-events: none;
    padding: 6px 10px;
    border-radius: 8px;
    background: #0b1220;
    color: #e9edf5;
    font-size: 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 120ms ease;
    white-space: nowrap;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Optimisation GPU */
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Position calculée dynamiquement par JavaScript */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.map-tooltip-flag {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-tooltip-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.map-tooltip-code {
    opacity: 0.7;
    font-size: 0.9em;
}

.map-tooltip-status {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════
   VUE RISK - COMPLÉTUDE DES PAYS
   ═══════════════════════════════════════════════════════════ */

/* Pays avec données (prêt pour tests) */
.map-svg .map-path-with-data,
.map-svg .map-dot-with-data {
    fill: #10b981;
    stroke: #059669;
    stroke-width: 0.5;
}

.map-svg .map-path-with-data:hover,
.map-svg .map-dot-with-data:hover {
    fill: #34d399;
    stroke: #10b981;
    stroke-width: 0.7;
}

/* Pays vides (à compléter) */
.map-svg .map-path-empty,
.map-svg .map-dot-empty {
    fill: #ef4444;
    stroke: #dc2626;
    stroke-width: 0.5;
}

.map-svg .map-path-empty:hover,
.map-svg .map-dot-empty:hover {
    fill: #f87171;
    stroke: #ef4444;
    stroke-width: 0.7;
}

body.dark-mode .map-svg .map-path-with-data,
body.dark-mode .map-svg .map-dot-with-data,
[data-bs-theme="dark"] .map-svg .map-path-with-data,
[data-bs-theme="dark"] .map-svg .map-dot-with-data {
    fill: #059669;
    stroke: #047857;
}

body.dark-mode .map-svg .map-path-empty,
body.dark-mode .map-svg .map-dot-empty,
[data-bs-theme="dark"] .map-svg .map-path-empty,
[data-bs-theme="dark"] .map-svg .map-dot-empty {
    fill: #dc2626;
    stroke: #b91c1c;
}

/* Légende Risk */
.map-legend {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10;
    max-width: 280px;
    font-size: 0.875rem;
}

body.dark-mode .map-legend,
[data-bs-theme="dark"] .map-legend {
    background: rgba(15, 23, 42, 0.98);
    color: #e9edf5;
}

.map-legend-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-legend-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #0b1220;
}

body.dark-mode .map-legend-title,
[data-bs-theme="dark"] .map-legend-title {
    color: #e9edf5;
}

.map-legend-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .map-legend-stats,
[data-bs-theme="dark"] .map-legend-stats {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.map-legend-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-legend-label {
    color: #64748b;
    font-size: 0.8rem;
}

body.dark-mode .map-legend-label,
[data-bs-theme="dark"] .map-legend-label {
    color: #94a3b8;
}

.map-legend-with-data {
    color: #10b981;
}

.map-legend-empty {
    color: #ef4444;
}

.map-legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.map-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .map-legend-color,
[data-bs-theme="dark"] .map-legend-color {
    border-color: rgba(255, 255, 255, 0.2);
}

.map-legend-color-with-data {
    background: #10b981;
}

.map-legend-color-empty {
    background: #ef4444;
}

.map-tooltip.is-visible {
    opacity: 1;
}

.map-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px;
    min-height: 0;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 10px;
    background: rgba(0, 0, 0, 0.015);
}

.map-panel.collapsed {
    display: none;
}

body.dark-mode .map-panel,
[data-bs-theme="dark"] .map-panel {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.map-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.map-panel-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.map-search-toggle {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: inherit;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s ease, border 0.15s ease;
}

body.dark-mode .map-search-toggle,
[data-bs-theme="dark"] .map-search-toggle {
    background: #0d1525;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-search-toggle:hover,
.map-search-toggle:focus-visible {
    background: rgba(75, 123, 255, 0.12);
    border-color: rgba(75, 123, 255, 0.35);
}

.map-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.map-search input {
    flex: 1 1 220px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px 10px;
    font-size: 0.9rem;
    background: #fff;
    color: inherit;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .map-search input,
[data-bs-theme="dark"] .map-search input {
    background: #0d1525;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e9edf5;
}

.map-search input:focus {
    border-color: #4b7bff;
    box-shadow: 0 0 0 3px rgba(75, 123, 255, 0.15);
}

.map-search button {
    border: none;
    background: linear-gradient(120deg, #4b7bff, #6ecbff);
    color: #0b1220;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.map-search button:hover,
.map-search button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(75, 123, 255, 0.3);
}

.map-list {
    background: transparent;
    border-radius: 10px;
    padding: 6px;
    overflow: auto;
}

.map-country-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.map-country-item:hover,
.map-country-item:focus-visible {
    background: rgba(75, 123, 255, 0.12);
    color: #0b1220;
}

body.dark-mode .map-country-item:hover,
body.dark-mode .map-country-item:focus-visible,
[data-bs-theme="dark"] .map-country-item:hover,
[data-bs-theme="dark"] .map-country-item:focus-visible {
    background: rgba(75, 123, 255, 0.2);
    color: #e9edf5;
}

.map-country-name {
    font-weight: 650;
}

.map-country-code {
    font-size: 0.85rem;
    opacity: 0.7;
    text-transform: uppercase;
    margin-left: 8px;
}

.map-badge-quick {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(75, 123, 255, 0.14);
    border-radius: 999px;
    color: #1e293b;
    font-weight: 700;
}

body.dark-mode .map-badge-quick,
[data-bs-theme="dark"] .map-badge-quick {
    background: rgba(110, 203, 255, 0.18);
    color: #e9edf5;
}

.map-empty,
.map-error,
.map-loading {
    padding: 18px;
    text-align: center;
    font-weight: 600;
    color: #5b708f;
}

body.dark-mode .map-empty,
body.dark-mode .map-error,
body.dark-mode .map-loading,
[data-bs-theme="dark"] .map-empty,
[data-bs-theme="dark"] .map-error,
[data-bs-theme="dark"] .map-loading {
    color: #94a3b8;
}

.map-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border-radius: 50%;
    border: 2px solid rgba(75, 123, 255, 0.6);
    border-top-color: transparent;
    animation: mapspin 0.8s linear infinite;
}

@keyframes mapspin {
    to {
        transform: rotate(360deg);
    }
}

.map-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.map-quick-actions button {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: inherit;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, border 0.2s ease;
}

body.dark-mode .map-quick-actions button,
[data-bs-theme="dark"] .map-quick-actions button {
    background: #0d1525;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-quick-actions button:hover,
.map-quick-actions button:focus-visible {
    background: rgba(75, 123, 255, 0.12);
    border-color: rgba(75, 123, 255, 0.35);
}

.map-badge-beta,
.map-beta {
    font-size: 0.68rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 0;
    background: rgba(255, 165, 0, 0.18);
    color: #b25b00;
    font-weight: 800;
    letter-spacing: 0.04em;
}

body.dark-mode .map-badge-beta,
body.dark-mode .map-beta,
[data-bs-theme="dark"] .map-badge-beta,
[data-bs-theme="dark"] .map-beta {
    background: rgba(255, 200, 120, 0.15);
    color: #ffcc70;
}

.map-scroll-lock {
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   THÈME CLAIR (body.light-mode) — Modal Carte du monde
   Palette Dash light : #f5f6f8, #ffffff, #eef0f3, #1a1d21, #4a5568, #b8860b
   ═══════════════════════════════════════════════════════════ */
body.light-mode .map-modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}
body.light-mode .map-modal {
    background: #f5f6f8;
    color: #1a1d21;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.15);
}
body.light-mode .map-modal-header {
    background: #eef0f3;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.light-mode .map-title,
body.light-mode .map-title-text {
    color: #1a1d21;
}
body.light-mode .map-beta {
    background: linear-gradient(120deg, #e6b800, #b8860b);
    color: #1a1d21;
}
body.light-mode .map-view-btn {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #1a1d21;
}
body.light-mode .map-view-btn:hover,
body.light-mode .map-view-btn:focus-visible {
    background: rgba(184, 134, 11, 0.12);
    border-color: rgba(184, 134, 11, 0.4);
    color: #1a1d21;
}
body.light-mode .map-view-btn.is-active {
    background: rgba(184, 134, 11, 0.2);
    border-color: #b8860b;
    color: #1a1d21;
}
body.light-mode .map-dashboard-btn {
    background: linear-gradient(135deg, #b8860b 0%, #a67a0a 100%);
    border: 2px solid #a67a0a;
    color: #ffffff;
}
body.light-mode .map-dashboard-btn:hover,
body.light-mode .map-dashboard-btn:focus-visible {
    background: linear-gradient(135deg, #a67a0a 0%, #966e09 100%);
    border-color: #966e09;
    color: #ffffff;
}
body.light-mode .map-close-btn {
    background: #eef0f3;
    border: 1px solid rgba(184, 134, 11, 0.5);
    color: #1a1d21;
}
body.light-mode .map-close-btn:hover,
body.light-mode .map-close-btn:focus-visible {
    background: #ffcc00;
    color: #000000;
    border-color: #e6b800;
}
body.light-mode .map-modal-body {
    background: #f5f6f8;
    color: #1a1d21;
}
body.light-mode .map-canvas {
    background: radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.02), transparent 45%), #ffffff;
}
body.light-mode .map-svg path,
body.light-mode .map-svg .map-dot {
    fill: #94a3b8;
    stroke: #64748b;
}
body.light-mode .map-svg path:hover,
body.light-mode .map-svg .map-dot:hover,
body.light-mode .map-svg .is-active:not(.map-path-with-data):not(.map-path-empty):not(.map-dot-with-data):not(.map-dot-empty) {
    fill: #b8860b;
    stroke: #a67a0a;
}
body.light-mode .map-tooltip {
    background: #eef0f3;
    color: #1a1d21;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
body.light-mode .map-tooltip-status {
    color: #4a5568;
    border-top-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .map-legend {
    background: rgba(255, 255, 255, 0.98);
    color: #1a1d21;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
body.light-mode .map-legend-title {
    color: #1a1d21;
}
body.light-mode .map-legend-label {
    color: #4a5568;
}
body.light-mode .map-panel {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
body.light-mode .map-search input {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1d21;
}
body.light-mode .map-search input:focus {
    border-color: #b8860b;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.2);
}
body.light-mode .map-search button {
    background: #b8860b;
    color: #ffffff;
}
body.light-mode .map-search button:hover,
body.light-mode .map-search button:focus-visible {
    background: #a67a0a;
    color: #ffffff;
}
body.light-mode .map-country-item:hover,
body.light-mode .map-country-item:focus-visible {
    background: rgba(184, 134, 11, 0.12);
    color: #1a1d21;
}
body.light-mode .map-quick-actions button {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1d21;
}
body.light-mode .map-quick-actions button:hover,
body.light-mode .map-quick-actions button:focus-visible {
    background: rgba(184, 134, 11, 0.12);
    border-color: rgba(184, 134, 11, 0.4);
    color: #1a1d21;
}
body.light-mode .map-empty,
body.light-mode .map-error,
body.light-mode .map-loading {
    color: #4a5568;
}
body.light-mode .map-search-toggle {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1d21;
}
body.light-mode .map-search-toggle:hover,
body.light-mode .map-search-toggle:focus-visible {
    background: rgba(184, 134, 11, 0.1);
    border-color: rgba(184, 134, 11, 0.4);
    color: #1a1d21;
}

@media (max-width: 1199.98px) {
    .header-actions .mappemonde-link {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .map-modal {
        width: 100%;
        max-height: 95vh;
    }

    .map-modal-header {
        gap: 8px;
        flex-wrap: wrap;
    }

    .map-title {
        font-size: 1rem;
    }

    .map-view-toggle {
        order: 3;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-top: 8px;
        justify-content: center;
    }

    .map-view-btn {
        flex: 1;
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .map-modal-body {
        padding: 4px 10px;
    }

    .map-canvas {
        padding: 4px 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   💻 HD (lg) - 992px-1199px - CORRECTION VISIBILITÉ
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 992px) and (max-width: 1199px) {
    .map-modal {
        width: min(90vw, 1400px);
        max-height: min(95vh, 1100px);
    }

    .map-canvas {
        padding: 4px 0;
    }

    .map-svg {
        min-height: 100%;
        height: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   🖥️ FHD (xl) - 1200px-1539px - MAINTENIR FONCTIONNEMENT
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 1200px) and (max-width: 1539px) {
    .map-modal {
        width: min(95vw, 1920px);
        max-height: min(95vh, 1200px);
    }

    .map-canvas {
        min-height: 70vh;
        height: 70vh;
        max-height: 70vh;
    }

    .map-svg {
        min-height: 100%;
        height: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   🖥️ 2K (xxl) - 1540px-2559px - OPTIMISATION GRANDS ÉCRANS
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 1540px) and (max-width: 2559px) {
    .map-modal {
        width: min(95vw, 2000px);
        max-height: min(95vh, 1400px);
    }

    .map-canvas {
        padding: 4px 0;
    }

    .map-svg {
        min-height: 100%;
        height: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   📱 MOBILE/TABLETTE - FORCER FULLSCREEN
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    /* Tablettes - FORCER FULLSCREEN */
    .map-modal-overlay {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    /* Header carte du monde — aligné sur modal dashboard (logo, titre, boutons réduits) */
    .map-modal-overlay .map-mappemonde-header {
        padding: 0.5rem 0.75rem !important;
        padding-right: 8rem !important;
        min-height: 0 !important;
    }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-logo {
        height: 40px !important;
    }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-title {
        font-size: 1.1rem !important;
        padding-bottom: 0.25rem !important;
    }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn,
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn,
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn { right: 10.5rem !important; }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn { right: 7.2rem !important; }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn { right: 3.9rem !important; }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-close {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        right: 0.5rem !important;
    }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn-icon,
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn .dashboard-modal-search-btn-icon,
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn .theme-icon {
        width: 20px !important;
        height: 20px !important;
    }
    .map-modal-overlay .map-mappemonde-header .dashboard-modal-close svg {
        width: 20px !important;
        height: 20px !important;
    }
    [dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-lang-btn { right: auto !important; left: 10.5rem !important; }
    [dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-search-btn { right: auto !important; left: 7.2rem !important; }
    [dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-theme-btn { right: auto !important; left: 3.9rem !important; }
    [dir="rtl"] .map-modal-overlay .map-mappemonde-header .dashboard-modal-close { right: auto !important; left: 0.5rem !important; }
    /* Footer carte du monde — aligné dashboard */
    .map-modal-overlay .map-mappemonde-footer {
        padding: 0.5rem 0.75rem !important;
        gap: 0.5rem 0.75rem !important;
    }
    .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-nav {
        font-size: 0.7rem !important;
        gap: 0 0.35rem !important;
    }
    .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-actions {
        gap: 0.75rem !important;
    }
    .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-back-btn {
        min-width: 5.5rem !important;
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    .map-modal-overlay .map-mappemonde-footer .dashboard-modal-footer-back-btn .dashboard-modal-footer-back-btn-icon {
        width: 14px !important;
        height: 14px !important;
    }
    .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer,
    body.dark-mode .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer,
    body:not(.light-mode) .map-modal-overlay .map-mappemonde-footer .commercify-modal-btn-fermer {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .map-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    .map-modal-body {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    .map-canvas {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        flex: 1 !important;
    }
}

@media (max-width: 575.98px) {
    /* Smartphones - FORCER FULLSCREEN */
    .map-modal-overlay {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    
    .map-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    .map-modal-header {
        padding: 0.5rem 0.75rem !important;
        padding-right: 3.5rem !important;
    }
    
    [dir="rtl"] .map-modal-header {
        padding-right: 0.75rem !important;
        padding-left: 3.5rem !important;
    }
    
    .map-title {
        font-size: 0.9rem !important;
    }
    
    .map-view-btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
    
    .map-dashboard-btn {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        margin-left: 8px !important;
        margin-right: 8px !important;
    }
    
    .map-close-btn {
        top: 0.75rem !important;
        right: 0.75rem !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        font-size: 1.6rem !important;
    }
    
    [dir="rtl"] .map-close-btn {
        right: auto !important;
        left: 0.75rem !important;
    }
    
    .map-modal-body {
        padding: 4px 10px !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    .map-canvas {
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        flex: 1 !important;
        padding: 4px 0 !important;
        border-radius: 8px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   🖥️ 4K - 2560px+ - LIMITATION TAILLE MAXIMALE
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 2560px) {
    .map-modal {
        width: min(95vw, 2400px);
        max-height: min(95vh, 1600px);
    }

    .map-canvas {
        padding: 4px 0;
    }

    .map-svg {
        min-height: 100%;
        height: 100%;
    }
}
