/**
 * Carte des cabinets d'avocats - v4.3
 * Marqueurs, deploiement des pins superposes et fiche contact.
 *
 * Le theme du site (Goodlayers) applique ses propres styles de titres, de
 * liens et de listes a l'interieur de la page : toutes les regles de la fiche
 * sont donc volontairement tres specifiques et forcees (!important) pour que
 * l'affichage reste identique quel que soit le contexte de la page.
 */

.ccav-map {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.ccav-map,
.ccav-popup {
    --ccav-or: #b08d4f;
    --ccav-or-clair: #d9c391;
    --ccav-or-pale: #f4ede0;
    --ccav-encre: #1f2328;
    --ccav-gris: #6d7480;
    --ccav-trait: #ebe8e2;
}

/* ===========================================================================
 * 1. Pins
 * ======================================================================== */

.ccav-map .ccav-pin {
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    box-shadow: none;
    cursor: pointer;
    line-height: 0;
    z-index: 3;
    -webkit-appearance: none;
    appearance: none;
}

.ccav-map .ccav-pin svg {
    display: block;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .3));
    transition: transform .18s ease;
    transform-origin: 50% 100%;
}

.ccav-map .ccav-pin:hover svg,
.ccav-map .ccav-pin:focus-visible svg {
    transform: scale(1.12);
}

.ccav-pin__body {
    fill: var(--ccav-or);
}

.ccav-pin__dot {
    fill: #fff;
}

.ccav-map .ccav-pin:hover .ccav-pin__body {
    fill: #96763f;
}

/* Pins d'un groupe : masques tant que le groupe est replie. */
.ccav-map .ccav-pin--enfant {
    opacity: 0;
    pointer-events: none;
}

.ccav-map .ccav-pin--enfant svg {
    transform: scale(.35);
}

.ccav-map .ccav-pin--enfant.is-visible {
    opacity: 1;
    pointer-events: auto;
    transition: opacity .2s ease;
}

.ccav-map .ccav-pin--enfant.is-visible svg {
    transform: scale(1);
}

/* Transition appliquee uniquement pendant le deploiement / repli : elle ne
   doit pas ralentir les pins lors du deplacement de la carte. */
.ccav-map .ccav-pin--anime {
    transition: transform .34s cubic-bezier(.34, 1.4, .5, 1), opacity .2s ease;
}

/* ===========================================================================
 * 2. Pin compteur (plusieurs cabinets a la meme adresse)
 * ======================================================================== */

.ccav-map .ccav-hub {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--ccav-encre);
    color: #fff;
    font: 700 14px/1 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .32);
    transition: transform .18s ease, background .18s ease, width .2s ease, height .2s ease;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
}

.ccav-map .ccav-hub:hover,
.ccav-map .ccav-hub:focus-visible {
    transform: scale(1.12);
    background: var(--ccav-or);
}

.ccav-map .ccav-hub::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(176, 141, 79, .8);
    animation: ccav-pulse 2.6s ease-out infinite;
}

.ccav-map .ccav-hub.is-open {
    width: 20px;
    height: 20px;
    background: var(--ccav-or);
}

/* Compteur non utilise au niveau de zoom courant. */
.ccav-map .ccav-hub--inactif {
    display: none !important;
}

.ccav-map .ccav-hub.is-open .ccav-hub__count {
    display: none;
}

.ccav-map .ccav-hub.is-open::after {
    animation: none;
    opacity: 0;
}

