/* TopBar IVC - Strict réplique maquette */

.vigicrecy-topbar {
    background: var(--topbar-bg);
    padding: var(--topbar-padding) 0;
    position: relative;
    z-index: 100000;
}

.topbar-container {
    max-width: var(--topbar-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 var(--topbar-padding-h);
    height: var(--topbar-height);
}

/* Phrase prend espace disponible */
.topbar-phrase {
    flex: 1;
}

/* Badge IVC */
.topbar-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--topbar-badge-bg);
    padding: 4px 12px;
    border-radius: 50px;
    white-space: nowrap;
    height: 36px;
}

/* Contour coloré selon zone */
.vigicrecy-topbar[data-zone="tranquille"] .topbar-badge {
    border: 3px solid #28D761;
}

.vigicrecy-topbar[data-zone="vigilance"] .topbar-badge {
    border: 3px solid #FFFF00;
}

.vigicrecy-topbar[data-zone="alerte"] .topbar-badge {
    border: 3px solid #FFAA00;
}

.vigicrecy-topbar[data-zone="critique"] .topbar-badge {
    border: 3px solid #FF0000;
}

.badge-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vigicrecy-topbar[data-zone="tranquille"] .badge-dot {
    background: #28D761;
}

.vigicrecy-topbar[data-zone="vigilance"] .badge-dot {
    background: #FFFF00;
    box-shadow: 0 0 0 1px #B8960C;
}

.vigicrecy-topbar[data-zone="alerte"] .badge-dot {
    background: #FFAA00;
}

.vigicrecy-topbar[data-zone="critique"] .badge-dot {
    background: #FF0000;
}

.badge-label {
    color: #333;
    font-size: 15px;
    font-weight: 700;
    /* Visible en desktop */
}

.badge-value {
    font-size: 18px;
    font-weight: 700;
    padding: 0;
    background: none;
    border-radius: 0;
}

/* Valeur prend couleur de la zone */
.vigicrecy-topbar[data-zone="tranquille"] .badge-value {
    color: #28D761;
}

.vigicrecy-topbar[data-zone="vigilance"] .badge-value {
    color: #FFFF00;
    text-shadow: 1px 0 0 #B8960C, -1px 0 0 #B8960C, 0 1px 0 #B8960C, 0 -1px 0 #B8960C;
}

.vigicrecy-topbar[data-zone="alerte"] .badge-value {
    color: #FFAA00;
}

.vigicrecy-topbar[data-zone="critique"] .badge-value {
    color: #FF0000;
}

