/* ═══════════════════════════════════════════════════════════
   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;
    /* +0.25rem (2026-09-24) : compense le margin:0 -0.25rem du parent .nk-header-wrap (DashLite,
       dashlite.css ~L32655 -- "row" à marge négative dont les enfants directs reçoivent normalement
       padding:0 0.25rem en retour). Notre !important ci-dessus remplaçait ce padding de compensation
       par 10px plat, donc SANS la compenser -- .catalog-header débordait de 4px de chaque côté au-delà
       du vrai bord de la fenêtre (bug rapporté : bouton "CONNEXION" collé à l'ascenseur du navigateur,
       même symptôme que le bouton chatbot corrigé juste avant dans .cfy-vignettes-pre-banner). */
    padding-inline-start: calc(var(--cfy-header-edge-offset, 10px) + 0.25rem) !important;
    padding-inline-end: calc(var(--cfy-header-edge-offset, 10px) + 0.25rem) !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
   ═══════════════════════════════════════════════════════════ */

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

.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 .cfy-header-options-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;
}

/* Style hover pour thème dashlite (fond noir) - mode clair */
.header-actions .cfy-header-options-link:hover,
.header-actions .cfy-header-options-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 .cfy-header-options-link,
.catalog-header[style*="rgb(77, 26, 10)"] .header-actions .cfy-header-options-link,
.catalog-header[style*="rgb(109, 42, 14)"] .header-actions .cfy-header-options-link {
    color: #ffffff !important;
}

.catalog-header[style*="gradient"] .header-actions .cfy-header-options-link:hover,
.catalog-header[style*="gradient"] .header-actions .cfy-header-options-link:focus-visible,
.catalog-header[style*="rgb(77, 26, 10)"] .header-actions .cfy-header-options-link:hover,
.catalog-header[style*="rgb(77, 26, 10)"] .header-actions .cfy-header-options-link:focus-visible,
.catalog-header[style*="rgb(109, 42, 14)"] .header-actions .cfy-header-options-link:hover,
.catalog-header[style*="rgb(109, 42, 14)"] .header-actions .cfy-header-options-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 .cfy-header-options-link,
[data-bs-theme="dark"] .header-actions .cfy-header-options-link {
    color: #e9edf5;
}

body.dark-mode .header-actions .cfy-header-options-link:hover,
body.dark-mode .header-actions .cfy-header-options-link:focus-visible,
[data-bs-theme="dark"] .header-actions .cfy-header-options-link:hover,
[data-bs-theme="dark"] .header-actions .cfy-header-options-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;
}

