/* Les points d'intérêt restent sous les markers du trajet et de la position */
:where(.maplibregl-marker) {
    z-index: 1;
}

.maplibregl-marker.poi-marker {
    z-index: 0;
}

/* Les popups passent au-dessus de tous les markers */
.maplibregl-popup {
    z-index: 2;
}

.poi-marker {
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .4);
    cursor: pointer;
}

.patrimoine-marker {
    width: 40px;
    height: 40px;
    overflow: hidden;
    background: #e5e7eb;
}

.patrimoine-marker img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hébergements : vignette carrée à bord bordeaux, distincte des monuments ronds */
.relais-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-color: #9f1239;
    border-radius: 9px;
    background: #9f1239;
    color: #fff;
    font-size: 15px;
}

.relais-marker img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.borne-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #64748b;
    color: #fff;
    font-size: 15px;
}

.borne-slow { background: #0369a1; }
.borne-normal { background: #15803d; }
.borne-fast { background: #c2410c; }
.borne-ultra { background: #7e22ce; }

.borne-marker-count {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 18px;
    padding: 1px 4px;
    border: 1px solid #fff;
    border-radius: 9px;
    background: #111827;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}

.borne-marker-count.is-free {
    background: #16a34a;
}

.borne-marker-count.is-full {
    background: #dc2626;
}

.maplibregl-popup-content {
    border-radius: 14px;
}

.poi-popup {
    max-width: 240px;
}

/* ---------- Fiche d'une station ---------- */

.maplibregl-popup-content:has(.borne-popup) {
    padding-top: 0;
}

.maplibregl-popup-content:has(.borne-popup) .maplibregl-popup-close-button {
    top: 4px;
    right: 4px;
    color: #fff;
}

.borne-popup {
    gap: 8px;
    min-width: 220px;
    font-size: 13px;
    cursor: pointer;
}

.borne-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    width: calc(100% + 20px);
    margin: 0 -10px;
    padding: 9px 32px 9px 12px;
    border: 0;
    border-radius: 14px 14px 0 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.borne-popup-header i {
    flex: none;
    margin-top: 3px;
    font-size: 10px;
    transition: transform .15s;
}

.borne-popup.is-expanded .borne-popup-header i {
    transform: rotate(180deg);
}

.borne-popup-more {
    display: none;
    line-height: 1.35;
}

.borne-popup.is-expanded .borne-popup-more {
    display: block;
}

.borne-stop {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
}

.borne-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.borne-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.borne-muted {
    color: var(--muted);
    font-size: 12px;
}

.borne-availability {
    font-size: 16px;
    font-weight: 700;
}

.borne-availability.is-free {
    color: #15803d;
}

.borne-availability.is-full {
    color: #dc2626;
}

.borne-tariff {
    flex-direction: row;
    align-items: flex-start;
    gap: 7px;
    font-weight: 600;
}

.borne-tariff > i {
    margin-top: 2px;
    color: var(--muted);
}

.borne-tariff-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.3;
}

.borne-popup.is-expanded .borne-tariff-text {
    display: block;
}

.borne-plugs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.borne-plug {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 4px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 12px;
}

.borne-plug svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #334155;
    stroke-width: 1.5;
}

.borne-plug svg .pins {
    fill: #334155;
    stroke: none;
}

.poi-popup-image {
    width: 100%;
    height: 110px;
    border-radius: 6px;
    object-fit: cover;
}

.poi-popup .search-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.poi-popup .search-popup-go {
    margin-top: 0;
}

.poi-popup-link {
    color: #2563eb;
    font-size: 13px;
    text-decoration: none;
}

.poi-popup-link:hover {
    text-decoration: underline;
}

/* ---------- Menu d'affichage des couches ---------- */

#btnPoi {
    position: absolute;
    right: 18px;
    bottom: 237px;
    z-index: 5;
    padding: 12px 13px;
    color: white;
    background: var(--blue-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

#poiMenu {
    position: absolute;
    right: 70px;
    bottom: 237px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    font-size: 14px;
}

#poiMenu[hidden] {
    display: none;
}

#poiMenu label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
}

#poiMenu input {
    width: auto;
    margin: 0;
}

#poiBornesPower {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 0 22px;
    padding: 0;
    border: 0;
    font-size: 13px;
}

#poiBornesPower:disabled {
    opacity: .45;
}

.poi-power-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