@keyframes ccav-pulse {
    0%   { transform: scale(.9); opacity: .85; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ccav-map .ccav-hub::after { animation: none; }
    .ccav-map .ccav-pin--anime { transition: none; }
}

/* ===========================================================================
 * 3. Traits de rattachement
 * ======================================================================== */

.ccav-map .ccav-spider-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.ccav-spider-line {
    stroke: rgba(31, 35, 40, .45);
    stroke-width: 1.5;
    stroke-dasharray: 3 4;
    stroke-linecap: round;
}

/* ===========================================================================
 * 4. Fiche contact
 * ======================================================================== */

/* La fiche passe au-dessus de tous les pins (pin : z-index 3, compteur : 4). */
.ccav-map .mapboxgl-popup,
.mapboxgl-popup.ccav-popup {
    z-index: 10 !important;
}

.mapboxgl-popup.ccav-popup {
    max-width: 300px !important;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
}

.mapboxgl-popup.ccav-popup .mapboxgl-popup-content {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 14px 36px rgba(20, 22, 26, .2), 0 2px 6px rgba(20, 22, 26, .1) !important;
}

/* Remise a plat des heritages du theme a l'interieur de la fiche. */
.mapboxgl-popup.ccav-popup .ccav-card,
.mapboxgl-popup.ccav-popup .ccav-card * {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-family: inherit !important;
    font-weight: 400 !important;
    font-style: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    text-shadow: none !important;
    text-align: left !important;
    line-height: 1.4 !important;
    list-style: none !important;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    color: var(--ccav-encre) !important;
}

.mapboxgl-popup.ccav-popup .ccav-card {
    width: 300px !important;
    max-width: 100% !important;
    background: #fff !important;
}

/* Liseré de marque */
.mapboxgl-popup.ccav-popup .ccav-card::before {
    content: "";
    display: block !important;
    height: 3px !important;
    background: linear-gradient(90deg, var(--ccav-or-clair), var(--ccav-or)) !important;
}

/* --- En-tete ------------------------------------------------------------ */

.mapboxgl-popup.ccav-popup .ccav-card__head {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    padding: 15px 42px 13px 15px !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__avatar {
    flex: 0 0 38px !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: var(--ccav-or-pale) !important;
    color: #8a6c33 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: .4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__identity {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__name {
    font-size: 15px !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    color: var(--ccav-encre) !important;
    letter-spacing: -.1px !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__firm {
    margin-top: 3px !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    color: var(--ccav-or) !important;
    text-transform: uppercase !important;
    letter-spacing: .7px !important;
}

/* --- Coordonnees -------------------------------------------------------- */

.mapboxgl-popup.ccav-popup .ccav-card__body {
    padding: 0 15px !important;
    border-top: 1px solid var(--ccav-trait) !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 9px !important;
    padding: 9px 0 !important;
    font-size: 13px !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__row + .ccav-card__row {
    border-top: 1px solid var(--ccav-trait) !important;
}

.mapboxgl-popup.ccav-popup .ccav-icon {
    flex: 0 0 15px !important;
    width: 15px !important;
    height: 15px !important;
    margin-top: 2px !important;
    fill: var(--ccav-or) !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__value {
    color: var(--ccav-encre) !important;
    font-size: 13px !important;
    word-break: break-word !important;
    background: none !important;
    box-shadow: none !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__row--tel .ccav-card__value {
    font-weight: 600 !important;
    letter-spacing: .3px !important;
}

.mapboxgl-popup.ccav-popup a.ccav-card__value:hover,
.mapboxgl-popup.ccav-popup a.ccav-card__value:focus {
    color: var(--ccav-or) !important;
    text-decoration: underline !important;
}

.mapboxgl-popup.ccav-popup .ccav-card__empty {
    padding: 10px 0 !important;
    font-size: 12.5px !important;
    color: var(--ccav-gris) !important;
    font-style: italic !important;
}

/* --- Actions ------------------------------------------------------------ */

.mapboxgl-popup.ccav-popup .ccav-card__actions {
    display: flex !important;
    gap: 7px !important;
    padding: 12px 15px 15px !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn {
    flex: 1 1 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 33px !important;
    padding: 0 9px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.mapboxgl-popup.ccav-popup .ccav-btn .ccav-icon {
    flex: 0 0 13px !important;
    width: 13px !important;
    height: 13px !important;
    margin: 0 !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn__label {
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--primaire {
    background: var(--ccav-encre) !important;
    color: #fff !important;
}

/* Le libelle est cible explicitement : certains themes forcent la couleur
   du texte a l'interieur des liens. */
.mapboxgl-popup.ccav-popup .ccav-btn--primaire .ccav-btn__label {
    color: #fff !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--primaire .ccav-icon {
    fill: var(--ccav-or-clair) !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--primaire:hover,
.mapboxgl-popup.ccav-popup .ccav-btn--primaire:focus {
    background: #000 !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--secondaire,
.mapboxgl-popup.ccav-popup .ccav-btn--secondaire .ccav-btn__label {
    color: var(--ccav-encre) !important;
    background: none !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--secondaire {
    background: #fff !important;
    box-shadow: inset 0 0 0 1px var(--ccav-trait) !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--secondaire .ccav-icon {
    fill: var(--ccav-gris) !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--secondaire:hover,
.mapboxgl-popup.ccav-popup .ccav-btn--secondaire:focus {
    box-shadow: inset 0 0 0 1px var(--ccav-or) !important;
}

.mapboxgl-popup.ccav-popup .ccav-btn--secondaire:hover .ccav-btn__label,
.mapboxgl-popup.ccav-popup .ccav-btn--secondaire:hover {
    color: #8a6c33 !important;
}

/* --- Fermeture ---------------------------------------------------------- */

.mapboxgl-popup.ccav-popup .mapboxgl-popup-close-button {
    width: 24px !important;
    height: 24px !important;
    top: 12px !important;
    right: 11px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f2f0ec !important;
    color: var(--ccav-gris) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 24px !important;
    text-align: center !important;
    transition: background .15s ease, color .15s ease;
}

.mapboxgl-popup.ccav-popup .mapboxgl-popup-close-button:hover {
    background: var(--ccav-encre) !important;
    color: #fff !important;
}

.mapboxgl-popup.ccav-popup .mapboxgl-popup-tip {
    border-top-color: #fff !important;
    border-bottom-color: #fff !important;
}

/* --- Mobile ------------------------------------------------------------- */

@media (max-width: 480px) {
    .mapboxgl-popup.ccav-popup .ccav-card {
        width: 262px !important;
    }

    .mapboxgl-popup.ccav-popup .ccav-card__actions {
        flex-wrap: wrap !important;
    }

    .mapboxgl-popup.ccav-popup .ccav-btn {
        flex: 1 1 100% !important;
    }
}