.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;
}
.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);
    /* 2026-09-24 : l'ancien +1px ici visait à s'aligner sur l'ex-marge de 1px du bouton "Options"
       de la zone catalogue -- cette dernière a été retirée (gap sur le conteneur à la place, voir
       commercify_vignettes_optimized.css/.cfy-sticky-homepage-controls). Plus rien à compenser ici :
       .catalog-header porte déjà le vrai écart de bord (10px, compensé pour le -0.25rem DashLite
       ci-dessus), donc ce bouton (dernier de .header-actions) n'a besoin d'aucune marge de fin. */
}
.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;
    }

    .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;
    }

    /* Masquer Carte du monde sur smartphone et tablette (incluant iPad Mini) */
    .cfy-header-options-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;
    }

    .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 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 Carte du monde sur smartphone et tablette (incluant iPad Mini) */
    .cfy-header-options-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;
    }

    .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 {
        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;
    }

    /* Hover tablettes */
    .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-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 {
        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 {
        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 {
        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 {
        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: var(--cfy-t-backdrop, rgba(0, 0, 0, 0.5));
    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: var(--cfy-t-surface);
    color: var(--cfy-t-ink);
    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;
}


.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;
}
/* Sélecteur de niveau de zoom superposé en haut de la carte (vestige CSS réactivé). */
.map-canvas > .map-view-toggle {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    margin: 0;
    padding: 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
[data-bs-theme="dark"] .map-canvas > .map-view-toggle,
body.dark-mode .map-canvas > .map-view-toggle {
    background: rgba(15, 23, 42, 0.9);
}
.map-canvas > .map-view-toggle .map-view-btn {
    padding: 5px 12px;
    font-size: 0.8rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.map-view-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
/* Vue Pays : polygones admin-1 + marqueurs région/département. Traits non mis à l'échelle
   (vector-effect) pour rester nets quel que soit le zoom du viewBox. */
.map-svg-country .map-path,
.map-svg-country .map-dot {
    vector-effect: non-scaling-stroke;
}
.map-svg-country .map-path {
    stroke-width: 0.75;
}
.map-svg-country .map-path-outline { pointer-events: none; }
.map-svg-country .map-path-aggregated { cursor: pointer; }
.map-canvas-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid var(--cfy-t-line-2);
    border-top-color: var(--cfy-t-accent);
    border-radius: 50%;
    animation: map-spin 0.8s linear infinite;
    z-index: 4;
}
@keyframes map-spin { to { transform: rotate(360deg); } }
.map-canvas-stats-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 7;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    text-align: center;
    padding: 24px;
    background: rgba(247, 249, 252, 0.85);
    pointer-events: none;
}
.map-canvas-stats-overlay.is-visible { display: flex; }
.map-canvas-stats-overlay-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(75, 123, 255, 0.25);
    border-top-color: #4b7bff;
    border-radius: 50%;
    animation: map-spin 0.8s linear infinite;
}
.map-canvas-stats-overlay-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2f6bff;
    max-width: 320px;
}
[data-bs-theme="dark"] .map-canvas-stats-overlay,
body.dark-mode .map-canvas-stats-overlay { background: rgba(15, 23, 42, 0.85); }
[data-bs-theme="dark"] .map-canvas-stats-overlay-text,
body.dark-mode .map-canvas-stats-overlay-text { color: #b9ccff; }
.map-dot-region { stroke: var(--cfy-t-ink-2); stroke-width: 0.6; opacity: 0.95; }
.map-dot-department { stroke: var(--cfy-t-ink-2); stroke-width: 0.4; opacity: 0.9; }
/* Ligne "continent" cliquable du panneau (bouton remis à plat) */
button.map-legend-continent-jump {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 2px 4px;
}
button.map-legend-continent-jump:hover,
button.map-legend-continent-jump:focus-visible {
    background: rgba(75, 123, 255, 0.12);
    outline: none;
}

/* Lignes pays cliquables (Résumé > Top pays, et Tous les pays) -> catalogue du pays.
   Même reset bouton-remis-à-plat que .map-legend-continent-jump. */
button.map-legend-country-jump {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 2px 4px;
}
button.map-legend-country-jump:hover,
button.map-legend-country-jump:focus-visible {
    background: rgba(75, 123, 255, 0.12);
    outline: none;
}
button.map-legend-all-row {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
button.map-legend-all-row:focus-visible {
    outline: 2px solid rgba(75, 123, 255, 0.5);
    outline-offset: -2px;
}

/* Carte d'infos + navigation contextuelle en vue Pays (superposée bas-gauche de la carte).
   Donne accès à TOUS les niveaux de catalogue : pays (bouton), régions (liste). */
.map-country-info {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 6;
    width: min(280px, calc(100% - 24px));
    /* BUGFIX (2026-09-10) : avec 2 listes (régions + départements, jusqu'à ~100 lignes)
       dans ce container flex-column à max-height fixe, flex-shrink répartissait le manque
       d'espace au prorata du contenu total (regList 456px + depList 3167px) -> les deux
       listes s'écrasaient à quelques px de haut (1 ligne visible, tout le reste scrollé et
       invisible). Chaque liste a maintenant son propre plafond fixe (voir
       .map-country-info-reg-list / -dep-list) et ne dépend plus du flex-shrink du parent ;
       le panneau peut aussi grandir davantage et scroller lui-même en dernier recours. */
    max-height: 82%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.97);
    color: #1a1d21;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 10px;
    font-size: 0.82rem;
}
[data-bs-theme="dark"] .map-country-info,
body.dark-mode .map-country-info {
    background: rgba(15, 23, 42, 0.97);
    color: #e9edf5;
}
.map-country-info-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.map-country-info-flag { width: 20px; height: 20px; object-fit: cover; flex: 0 0 auto; }
/* Bouton "voir le catalogue" -- réutilisé pour les 3 niveaux (Monde / Continent / Pays) du bloc
   flottant .map-country-info. Poids visuel volontairement renforcé (bordure épaisse, fond plus
   contrasté, ombre, icône) pour se détacher clairement des lignes région/département juste en
   dessous (.map-country-info-reg / -dep, sans bordure). Vert = action principale/positive
   (convention du site), aucune couleur d'avertissement utilisée par ailleurs dans ce modal. */
.map-country-info-catalog {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin-bottom: 8px;
    border: 2px solid #1f7a4d;
    background: rgba(31, 122, 77, 0.16);
    box-shadow: 0 2px 6px rgba(31, 122, 77, 0.25);
    color: inherit;
    font: inherit;
    font-weight: 700;
    padding: 7px 10px;
    cursor: pointer;
}
.map-country-info-catalog:hover,
.map-country-info-catalog:focus-visible { background: rgba(31, 122, 77, 0.28); outline: none; }
.map-country-info-catalog > strong { font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.map-country-info-catalog-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.map-country-info-catalog-icon { flex: 0 0 auto; }
[data-bs-theme="dark"] .map-country-info-catalog,
body.dark-mode .map-country-info-catalog {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.16);
}
[data-bs-theme="dark"] .map-country-info-catalog:hover,
[data-bs-theme="dark"] .map-country-info-catalog:focus-visible,
body.dark-mode .map-country-info-catalog:hover,
body.dark-mode .map-country-info-catalog:focus-visible {
    background: rgba(52, 211, 153, 0.28);
}
.map-country-info-hint {
    font-size: 0.7rem;
    opacity: 0.65;
    margin: 6px 0 8px;
    line-height: 1.35;
}
.map-country-info-reg-title {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.map-country-info-reg-title span { opacity: 0.6; }
.map-country-info-reg-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    max-height: 190px;
}
.map-country-info-reg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: none;
    border-top: 1px solid rgba(128, 128, 128, 0.16);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 5px 4px;
    cursor: pointer;
}
.map-country-info-reg:first-child { border-top: none; }
.map-country-info-reg:hover,
.map-country-info-reg:focus-visible { background: rgba(75, 123, 255, 0.12); outline: none; }
.map-country-info-reg-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-country-info-reg-ads { font-variant-numeric: tabular-nums; opacity: 0.75; flex: 0 0 auto; }

