/* ==========================================================================
   Carte interactive des départements (section Réseau, page d'accueil)
   ========================================================================== */

/* La carte reste dans la colonne de droite de la section Réseau
   (texte "Notre réseau de distribution" à gauche, carte à droite). */
.carte-departements {
    width: 100%;
}

/* --- Fond de carte -------------------------------------------------------- */
.carte-departements__map {
    width: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-black-10);
    border-radius: 16px;
    padding: 24px;
}

.carte-departements .carte-france {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    margin: 0 auto;
}

/* Chaque département : la couleur de remplissage (fill) est posée en JS selon
   le commercial affecté. On n'utilise donc PAS de "fill" par défaut ici, et le
   survol/sélection joue sur un filtre pour conserver la couleur du commercial. */
.carte-departements .departement {
    stroke: var(--color-white);
    stroke-width: 0.8;
    stroke-linejoin: round;
    cursor: pointer;
    transition: filter 0.15s ease, stroke 0.15s ease, stroke-width 0.15s ease;
}

.carte-departements .departement:hover {
    filter: brightness(1.12);
    stroke: var(--color-black);
    stroke-width: 1;
}

.carte-departements .departement.is-active {
    filter: brightness(0.9);
    stroke: var(--color-black);
    stroke-width: 1.4;
}

/* Numéros de département */
.carte-departements .carte-label {
    font-size: 7px;
    font-weight: 600;
    fill: var(--color-black);
    pointer-events: none; /* le clic passe au département en dessous */
    user-select: none;
}

/* Accessibilité clavier */
.carte-departements .departement:focus {
    outline: none;
    filter: brightness(1.12);
}
.carte-departements .departement:focus-visible {
    stroke: var(--color-black);
    stroke-width: 1.2;
}

/* ==========================================================================
   Popin (modale) affichée au clic
   ========================================================================== */
.carte-modal[hidden] {
    display: none;
}

.carte-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.carte-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(34, 34, 34, 0.55);
    animation: carteModalFade 0.2s ease;
}

.carte-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--color-white);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: carteModalPop 0.2s ease;
}

@keyframes carteModalFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes carteModalPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.carte-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--color-grey);
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-black);
    cursor: pointer;
    transition: background 0.15s ease;
}
.carte-modal__close:hover {
    background: var(--color-black-10);
}

.carte-modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-right: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-black-10);
}

.carte-modal__badge {
    flex-shrink: 0;
    background: var(--color-green);
    color: var(--color-white);
    font-weight: var(--font-weight-semibold, 600);
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 8px;
}

.carte-modal__dept {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-black);
    margin: 0;
    line-height: 1.2;
}

.carte-modal__contact {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.carte-modal__avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-green-10);
    color: var(--color-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.carte-modal__commercial {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-black);
    margin: 0 0 2px;
}

.carte-modal__region {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0 0 12px;
}

.carte-modal__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carte-modal__link[hidden] {
    display: none;
}

.carte-modal__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-black);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}

.carte-modal__link svg {
    flex-shrink: 0;
    color: var(--color-green);
}

.carte-modal__link:hover {
    color: var(--color-green);
}

/* Message affiché aux visiteurs non connectés (coordonnées commerciales masquées) */
.carte-modal__login[hidden] {
    display: none;
}

.carte-modal__login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-green-10);
    border-radius: 8px;
    color: var(--color-green);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.carte-modal__login svg {
    flex-shrink: 0;
}

.carte-modal__login:hover {
    background: var(--color-black-10);
}
