/* ─── PLAGEPLAGE Map V1 ──────────────────────────────────────────────────── */

/* Conteneur */
.pp-map-wrap {
    position: relative;
    background: var(--pp-color-sable, #ece5d8);
    border-radius: 2px;
    overflow: hidden;
}

.pp-map-canvas {
    width: 100%;
    min-height: 320px;
}

/* Loader */
.pp-map-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(250, 248, 245, .35);
    z-index: 1001;
    pointer-events: none;
}
.pp-map-loader[hidden] { display: none; }
.pp-map-loader__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pp-color-encre, #1a2020);
    margin: 0 3px;
    animation: pp-map-bounce .9s ease-in-out infinite alternate;
}
.pp-map-loader__dot:nth-child(2) { animation-delay: .18s; }
.pp-map-loader__dot:nth-child(3) { animation-delay: .36s; }
@keyframes pp-map-bounce {
    from { transform: translateY(0); opacity: .4; }
    to   { transform: translateY(-6px); opacity: 1; }
}

/* Fallback no-JS / erreur */
.pp-map-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--pp-color-bleu-gris, #5e6b6d);
    font-size: .875rem;
    background: var(--pp-color-sable, #ece5d8);
    min-height: 320px;
}
.pp-map-fallback__link {
    margin-top: 1rem;
    color: var(--pp-color-encre, #1a2020);
    text-decoration: underline;
}

/* ─── Barre de filtres ───────────────────────────────────────────────────── */

.pp-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 1rem;
    background: var(--pp-color-creme, #faf8f5);
    border-bottom: 1px solid var(--pp-color-sable, #ece5d8);
    align-items: center;
}

.pp-map-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 2rem;
    cursor: pointer;
    background: transparent;
    color: var(--pp-color-bleu-gris, #5e6b6d);
    transition: all .15s;
    font-family: inherit;
}
.pp-map-filter-btn:hover,
.pp-map-filter-btn[aria-pressed="true"] {
    background: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-creme, #faf8f5);
    border-color: var(--pp-color-encre, #1a2020);
}

.pp-map-search-zone {
    margin-left: auto;
    padding: .3rem 1rem;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-creme, #faf8f5);
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}
.pp-map-search-zone:hover { opacity: .8; }

/* ─── Marqueurs ─────────────────────────────────────────────────────────── */

.pp-map-marker {
    background: none !important;
    border: none !important;
    cursor: pointer;
}
.pp-map-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
    transition: transform .15s ease;
}
.pp-map-marker:hover svg,
.pp-map-marker--selected svg {
    filter: drop-shadow(0 3px 8px rgba(0,0,0,.35));
    transform: scale(1.1);
}

/* Cluster */
.pp-map-cluster {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-creme, #faf8f5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    font-family: 'General Sans', sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    border: 2px solid rgba(250,248,245,.3);
    cursor: pointer;
}
.pp-map-cluster span { line-height: 1; }

/* ─── Popup ──────────────────────────────────────────────────────────────── */

.pp-map-popup .leaflet-popup-content-wrapper {
    border-radius: 3px;
    box-shadow: 0 4px 24px rgba(26,32,32,.18);
    padding: 0;
    overflow: hidden;
    border: none;
    background: var(--pp-color-creme, #faf8f5);
    min-width: 220px;
    max-width: 260px;
}
.pp-map-popup .leaflet-popup-tip-container {
    margin-top: -1px;
}
.pp-map-popup .leaflet-popup-tip {
    background: var(--pp-color-creme, #faf8f5);
}
.pp-map-popup .leaflet-popup-close-button {
    top: 8px;
    right: 8px;
    color: var(--pp-color-encre, #1a2020);
    font-size: 18px;
    line-height: 1;
    z-index: 1;
}

.pp-mpop {}

.pp-mpop__img-wrap {
    height: 140px;
    overflow: hidden;
    background: var(--pp-color-sable, #ece5d8);
}
.pp-mpop__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.pp-mpop:hover .pp-mpop__img-wrap img {
    transform: scale(1.03);
}

.pp-mpop__body {
    padding: .9rem 1rem .8rem;
}

.pp-mpop__badges {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-bottom: .5rem;
}
.pp-mpop__badge {
    font-size: .6rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .15rem .5rem;
    background: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-creme, #faf8f5);
    border-radius: 2rem;
}

.pp-mpop__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .35rem;
    align-items: center;
}
.pp-mpop__type, .pp-mpop__dest, .pp-mpop__dist, .pp-mpop__price {
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pp-color-bleu-gris, #5e6b6d);
}
.pp-mpop__type::after { content: ' ·'; margin-right: .2em; }
.pp-mpop__dist { margin-left: auto; }

.pp-mpop__title {
    font-family: var(--pp-font-display, 'Fraunces', serif);
    font-size: .95rem;
    font-weight: 400;
    color: var(--pp-color-encre, #1a2020);
    margin: 0 0 .75rem;
    line-height: 1.3;
}

.pp-mpop__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.pp-mpop__cta {
    flex: 1;
    display: block;
    text-align: center;
    padding: .5rem .75rem;
    background: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-creme, #faf8f5);
    text-decoration: none;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: opacity .15s;
}
.pp-mpop__cta:hover { opacity: .8; }

.pp-mpop__itinéraire {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--pp-color-sable, #ece5d8);
    border-radius: 2px;
    color: var(--pp-color-encre, #1a2020);
    text-decoration: none;
    transition: all .15s;
    flex-shrink: 0;
}
.pp-mpop__itinéraire:hover {
    background: var(--pp-color-sable, #ece5d8);
}

/* ─── Page carte dédiée ──────────────────────────────────────────────────── */

.pp-page-carte {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--pp-color-creme, #faf8f5);
}
.pp-carte-header {
    padding: 1.2rem var(--pp-container-pad, 1.5rem) 1rem;
    border-bottom: 1px solid var(--pp-color-sable, #ece5d8);
    background: var(--pp-color-creme, #faf8f5);
    position: relative;
    z-index: 1002;
}
.pp-carte-header__eyebrow {
    font-size: .6rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--pp-color-bleu-gris, #5e6b6d);
    display: block;
    margin-bottom: .3rem;
}
.pp-carte-header h1 {
    font-family: var(--pp-font-display, 'Fraunces', serif);
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 400;
    margin: 0;
    color: var(--pp-color-encre, #1a2020);
}
.pp-carte-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ─── Section carte dans destination ────────────────────────────────────── */

.pp-dest-map-section {
    max-width: var(--pp-container-max, 1200px);
    margin: 2.5rem auto;
    padding: 0 var(--pp-container-pad, 1.5rem);
}
.pp-dest-map-section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.pp-dest-map-section__titre {
    font-family: var(--pp-font-display, 'Fraunces', serif);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--pp-color-encre, #1a2020);
    margin: 0;
}
.pp-dest-map-section__link {
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--pp-color-bleu-gris, #5e6b6d);
    text-decoration: none;
}
.pp-dest-map-section__link:hover { text-decoration: underline; }

/* ─── Toggle Carte/Liste (archive) ──────────────────────────────────────── */

.pp-view-toggle {
    display: flex;
    gap: .25rem;
    background: var(--pp-color-sable, #ece5d8);
    border-radius: 2rem;
    padding: .2rem;
}
.pp-view-toggle__btn {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .85rem;
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: 2rem;
    border: none;
    background: transparent;
    color: var(--pp-color-bleu-gris, #5e6b6d);
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.pp-view-toggle__btn[aria-pressed="true"],
.pp-view-toggle__btn:hover {
    background: var(--pp-color-creme, #faf8f5);
    color: var(--pp-color-encre, #1a2020);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.pp-view-toggle__btn svg { flex-shrink: 0; }

/* Panneau carte dans archive */
.pp-arch-map-panel {
    margin-bottom: 2rem;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26,32,32,.08);
}
.pp-arch-map-panel[hidden] { display: none; }

/* Highlight carte/liste */
.pp-card--map-active {
    outline: 2px solid var(--pp-color-encre, #1a2020);
    outline-offset: 2px;
}
.pp-card--out-bbox { opacity: .45; transition: opacity .3s; }
.pp-card--in-bbox  { opacity: 1; transition: opacity .3s; }

/* ─── Bouton géolocalisation ────────────────────────────────────────────── */

.pp-map-geo-btn {
    border-color: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-encre, #1a2020);
}
.pp-map-geo-btn[aria-pressed="true"] {
    background: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-creme, #faf8f5);
}
.pp-map-geo-btn:disabled {
    opacity: .5;
    cursor: default;
}

/* Point de position utilisateur */
.pp-map-me {
    position: relative;
    width: 20px;
    height: 20px;
}
.pp-map-me::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--pp-color-encre, #1a2020);
}
.pp-map-me__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--pp-color-encre, #1a2020);
    opacity: .35;
    animation: pp-map-pulse 2s ease-out infinite;
}
@keyframes pp-map-pulse {
    0%   { transform: scale(1);   opacity: .35; }
    70%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ─── Notice zone dense ──────────────────────────────────────────────────── */

.pp-map-dense-notice,
.pp-map-geo-acc-warning {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1003;
    background: var(--pp-color-encre, #1a2020);
    color: var(--pp-color-creme, #faf8f5);
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .35rem .9rem;
    border-radius: 2rem;
    white-space: nowrap;
    pointer-events: none;
    animation: pp-map-notice-in .2s ease;
}
.pp-map-geo-acc-warning {
    bottom: 4.5rem;
    background: var(--pp-color-bleu-gris, #5e6b6d);
}
.pp-map-dense-notice[hidden],
.pp-map-geo-acc-warning[hidden] { display: none; }

@keyframes pp-map-notice-in {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .pp-map-filters {
        padding: .6rem .75rem;
        gap: .4rem;
    }
    .pp-map-filter-btn {
        font-size: .65rem;
        padding: .25rem .6rem;
    }
    .pp-map-search-zone { display: none; }

    .pp-dest-map-section { margin: 1.5rem auto; }

    /* Mobile : bascule carte/liste en bas d'écran */
    .pp-map-mobile-toggle {
        display: flex;
        justify-content: center;
        padding: .75rem;
        background: var(--pp-color-creme, #faf8f5);
        border-top: 1px solid var(--pp-color-sable, #ece5d8);
    }
}

@media (min-width: 641px) {
    .pp-map-mobile-toggle { display: none; }
}

/* Leaflet overrides */
.leaflet-container {
    font-family: 'General Sans', 'Helvetica Neue', sans-serif;
}
.leaflet-control-zoom a {
    color: var(--pp-color-encre, #1a2020) !important;
    font-size: 16px !important;
    line-height: 26px !important;
}
.leaflet-control-attribution {
    font-size: .6rem !important;
    opacity: .7;
}

/* ─── Fallback carte : masquage + alignement gauche ───────────────────── */
.pp-map-fallback[hidden] { display: none !important; }

.pp-map-fallback {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 1.5rem;
    min-height: auto !important;
    padding: 1.5rem;
}
.pp-map-fallback__group {
    flex: 1 1 140px;
    text-align: left;
}
.pp-map-fallback__label {
    display: block;
    text-align: left;
    font-size: .65rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pp-color-encre, #1a2020);
    margin-bottom: .5rem;
    font-weight: 600;
}
.pp-map-fallback__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: .3rem;
}
.pp-map-fallback__list li a {
    font-size: .8rem;
    color: var(--pp-color-encre, #1a2020);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.pp-map-fallback__list li a::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--pp-color-bleu-gris, #5e6b6d);
    flex-shrink: 0;
}
.pp-map-fallback__list li a:hover { text-decoration: underline; }