/* Vues Monde / Continent du bloc flottant : lignes de compteurs (label + valeur). */
.map-country-info-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 6px;
}
.map-country-info-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.78rem;
}
.map-country-info-stat-label { opacity: 0.72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-country-info-stat-value { font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* Liste Départements : classes strictement symétriques à .map-country-info-reg-* ci-dessus. */
.map-country-info-dep-title {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 8px 0 4px;
}
.map-country-info-dep-title span { opacity: 0.6; }
.map-country-info-dep-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    max-height: 190px;
}
.map-country-info-dep {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: none;
    border-top: 1px solid rgba(128, 128, 128, 0.16);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 5px 4px;
    cursor: pointer;
}
.map-country-info-dep:first-child { border-top: none; }
.map-country-info-dep:hover,
.map-country-info-dep:focus-visible { background: rgba(75, 123, 255, 0.12); outline: none; }
.map-country-info-dep-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-country-info-dep-ads { font-variant-numeric: tabular-nums; opacity: 0.75; flex: 0 0 auto; }

/* --- Bords CARRÉS dans toute la modale mappemonde (cohérence avec le chrome existant) --- */
.map-modal-overlay .map-float-search-input,
.map-modal-overlay .map-float-search-results,
.map-modal-overlay .map-view-btn,
.map-modal-overlay .map-canvas > .map-view-toggle,
.map-modal-overlay .map-result-continent,
.map-modal-overlay .map-result-badge,
.map-modal-overlay .map-result-flag,
.map-modal-overlay .map-legend,
.map-modal-overlay .map-legend-tab,
.map-modal-overlay .map-legend-all-filter,
.map-modal-overlay .map-legend-color,
.map-modal-overlay .map-legend-flag,
.map-modal-overlay .map-legend-continent-jump,
.map-modal-overlay .map-tooltip,
.map-modal-overlay .map-country-info,
.map-modal-overlay .map-country-info button {
    border-radius: 0;
}

.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;
}