/* Phrase dynamique */
.topbar-phrase {
    flex: 1;
    background: linear-gradient(90deg, var(--text-gradient-start), var(--text-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mode défilement */
.vigicrecy-topbar.scroll-mode .topbar-phrase {
    display: flex;
    white-space: nowrap;
    overflow: hidden;
    line-height: var(--topbar-height);
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

.vigicrecy-topbar.scroll-mode .topbar-phrase span {
    display: inline-block;
    padding-right: var(--text-scroll-gap);
    animation: scroll-seamless 20s linear infinite;
}

/* Pause au survol pour permettre la lecture */
.vigicrecy-topbar.scroll-mode .topbar-phrase:hover span {
    animation-play-state: paused;
}

/* Dupliquer pour scroll sans fin */
.vigicrecy-topbar.scroll-mode .topbar-phrase span::after {
    content: "\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0" attr(data-text);
    padding-right: var(--text-scroll-gap);
}

@keyframes scroll-seamless {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.topbar-phrase-mobile {
    display: none;
}

/* Pictos — conteneur externe (NE PAS couper les tooltips qui dépassent en bas) */
.topbar-pictos {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    overflow: visible;
    transition: max-width 0.3s ease, opacity 0.3s ease, gap 0.3s ease, margin 0.3s ease;
    max-width: 600px; /* desktop : assez grand pour 6 pictos */
    opacity: 1;
}

/* État replié : pictos cachés individuellement (pas de clipping du conteneur) */
.topbar-pictos.collapsed {
    max-width: 0;
    gap: 0;
    margin: 0;
}
.topbar-pictos.collapsed .topbar-picto {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    pointer-events: none;
}
.topbar-picto {
    transition: max-width 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

/* Bouton toggle pictos */
.topbar-pictos-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: #ffffff;
    padding: 0 10px;
    height: 32px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.topbar-pictos-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}
.topbar-pictos-toggle .toggle-arrow {
    font-size: 10px;
    display: inline-block;
    transition: transform 0.3s;
    line-height: 1;
}
.topbar-pictos-toggle.collapsed .toggle-arrow {
    transform: rotate(-180deg);
}

.topbar-picto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.topbar-picto img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Drop-shadow uniquement sur les pictos nuages noirs via sélecteur attribut */
.topbar-picto img[src*="nuages-noirs"] {
    filter: drop-shadow(0 0 1px rgba(255,255,255,0.9)) drop-shadow(0 0 6px rgba(255,255,255,0.6));
}

.topbar-picto[data-type="lune"] img {
    width: 24px;
    height: 24px;
}

.picto-label {
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
}

/* Valeur affichée sous le picto (pression atmosphérique sous Météo) */
.picto-value {
    font-size: 10px;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    line-height: 1.2;
}

/* Tooltips */
.topbar-badge,
.topbar-picto {
    position: relative;
    cursor: pointer;
}

.topbar-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #333;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-top: 8px;
    z-index: 999999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.topbar-badge .topbar-tooltip {
    border: 2px solid;
    white-space: normal;
    min-width: 280px;
    max-width: 320px;
    text-align: justify;
}

.vigicrecy-topbar[data-zone="tranquille"] .topbar-badge .topbar-tooltip {
    border-color: #28D761;
}

.vigicrecy-topbar[data-zone="vigilance"] .topbar-badge .topbar-tooltip {
    border-color: #FFFF00;
}

.vigicrecy-topbar[data-zone="alerte"] .topbar-badge .topbar-tooltip {
    border-color: #FFAA00;
}

.vigicrecy-topbar[data-zone="critique"] .topbar-badge .topbar-tooltip {
    border-color: #FF0000;
}

.topbar-badge:hover .topbar-tooltip,
.topbar-picto:hover .topbar-tooltip {
    opacity: 1;
}

/* Bouton */
.topbar-button {
    background: linear-gradient(135deg, #00d9c0, #00b8a9);
    color: #fff;
    padding: 0 12px;
    height: 36px;
    line-height: 36px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: transform 0.2s;
    display: inline-block;
}

.topbar-button:hover {
    transform: scale(1.05);
    color: #fff;
}

/* Groupe boutons droite */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: -14px; /* rapproche du picto Lune */
}

/* Bouton Lune toggle */
.topbar-btn-lune {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 100px;
    color: #fff;
    font-size: 15px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.topbar-btn-lune:hover {
    border-color: rgba(255,255,255,0.6);
}
.topbar-btn-lune.lune-hidden {
    opacity: 0.35;
}

/* Badge cliquable */
#topbar-badge-ivc {
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

#topbar-badge-ivc:hover {
    transform: scale(1.02);
}

/* Tooltip badge au hover SAUF si modal ouverte */
#topbar-badge-ivc:not(.modal-open):hover .topbar-tooltip {
    opacity: 1;
}

/* Modal zones */
.topbar-zone-modal {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #fff;
    border: 2px solid;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 99999;
    min-width: 320px;
    max-width: 380px;
}

.vigicrecy-topbar[data-zone="tranquille"] .topbar-zone-modal {
    border-color: #28D761;
}

.vigicrecy-topbar[data-zone="vigilance"] .topbar-zone-modal {
    border-color: #FFFF00;
}

.vigicrecy-topbar[data-zone="alerte"] .topbar-zone-modal {
    border-color: #FFAA00;
}

.vigicrecy-topbar[data-zone="critique"] .topbar-zone-modal {
    border-color: #FF0000;
}

.zone-modal-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zone-modal-header strong {
    color: #333;
    font-size: 14px;
}

.zone-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 20px;
    transition: color 0.2s;
}

.zone-modal-close:hover {
    color: #333;
}

.zone-modal-body {
    padding: 8px 0;
    max-height: 600px; /* Augmenté pour 6 zones sans scroll */
    overflow-y: auto;
    overflow-x: visible;
}

/* Masquer scrollbar mais garder scroll */
.zone-modal-body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.zone-modal-body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.zone-option {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

.zone-option:hover {
    background: #f8f9fa;
}

/* Fond coloré selon IVC actuel */
.vigicrecy-topbar[data-zone="tranquille"] .zone-option.active {
    background: rgba(40, 215, 97, 0.1);
    border-left-color: #28D761;
}

.vigicrecy-topbar[data-zone="vigilance"] .zone-option.active {
    background: rgba(255, 255, 0, 0.1);
    border-left-color: #FFFF00;
}

.vigicrecy-topbar[data-zone="alerte"] .zone-option.active {
    background: rgba(255, 170, 0, 0.1);
    border-left-color: #FFAA00;
}

.vigicrecy-topbar[data-zone="critique"] .zone-option.active {
    background: rgba(255, 0, 0, 0.1);
    border-left-color: #FF0000;
}

.zone-icon {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #ccc;
    flex-shrink: 0;
}

/* Triangle plein coloré selon IVC pour zone active */
.vigicrecy-topbar[data-zone="tranquille"] .zone-option.active .zone-icon {
    border-left-color: #28D761;
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}

.vigicrecy-topbar[data-zone="vigilance"] .zone-option.active .zone-icon {
    border-left-color: #FFFF00;
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}

.vigicrecy-topbar[data-zone="alerte"] .zone-option.active .zone-icon {
    border-left-color: #FFAA00;
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}

.vigicrecy-topbar[data-zone="critique"] .zone-option.active .zone-icon {
    border-left-color: #FF0000;
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}

.zone-name {
    flex: 1;
    color: #333;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
}

.zone-communes {
    font-size: 10px;
    color: #999;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

.zone-river {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-left: 8px;
    text-align: right;
    line-height: 1.4;
    min-width: 100px; /* Largeur min pour colonne droite */
}

/* Info-bulle communes au survol */
.zone-option {
    position: relative;
}

.zone-communes-tooltip {
    position: absolute;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    display: flex;
    gap: 16px;
    min-width: 260px;
}

/* Tooltip vers le bas (GM : zones en haut de liste) */
.zone-communes-tooltip.tooltip-down {
    top: 100%;
    margin-top: 5px;
    bottom: auto;
}

/* Tooltip vers le haut (PM : zones en bas de liste) */
.zone-communes-tooltip.tooltip-up {
    bottom: 100%;
    margin-bottom: 5px;
    top: auto;
}

.zone-option:hover .zone-communes-tooltip {
    opacity: 1;
}

/* Chaque colonne */
.communes-col {
    flex: 1;
    min-width: 0;
}

.communes-col strong {
    display: block;
    font-size: 11px;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.communes-col-traversees strong { color: #3582C4; }
.communes-col-riveraines strong { color: #21CDC0; }

.communes-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 11px;
    color: #555;
    line-height: 1.7;
}

.communes-col-traversees li::before {
    content: "• ";
    color: #3582C4;
    font-weight: bold;
}

.communes-col-riveraines li::before {
    content: "• ";
    color: #21CDC0;
    font-weight: bold;
}

/* ========== RESPONSIVE ========== */

/* Tablette */
@media (max-width: 1024px) {
    .topbar-container {
        gap: 15px;
    }
    
    .topbar-phrase {
        font-size: 14px;
    }
    
    .topbar-pictos {
        gap: 10px;
    }
}

/* Mobile */
@media (max-width: 900px) {
    .vigicrecy-topbar {
        padding-bottom: 3px;
        overflow: visible;
    }
    
    /* Désactiver scroll en mobile */
    .vigicrecy-topbar.scroll-mode .topbar-phrase {
        display: none !important;
    }
    
    .topbar-container {
        height: auto;
        padding: 8px 12px;
        justify-content: space-between;
    }
    
    /* Badge compact */
    .topbar-badge {
        order: 1;
        padding: 3px 8px;
        gap: 6px;
        height: 32px;
        flex: 0 0 auto;
        min-width: 80px;
    }
    
    .topbar-badge .topbar-tooltip {
        left: 0;
        transform: none;
        max-width: calc(100vw - 40px);
        font-size: 12px;
    }
    
    .badge-label {
        font-size: 13px;
    }
    
    .badge-label::after {
        content: " IVC";
    }
    
    /* Cacher "Indice" en mobile */
    .topbar-badge .badge-label {
        font-size: 0;
    }
    
    .badge-label::after {
        font-size: 13px;
    }
    
    .badge-dot {
        width: 18px;
        height: 18px;
    }
    
    .badge-value {
        font-size: 16px;
        padding: 0;
    }
    
    /* Pictos au centre */
    .topbar-pictos {
        order: 2;
        flex: 1;
        justify-content: center;
        gap: 6px;
        max-width: 100%;
    }

    /* État replié en mobile : pictos masqués + flex remis à 0 */
    .topbar-pictos.collapsed {
        flex: 0 0 0;
        max-width: 0;
        gap: 0;
        margin: 0;
    }

    /* Bouton toggle "▾ Météo" : caché en mobile (les pictos prennent toute leur place) */
    .topbar-pictos-toggle {
        display: none !important;
    }

    /* Actions (bouton Signaler) à droite en mobile */
    .topbar-actions {
        order: 3;
        flex: 0 0 auto;
        margin-left: 0 !important;
        gap: 0;
    }

    /* Bouton compact */
    .topbar-button {
        padding: 0 8px;
        height: 32px;
        line-height: 32px;
        font-size: 10px;
        flex: 0 0 auto;
        min-width: 75px;
        text-align: center;
    }
    
    /* Texte court mobile */
    .topbar-button::after {
        content: "Signaler";
    }
    
    .topbar-button {
        font-size: 0;
    }
    
    .topbar-button::after {
        font-size: 10px;
    }
    
    /* Phrase en dessous */
    .topbar-phrase {
        display: none;
    }
    
    /* Modal zones responsive mobile */
    .topbar-zone-modal {
        left: 12px;
        right: 12px;
        max-width: calc(100vw - 24px);
    }
    
    .topbar-phrase-mobile {
        display: flex !important;
        align-items: center;
        text-align: left;
        padding: 4px 0;
        color: var(--text-gradient-start, #24d9c6);
        font-size: 13px;
        font-weight: 400;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        height: 22px;
    }
    .topbar-phrase-mobile span {
        display: inline-block;
        padding-right: var(--text-scroll-gap, 60px);
        animation: scroll-seamless 20s linear infinite;
    }
    /* Dupliquer pour scroll sans fin */
    .topbar-phrase-mobile span::after {
        content: "\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0" attr(data-text);
        padding-right: var(--text-scroll-gap, 60px);
    }
    /* Pause au touch */
    .topbar-phrase-mobile:active span,
    .topbar-phrase-mobile:hover span {
        animation-play-state: paused;
    }
    
    /* Tooltips température et lune : calés bord droit en mobile */
    .topbar-picto[data-type="temperature"] .topbar-tooltip,
    .topbar-picto[data-type="lune"] .topbar-tooltip {
        left: auto;
        right: 0;
        transform: none;
    }

    /* Pictos sans lune + PLUS GROS */
    .topbar-picto[data-type="lune"] {
        display: none;
    }
    
    /* Bouton lune caché en mobile */
    .topbar-btn-lune {
        display: none;
    }
    
    .topbar-picto img {
        width: 40px;
        height: 40px;
        /* filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)) drop-shadow(0 0 6px rgba(255,255,255,0.6)); */
    }
    
    .picto-label {
        display: none;
    }
    
    .picto-value {
        display: none;
    }
    
    /* Bouton compact même largeur que badge */
    .topbar-button {
        padding: 0 10px;
        height: 32px;
        line-height: 32px;
        font-size: 11px;
        flex: 0 0 auto;
        min-width: 90px;
        text-align: center;
    }
    
    /* Texte court mobile */
    .topbar-button::after {
        content: "Signaler";
    }
    
    .topbar-button {
        font-size: 0;
    }
    
    .topbar-button::after {
        font-size: 11px;
    }
}

/* ============================================================
   BOUTON HELLOASSO MOBILE — header droit, symétrique hamburger
   Stratégie : position absolue sur la SECTION header
   ============================================================ */
@media (max-width: 768px) {

    /* La section header doit être relative pour que l'absolu fonctionne */
    .elementor-element-20c91f6 {
        position: relative !important;
    }

    /* Colonne bouton : sortie du flux, placée en absolu à droite */
    .elementor-section.elementor-element-20c91f6 > .elementor-container > .elementor-row > .elementor-column.elementor-element-5eb1b84,
    .elementor-section.elementor-element-20c91f6 > .elementor-container > .elementor-column.elementor-element-5eb1b84 {
        display: block !important;
        position: absolute !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 9999 !important;
        width: auto !important;
        max-width: 70px !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: none !important;
    }

    /* Conteneur interne Elementor */
    .elementor-element-20c91f6 .elementor-element-5eb1b84 .elementor-widget-wrap {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Wrapper du bouton */
    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button-wrapper {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Le bouton en carré — taille 60x60px */
    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 60px !important;
        height: 60px !important;
        padding: 5px !important;
        background-color: #21CDC0 !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        gap: 3px !important;
        box-sizing: border-box !important;
    }

    /* Survol / toucher */
    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button:hover,
    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button:active {
        background-color: #4C84B8 !important;
    }

    /* Wrapper du contenu (icone + texte) */
    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button-content-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        width: 100% !important;
    }

    /* Logo HelloAsso */
    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button-icon svg {
        width: 32px !important;
        height: 32px !important;
    }

    /* Texte "Adhérer" */
    .elementor-element-20c91f6 .elementor-element-ef83036 .elementor-button-text {
        display: block !important;
        color: #ffffff !important;
        font-size: 9px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap !important;
    }
}
/* ── BARRE ADMIN WP — masquée sur mobile (margin-top résiduel) ──────────── */
/* Corrige le décalage de 46px sur iOS causé par WordPress même sans connexion */
@media (max-width: 768px) {
    html {
        margin-top: 0 !important;
    }
    #wpadminbar {
        display: none !important;
    }
}

/* ── Compatibilité barre admin WordPress ────────────────────────────────── */
.admin-bar .vigicrecy-topbar {
    margin-top: 0;
}
.admin-bar #wpadminbar {
    position: fixed !important;
}

/* ── Barre admin WP mobile — supprimer le trou blanc ────────────────────── */
@media (max-width: 782px) {
    .admin-bar body,
    .admin-bar html {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* ==========================================================================
   PILL 3-EN-1 (Repères / Lune / Signaler) — Desktop ≥ 1025px
   3 boutons indépendants épousés dans une SEULE pill visuelle
   Patch 2026-05-13 v3 — emboîtement turquoise sous disque
   ========================================================================== */

@media (min-width: 1025px) {

    /* ── PILL OUTER : conteneur englobant avec contour gris clair ── */
    .topbar-actions {
        display: flex;
        align-items: center;
        gap: 0;
        margin-left: 0;
        border: 1px solid rgba(180, 195, 215, 0.55);
        border-radius: 100px;
        padding: 0;
        background: transparent;
        overflow: visible; /* le disque chevauche */
        height: 38px;
        box-sizing: border-box;
    }

    /* ── Bouton 1 : Repères (zone gauche, bleu nuit, half-pill gauche)
       padding-right 33px = 18 (équivalent padding-left) + 15 (chevauchement disque)
       → texte centré dans l'espace VISIBLE [0, Wa-15] et jamais sous le disque ── */
    .topbar-pictos-toggle {
        background: #1A2E4A;
        border: none;
        border-radius: 36px 0 0 36px;
        height: 36px;
        padding: 0 33px 0 18px;
        color: #ffffff;
        font-size: 13px;
        font-weight: 500;
        letter-spacing: 0.2px;
        white-space: nowrap;
        cursor: pointer;
        margin: 0;
        display: inline-flex;
        align-items: center;
        transition: background 0.2s ease;
    }
    .topbar-pictos-toggle:hover {
        background: #243959;
    }
    .topbar-pictos-toggle .toggle-arrow { display: none; }

    /* ── Bouton 2 : Disque Lune (cercle, AXE aligné sur le bord gauche du turquoise) ── */
    .topbar-btn-lune {
        background: #1A2E4A;
        border: 1.5px solid rgba(200, 215, 230, 0.7);
        border-radius: 50%;
        width: 30px;
        height: 30px;
        padding: 0;
        margin: 0 -15px; /* chevauche symétriquement : 15px sur chaque zone → axe sur la frontière */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 2; /* au-dessus de turquoise (z-index 1) */
        flex-shrink: 0;
        cursor: pointer;
        opacity: 1 !important; /* le FOND reste TOUJOURS opaque, jamais transparent */
        transition: background 0.2s ease, border-color 0.2s ease;
    }
    .topbar-btn-lune:hover {
        background: #243959;
        border-color: rgba(220, 235, 250, 0.9);
    }
    .topbar-btn-lune img {
        width: 20px;
        height: 20px;
        object-fit: contain;
        display: block;
        opacity: 1; /* picto lune ALLUMÉ par défaut (lune row OFF) */
        transition: opacity 0.2s ease;
    }
    /* INVERSE LOGIQUE :
       - quand lune row visible (.lune-on) → picto disque DIMINUÉ (déjà utilisé)
       - quand lune row absente (pas de classe) → picto disque ALLUMÉ (disponible) */
    .topbar-btn-lune.lune-on img {
        opacity: 0.4;
    }

    /* ── Bouton 3 : Signaler (turquoise, démarre PILE au bord = axe du disque) ──
       Le bouton commence exactement à la frontière des deux zones (= axe du disque).
       L'arrondi gauche complet est SOUS le disque (l'axe disque = bord gauche turquoise).
       padding-left 24px garantit que le texte commence APRÈS le disque (qui dépasse de 15px). */
    .topbar-button {
        background: #3BBFB0;
        background-image: none;
        border: none;
        border-radius: 36px; /* TOUS les coins arrondis */
        height: 36px;
        line-height: 1;
        padding: 0 18px 0 24px; /* texte commence à 24px du bord = 9px après le disque */
        color: #ffffff;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        margin: 0; /* aucun décalage : démarre pile au bord = axe du disque */
        display: inline-flex;
        align-items: center;
        position: relative;
        z-index: 1; /* sous le disque (z-index 2) */
        transition: background 0.2s ease;
    }
    .topbar-button:hover {
        background: #34A99C;
        color: #ffffff;
        transform: none;
    }

    /* ── Cascade staggered : transitions par picto (delays posés en JS) ── */
    .topbar-picto {
        transition:
            max-width 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            opacity 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            margin 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            padding 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .topbar-pictos.collapsed .topbar-picto {
        transform: translateX(20px);
    }
}

/* ==========================================================================
   Alignement vertical des pictos — descend de 2px les IMG sans bouger les labels
   transform: translateY ne change pas le layout, donc les labels restent en place
   DESKTOP UNIQUEMENT (mobile déjà bien aligné)
   Patch 2026-05-13 v5
   ========================================================================== */
@media (min-width: 1025px) {
    .topbar-picto img {
        transform: translateY(2px);
    }
}

/* ==========================================================================
   MODAL STUB "Signaler un événement" (toutes tailles, temporaire)
   Sera remplacé par le formulaire du plugin vigicrecy-signalements à venir
   ========================================================================== */
.vg-modal-stub-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.vg-modal-stub-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.vg-modal-stub-card {
    background: #ffffff;
    border-radius: 10px;
    max-width: 420px;
    width: calc(100% - 32px);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    transform: translateY(10px);
    transition: transform 0.2s ease;
}
.vg-modal-stub-overlay.is-open .vg-modal-stub-card {
    transform: translateY(0);
}
.vg-modal-stub-header {
    background: linear-gradient(135deg, #3B6CB7, #5AADCF);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
}
.vg-modal-stub-close {
    background: transparent;
    border: 0;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.85;
}
.vg-modal-stub-close:hover { opacity: 1; }
.vg-modal-stub-body {
    padding: 18px;
    color: #000000;
    font-size: 14px;
    line-height: 1.5;
}
.vg-modal-stub-footer {
    padding: 0 18px 18px;
    text-align: right;
}
.vg-modal-stub-ok {
    background: #3BBFB0;
    border: 0;
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}
.vg-modal-stub-ok:hover { background: #34A99C; }

/* ============================================================
 * Fix z-index TopBar — page d'accueil mobile uniquement
 * ------------------------------------------------------------
 * Contexte : sur mobile, le thème (style.css) applique
 * z-index: 200 !important à .vigicrecy-topbar pour passer
 * au-dessus du Header. Sur la page d'accueil, cette valeur
 * laisse passer DEVANT la TopBar :
 *   - les panneaux Leaflet (200 à 700)
 *   - la popup Calques de vigicrecy-hydro (10000)
 * Le menu déroulant du badge IVC se retrouve alors masqué.
 *
 * Correction : on restaure la valeur desktop initiale du
 * plugin (100000), uniquement sur la page d'accueil mobile.
 * Comportement identique à celui du desktop, qui est validé.
 * ============================================================ */
@media (max-width: 767px) {
    body.home .vigicrecy-topbar {
        z-index: 100000 !important;
    }
}