/* Chevron entre les 3 niveaux Monde/Continent/Pays : rend visible que ce sélecteur EST
   un fil d'Ariane (cohérence visuelle avec .breadcrumb-arrow du catalogue classique),
   sans toucher à la logique de setMapView(). */
.map-view-toggle .map-view-btn + .map-view-btn::before {
    content: "\203A";
    display: inline-block;
    margin-right: 5px;
    opacity: 0.5;
    font-weight: 700;
}

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;
}

/* Vue unique (plus d'onglets) : carte + panneau "Résumé complétude" côte à côte. */
.map-modal-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    overflow: hidden;
}
.map-modal-main .map-canvas {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 200px;
}

/* En dessous d'une certaine largeur, le panneau résumé passe sous la carte plutôt qu'à côté */
@media (max-width: 780px) {
    .map-modal-main {
        flex-direction: column;
    }
    .map-modal-main .map-canvas {
        min-height: 260px;
    }
}

/* Sélecteur hybride flottant (pays / régions / départements / villes) : superposé en coin de
   la carte, masqué par défaut, n'ouvre un dropdown d'options riches que si l'utilisateur tape.
   Élargi vs l'ancienne mini-recherche pays pour loger CONTINENT · drapeau · code · nom + une
   2e ligne de contexte (pays · région · département · code postal). */
.map-float-search {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    width: min(460px, calc(100% - 24px));
}
.map-float-search-input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
    color: #0e1525;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    outline: none;
}
.map-float-search-input:focus {
    border-color: #4b7bff;
    box-shadow: 0 0 0 3px rgba(75, 123, 255, 0.25);
}
body.dark-mode .map-float-search-input,
[data-bs-theme="dark"] .map-float-search-input {
    background: rgba(15, 23, 42, 0.95);
    color: #e9edf5;
    border-color: rgba(255, 255, 255, 0.15);
}
body.light-mode .map-float-search-input {
    background: #ffffff;
    color: #1a1d21;
    border-color: rgba(0, 0, 0, 0.12);
}
body.light-mode .map-float-search-input::placeholder {
    color: #6b7280;
}
body.light-mode .map-float-search-input:focus {
    border-color: #b8860b;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.2);
}
.map-float-search-results {
    display: none;
    flex-direction: column;
    margin-top: 6px;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.98);
    color: #0e1525;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.map-float-search-results.is-visible {
    display: flex;
}
body.dark-mode .map-float-search-results,
[data-bs-theme="dark"] .map-float-search-results {
    background: rgba(15, 23, 42, 0.98);
    color: #e9edf5;
}
body.light-mode .map-float-search-results {
    background: rgba(255, 255, 255, 0.98);
    color: #0e1525;
}
.map-float-search-results .map-country-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0.5rem 0.85rem;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}
.map-float-search-results .map-country-item:hover,
.map-float-search-results .map-country-item:focus-visible {
    background: rgba(75, 123, 255, 0.12);
    outline: none;
}
.map-float-search-results .map-country-code {
    opacity: 0.6;
    font-size: 0.8em;
}
.map-float-search-results .map-empty {
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --- Options du sélecteur hybride --- */
.map-result-group-title {
    position: sticky;
    top: 0;
    padding: 0.4rem 0.85rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.55;
    background: inherit;
    z-index: 1;
}
.map-result-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 0.5rem 0.85rem;
    border: none;
    border-top: 1px solid rgba(128, 128, 128, 0.14);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.map-result-group-title + .map-result-row {
    border-top: none;
}
.map-result-row:hover,
.map-result-row:focus-visible {
    background: rgba(75, 123, 255, 0.14);
    outline: none;
}
.map-result-line1 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.85rem;
    line-height: 1.2;
}
.map-result-continent {
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(128, 128, 128, 0.18);
}
.map-result-flag {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    flex: 0 0 auto;
}
.map-result-code {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.7;
    text-transform: uppercase;
}
.map-result-name {
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.map-result-badge {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.64rem;
    font-weight: 600;
    background: rgba(75, 123, 255, 0.18);
    color: #2f6bff;
    flex: 0 0 auto;
}
.map-result-count {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
    background: rgba(40, 167, 69, 0.16);
    color: #1e7e34;
}
/* Zero annonce : ton neutre (le vert ne doit signaler que de la disponibilite). */
.map-result-count.is-zero {
    background: rgba(128, 128, 128, 0.16);
    color: #6b7280;
    font-weight: 600;
}
.map-result-context {
    font-size: 0.74rem;
    opacity: 0.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.map-result-hint {
    padding: 0.5rem 0.85rem;
    font-size: 0.76rem;
    opacity: 0.55;
    font-style: italic;
}
/* Couleurs de texte EXPLICITES pour le sélecteur (3 états de thème). L'overlay reflète
   désormais le vrai thème (data-bs-theme dynamique côté JS) donc la cascade est saine,
   mais on ne laisse plus aucun texte en `inherit` seul — leçon des rondes précédentes :
   tout texte de sélecteur/légende a besoin d'un ton dark ET d'un override clair explicites. */
.map-result-name { color: #0e1525; }
.map-result-continent,
.map-result-code,
.map-result-context,
.map-result-group-title { color: #3a4353; }

[data-bs-theme="dark"] .map-result-name,
body.dark-mode .map-result-name { color: #e9edf5; }
[data-bs-theme="dark"] .map-result-continent,
[data-bs-theme="dark"] .map-result-code,
[data-bs-theme="dark"] .map-result-context,
[data-bs-theme="dark"] .map-result-group-title,
body.dark-mode .map-result-continent,
body.dark-mode .map-result-code,
body.dark-mode .map-result-context,
body.dark-mode .map-result-group-title { color: #b8c2d6; }

[data-bs-theme="dark"] .map-result-badge,
body.dark-mode .map-result-badge {
    background: rgba(120, 160, 255, 0.22);
    color: #b9ccff;
}
[data-bs-theme="dark"] .map-result-count,
body.dark-mode .map-result-count {
    background: rgba(80, 200, 120, 0.20);
    color: #8ee0a6;
}
[data-bs-theme="dark"] .map-result-count.is-zero,
body.dark-mode .map-result-count.is-zero {
    background: rgba(128, 128, 128, 0.22);
    color: #9aa4b2;
}
body.light-mode .map-result-name { color: #1a1d21; }
body.light-mode .map-result-continent,
body.light-mode .map-result-code,
body.light-mode .map-result-context,
body.light-mode .map-result-group-title { color: #4a5568; }
body.light-mode .map-result-row:hover,
body.light-mode .map-result-row:focus-visible {
    background: rgba(184, 134, 11, 0.1);
}
body.light-mode .map-result-continent {
    background: rgba(0, 0, 0, 0.07);
}
body.light-mode .map-result-badge {
    background: rgba(184, 134, 11, 0.16);
    color: #8a6508;
}
body.light-mode .map-result-count {
    background: rgba(40, 167, 69, 0.14);
    color: #1e7e34;
}
body.light-mode .map-result-count.is-zero {
    background: rgba(0, 0, 0, 0.06);
    color: #6b7280;
}

/* 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;
}
/* Mêmes marges que l'en-tête et le pied du tableau de bord (la règle d'espacement générique des modales passait devant) */
html body .map-modal-overlay .map-mappemonde-header .dashboard-modal-logo-link {
    justify-self: start !important;
    width: max-content !important;
}
@media (min-width: 768px) and (max-width: 991.98px) {
    html body .map-modal-overlay .dashboard-modal-footer.map-mappemonde-footer {
        padding: 0.5rem 0.75rem !important;
    }
}
@media (min-width: 992px) {
    html body .map-modal-overlay .dashboard-modal-header.map-mappemonde-header {
        padding-top: 22px !important;
        padding-bottom: 22px !important;
    }
    html body .map-modal-overlay .dashboard-modal-footer.map-mappemonde-footer {
        padding: 12px 20px !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;
}
/* 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 (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-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-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: var(--cfy-t-surface-2);
    border-radius: 0;
    padding: 4px 0;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden;
    flex: 1 1 auto !important;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

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


.map-svg {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

/* Pan (glisser-déposer) du SVG mappemonde -- démarre uniquement dans le vide du SVG. */
.map-canvas.is-dragging .map-svg {
    will-change: transform;
}
.map-canvas.is-dragging {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}
.map-canvas.is-dragging .map-svg,
.map-canvas.is-dragging .map-svg path,
.map-canvas.is-dragging .map-svg .map-dot {
    cursor: grabbing !important;
}

/* Tracés : aucun calque ni transition par pays (plusieurs centaines d'éléments). Couleurs par
   niveau d'activité (data-lvl 0 à 5), dérivées du thème actif : voir « Carte du monde — thème ». */
.map-svg path,
.map-svg .map-dot {
    fill: var(--cfy-t-surface-3);
    stroke: var(--cfy-t-line-2);
    stroke-width: 0.4;
    cursor: pointer;
}

.map-tooltip {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: 0;
    padding: 10px 14px;
    border-radius: 0;
    background: var(--cfy-t-surface);
    color: var(--cfy-t-ink);
    border: 1px solid var(--cfy-t-line);
    font-size: 0.9rem;
    opacity: 0;
    /* Au-dessus des panneaux superposés (recherche, niveaux, infos) : jamais masquée en haut de carte. */
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    max-width: 260px;
    /* Position posée par script (transform), jamais par left/top. */
}

.map-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--cfy-t-line);
}

.map-tooltip-flag {
    width: 22px;
    height: 22px;
    border-radius: 0;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--cfy-t-line);
}

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

.map-tooltip-code {
    opacity: 0.7;
    font-size: 0.85em;
    font-weight: 400;
}

.map-tooltip-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.map-tooltip-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8rem;
}

.map-tooltip-stat-label {
    color: var(--cfy-t-muted);
}

.map-tooltip-stat-value {
    font-weight: 600;
    color: var(--cfy-t-ink);
}

/* Panneau "Résumé complétude" : sidebar permanente en bordure droite de la modale
   (remplace l'ancien onglet "Complétude" + sa légende flottante hardcodée). */
.map-legend {
    position: static;
    flex: 0 0 280px;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Mini-onglets internes au panneau ("Résumé" / "Tous les pays") -- pas les onglets
   principaux du modal (supprimés), juste 2 vues à l'intérieur de ce panneau. */
.map-legend-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.map-legend-tab {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.75;
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.map-legend-tab:hover {
    opacity: 1;
    background: rgba(75, 123, 255, 0.1);
}

.map-legend-tab.active {
    opacity: 1;
    background: rgba(75, 123, 255, 0.16);
    border-color: rgba(75, 123, 255, 0.4);
    color: #2563eb;
}

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

body.dark-mode .map-legend-tab.active,
[data-bs-theme="dark"] .map-legend-tab.active {
    background: rgba(75, 123, 255, 0.25);
    border-color: rgba(75, 123, 255, 0.5);
    color: #8fb4ff;
}

.map-legend-view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Vue "Tous les pays" : filtre + liste complète scrollable des 250 pays. */
.map-legend-all-filter {
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.65rem;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    color: inherit;
    font-size: 0.8rem;
    outline: none;
}

.map-legend-all-filter:focus {
    border-color: #4b7bff;
    box-shadow: 0 0 0 2px rgba(75, 123, 255, 0.2);
}

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

.map-legend-all-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-legend-all-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 0.78rem;
}

.map-legend-all-row:hover {
    background: rgba(75, 123, 255, 0.08);
}

.map-legend-all-row .map-legend-color {
    margin-top: 3px;
}

.map-legend-all-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.map-legend-all-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-legend-all-code {
    font-weight: 400;
    opacity: 0.6;
    font-size: 0.9em;
}

.map-legend-all-sub {
    font-size: 0.72rem;
    opacity: 0.65;
}

.map-legend-all-count {
    flex-shrink: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}

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

@media (max-width: 780px) {
    .map-legend {
        flex: 0 0 auto;
        max-width: none;
        max-height: 220px;
    }
}

.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;
    gap: 8px;
}

.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: #2563eb;
}

.map-legend-loading {
    position: relative;
}
.map-legend-loading::before {
    content: attr(data-loading-label);
    display: block;
    margin: 0 0 10px;
    padding: 7px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    background: rgba(75, 123, 255, 0.12);
    color: #2f6bff;
}
[data-bs-theme="dark"] .map-legend-loading::before,
body.dark-mode .map-legend-loading::before {
    background: rgba(120, 160, 255, 0.16);
    color: #b9ccff;
}

/* --- Panneau "Résumé complétude" unifié (Résumé / Tous les pays / continents) --- */
.map-legend-scopenote {
    font-size: 0.72rem;
    font-style: italic;
    color: #64748b;
    margin: -2px 0 8px;
}
[data-bs-theme="dark"] .map-legend-scopenote,
body.dark-mode .map-legend-scopenote {
    color: #94a3b8;
}
.map-legend-group-title {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0b1220;
    margin-top: 12px;
    margin-bottom: 6px;
}
[data-bs-theme="dark"] .map-legend-group-title,
body.dark-mode .map-legend-group-title {
    color: #e9edf5;
}
.map-legend-group-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}
.map-legend-group-title-row > span:first-child {
    flex: 0 1 auto;
}
.map-legend-group-meta {
    font-weight: 500;
    font-size: 0.66rem;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
    text-align: right;
    flex: 1 1 auto;
    white-space: normal;
}
.map-legend-stat > strong {
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
    white-space: nowrap;
    flex: 0 0 auto;
}
.map-legend-stat .map-legend-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.map-legend-stat .map-legend-label .map-legend-color {
    width: 11px;
    height: 11px;
}
.map-legend-stat-2l .map-legend-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    line-height: 1.25;
}
.map-legend-sublabel {
    font-size: 0.68rem;
    opacity: 0.65;
}

/* Répartition par continent : chaque continent est un bloc bien séparé (nom en évidence,
   filet de séparation entre continents), pas une liste en retrait. */
button.map-legend-continent-jump {
    padding: 7px 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.14);
}
button.map-legend-continent-jump:first-of-type {
    border-top: none;
}
[data-bs-theme="dark"] button.map-legend-continent-jump,
body.dark-mode button.map-legend-continent-jump {
    border-top-color: rgba(255, 255, 255, 0.16);
}
.map-legend-continent-jump .map-legend-label {
    font-weight: 700;
    font-size: 0.86rem;
}
.map-legend-continent-jump .map-legend-sublabel {
    font-weight: 500;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.map-legend-continent-jump > strong {
    align-self: center;
}

.map-legend-top-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 4px;
}

.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-top-count {
    margin-left: auto;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

/* Répartition par continent (panneau "Résumé complétude", affichage passif) */
.map-legend-continents {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.map-legend-continent-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
}
.map-legend-continent-name {
    font-weight: 600;
}
.map-legend-continent-meta {
    margin-left: auto;
    opacity: 0.7;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

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

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

/* Drapeau pays des onglets "Résumé" (top pays) et "Tous les pays" -- même image/cache/repli
   que .map-result-flag (buildFlagImgHtml), taille dédiée un peu plus petite pour s'aligner sur
   le pastille couleur 14px et le texte 0.72-0.86rem de ces deux listes plutôt que la taille
   18-22px déjà utilisée dans le panneau pays / les résultats de recherche du modal. */
.map-legend-flag {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    flex: 0 0 auto;
}

.map-legend-all-row .map-legend-flag {
    margin-top: 2px;
}

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

/* Infobulle cliquable (pays, région, département) : un clic ouvre le catalogue de la zone. */
.map-tooltip.is-visible.is-link {
    pointer-events: auto;
    cursor: pointer;
}
.map-tooltip-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--cfy-t-line);
    color: var(--cfy-t-accent);
    font-size: var(--cfy-fs-sm);
    font-weight: var(--cfy-fw-semibold);
}
.map-tooltip-cta[hidden] {
    display: none;
}
.map-tooltip-cta-ic {
    flex-shrink: 0;
}
.map-tooltip.is-link:hover {
    outline: 1px solid var(--cfy-t-accent);
    outline-offset: -1px;
}
.map-tooltip.is-link:hover .map-tooltip-cta {
    text-decoration: underline;
}

.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-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-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-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-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-legend-tab {
    border-color: rgba(0, 0, 0, 0.12);
}
body.light-mode .map-legend-tab.active {
    background: rgba(184, 134, 11, 0.14);
    border-color: rgba(184, 134, 11, 0.45);
    color: #8a6508;
}
body.light-mode .map-legend-all-filter {
    border-color: rgba(0, 0, 0, 0.12);
    background: #ffffff;
}
body.light-mode .map-legend-all-filter:focus {
    border-color: #b8860b;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.2);
}
body.light-mode .map-legend-all-row:hover {
    background: rgba(184, 134, 11, 0.1);
}
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-empty,
body.light-mode .map-error,
body.light-mode .map-loading {
    color: #4a5568;
}

@media (max-width: 1199.98px) {
    .header-actions .cfy-header-options-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%;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════
   Carte du monde — thème
   Choroplèthe : 6 niveaux d'activité (data-lvl 0 à 5) dérivés de l'accent du thème actif (contraste
   garanti sur les surfaces), mêlé à la surface ; suit le mode clair/sombre et la bascule de thème
   sans nouveau rendu.
   ═══════════════════════════════════════════════════════════════════════════════════════════ */
.map-modal-overlay [hidden] {
    display: none !important;
}
.map-svg [data-lvl="0"] { fill: var(--cfy-t-surface-3); }
.map-svg [data-lvl="1"] { fill: color-mix(in srgb, var(--cfy-t-accent) 18%, var(--cfy-t-surface-3)); }
.map-svg [data-lvl="2"] { fill: color-mix(in srgb, var(--cfy-t-accent) 36%, var(--cfy-t-surface-3)); }
.map-svg [data-lvl="3"] { fill: color-mix(in srgb, var(--cfy-t-accent) 56%, var(--cfy-t-surface-3)); }
.map-svg [data-lvl="4"] { fill: color-mix(in srgb, var(--cfy-t-accent) 78%, var(--cfy-t-surface-3)); }
.map-svg [data-lvl="5"] { fill: var(--cfy-t-accent); }
.map-svg .map-path-nodata {
    fill: color-mix(in srgb, var(--cfy-t-line) 55%, var(--cfy-t-surface-2));
}
.map-svg .map-path-outline {
    fill: color-mix(in srgb, var(--cfy-t-line) 35%, transparent);
}
/* Survol : une seule forme à la fois, accent mêlé d'encre (distinct du niveau 5) + contour d'encre. */
.map-svg .map-path:hover,
.map-svg .map-dot:hover,
.map-svg .is-active {
    fill: color-mix(in srgb, var(--cfy-t-accent) 50%, var(--cfy-t-ink));
    stroke: var(--cfy-t-ink);
    stroke-width: 0.8;
}

/* Effets complémentaires (neutralisés en mode performance) : fondu de couleur au survol,
   halo sur la seule forme survolée, ombre et fondu de l'infobulle, océan légèrement teinté. */
.map-svg .map-path,
.map-svg .map-dot {
    transition: fill 140ms ease, stroke 140ms ease;
}
.map-svg .map-path:hover,
.map-svg .map-dot:hover,
.map-svg .is-active {
    filter: drop-shadow(0 0 2.5px rgba(var(--cfy-t-accent-rgb), 0.75));
}
.map-tooltip {
    box-shadow: var(--cfy-t-shadow);
    transition: opacity 120ms ease;
}
.map-modal .map-canvas .map-zoom-btn {
    box-shadow: var(--cfy-t-shadow);
}
.map-canvas {
    background-image: radial-gradient(circle at 30% 25%, rgba(var(--cfy-t-accent-rgb), 0.09), transparent 60%);
}

/* Carte ouverte (fenêtre opaque plein écran) : la page dessous n'est plus restylée, peinte ni
   découpée en calques. Sa taille rendue est mémorisée (contain-intrinsic-size auto) : la hauteur
   du document et la position de défilement restent inchangées à la fermeture. */
.nk-main > :not(.nk-wrap),
.nk-wrap > :not(#mappemonde) {
    contain-intrinsic-size: auto none;
}
body.modal-mappemonde-open .nk-main > :not(.nk-wrap),
body.modal-mappemonde-open .nk-wrap > :not(#mappemonde) {
    content-visibility: hidden;
}
