/*
 * map.css — Phuket360 Map v7.1
 * Couleurs : #E09F3E (or) / #386641 (vert) / #6A994E (vert clair)
 * Polices  : Montserrat (titres) / Lato (texte)
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Lato:wght@400;700&display=swap');

/* --- WRAPPER --- */
.p360-wrapper {
    width: 100%;
    font-family: 'Lato', sans-serif;
    position: relative;
    box-sizing: border-box;
}

/* --- BARRE DE FILTRES + GÉOLOC (même ligne) --- */
.p360-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    width: 100%;
    flex-wrap: nowrap;
}

.p360-topbar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
}

.p360-filtres-outer {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.p360-filtres-scroll {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px;
    padding: 2px 0 10px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #DDA15E #FEFAE0;
}

.p360-filtres-scroll {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.p360-filtres-scroll > * {
    flex: 0 0 auto !important;
}

.p360-filtres-scroll::-webkit-scrollbar {
    height: 10px;
}

.p360-filtres-scroll::-webkit-scrollbar-track {
    background: #FEFAE0;
    border-radius: 999px;
}

.p360-filtres-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #DDA15E, #BC6C25);
    border-radius: 999px;
    border: 2px solid #FEFAE0;
}

.p360-filtres-scroll::-webkit-scrollbar-thumb:hover {
    background: #BC6C25;
}

.p360-filtre-btn {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-shrink: 0 !important;
    gap: 5px;
    padding: 7px 14px !important;
    border-radius: 20px !important;
    border: 2px solid #ddd !important;
    background: #fff !important;
    font-family: 'Lato', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #555 !important;
    cursor: pointer;
    white-space: nowrap !important;
    width: auto !important;
    max-width: none !important;
    min-width: max-content !important;
    float: none !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: all 0.2s;
}

.p360-filtre-btn:hover {
    border-color: #386641 !important;
    color: #386641 !important;
}

.p360-filtre-btn.actif {
    color: #fff !important;
    border-color: transparent !important;
}

.p360-filtre-btn.tout {
    background: #386641 !important;
    color: #fff !important;
    border-color: #386641 !important;
}

.p360-btn-geoloc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 2px solid #E09F3E;
    background: #fff;
    color: #E09F3E;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    margin: 0;
}
.p360-btn-geoloc:hover {
    background: #E09F3E;
    color: #fff;
}

.p360-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #386641;
    border-radius: 50%;
    background: #fff;
    color: #386641;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.p360-search-toggle:hover,
.p360-search-toggle.actif {
    background: #386641;
    color: #fff;
}

.p360-search-wrapper {
    position: relative;
    overflow: visible;
    z-index: 10020;
    max-height: 90px;
    opacity: 1;
    padding: 0 0 12px;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
    max-width: 520px;
}

.p360-search-wrapper.p360-search-collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    pointer-events: none;
    overflow: hidden;
}

.p360-search-wrapper.p360-search-open {
    max-height: 90px;
    opacity: 1;
    padding: 0 0 12px;
    overflow: visible;
}

.p360-search-input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 20px;
    border: 2px solid #ddd;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.p360-search-input:focus { border-color: #386641; }

/* --- CARTE --- */
.p360-map {
    width: 100%;
    height: 600px;
    border-radius: 12px;
    display: block;
    touch-action: pan-y pinch-zoom;
}

/* --- ICÔNES MARKERS --- */
.p360-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-size: 16px;
}
.p360-marker-icon span {
    transform: rotate(45deg);
    display: block;
}

.p360-marker-actif {
    width: 44px !important;
    height: 44px !important;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.9), 0 4px 16px rgba(0,0,0,0.4) !important;
    z-index: 9999 !important;
}

/* --- OVERLAY --- */
.p360-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9997;
}
.p360-overlay.open { display: block; }

/* --- PANNEAU LATÉRAL (desktop) --- */
.p360-panel {
    position: fixed;
    top: 75px;
    right: 0;
    bottom: 0;
    height: calc(100vh - 75px);
    width: 380px;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.2);
    z-index: 9998;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Lato', sans-serif;
}
.p360-panel.open { transform: translateX(0); }

/* --- BOUTON FERMER (desktop) --- */
.p360-close {
    display: none;
    position: fixed;
    top: 87px;
    right: 392px;
    width: 34px;
    height: 34px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.p360-close.visible { display: flex; }

/* --- PHOTO --- */
.p360-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.p360-photo-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* --- CORPS DU PANNEAU --- */
.p360-body { padding: 18px; padding-top: 22px; }

.p360-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.p360-titre {
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #386641;
    margin: 0;
}

/* --- BADGES DIFFICULTÉ --- */
.p360-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.p360-badge.facile    { background: #d4edda; color: #155724; }
.p360-badge.moyen     { background: #fff3cd; color: #856404; }
.p360-badge.difficile { background: #f8d7da; color: #721c24; }

/* --- TAG CATÉGORIE --- */
.p360-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    font-weight: 700;
}

/* --- DESCRIPTION --- */
.p360-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 14px;
}

/* --- CHIPS INFOS --- */
.p360-infos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.p360-chip {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    color: #333;
}

/* --- CONSEIL TERRAIN --- */
.p360-conseil {
    background: #f0f7ee;
    border-left: 3px solid #E09F3E;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #386641;
    line-height: 1.5;
}
.p360-conseil-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #E09F3E;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

/* --- BOUTONS CÔTE À CÔTE --- */
.p360-btns-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    margin-bottom: 8px;
}
.p360-btns-row a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 11px;
    padding: 8px 6px;
    border-radius: 8px;
    text-decoration: none !important;
}
.p360-btns-row a:only-child { flex: 1 !important; }
.p360-btn-article {
    flex: 2 !important;
    background: #386641;
    color: #fff !important;
    transition: background 0.2s;
}
.p360-btn-article:hover { background: #6A994E; }
.p360-btn-maps {
    flex: 1 !important;
    background: transparent;
    color: #386641 !important;
    border: 1px solid #386641;
    transition: all 0.2s;
}
.p360-btn-maps:hover {
    background: #386641;
    color: #fff !important;
}

/* --- SECTION À PROXIMITÉ --- */
.p360-proximite {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}
.p360-proximite-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}
.p360-proximite-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f9f9f9;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    width: 100%;
    text-align: left;
    font-family: 'Lato', sans-serif;
}
.p360-proximite-item:hover { background: #f0f7ee; }
.p360-proximite-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.p360-proximite-item-info { flex: 1; }
.p360-proximite-item-nom {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    display: block;
}
.p360-proximite-item-dist {
    font-size: 11px;
    color: #888;
    display: block;
}

/* --- PREMIUM VERROUILLÉ --- */
.p360-lock {
    text-align: center;
    padding: 50px 20px;
}
.p360-lock-icon { font-size: 48px; margin-bottom: 12px; }
.p360-lock h3 {
    font-family: 'Montserrat', sans-serif;
    color: #386641;
    margin-bottom: 8px;
}
.p360-lock p { color: #777; font-size: 13px; margin-bottom: 20px; }
.p360-btn-premium {
    display: inline-block;
    background: #E09F3E;
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none !important;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* --- SUGGESTIONS DE RECHERCHE --- */
.p360-search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% - 12px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    z-index: 10021;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 280px;
    overflow-y: auto;
}
.p360-search-suggestions.open { display: block; }
.p360-search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    color: #333;
}
.p360-search-suggestion-item:hover,
.p360-search-suggestion-item.actif { background: #f0f7ee; }
.p360-search-suggestion-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}
.p360-search-suggestion-info { flex: 1; }
.p360-search-suggestion-nom { font-weight: 700; display: block; }
.p360-search-suggestion-type { font-size: 11px; color: #888; display: block; }
.p360-search-aucun {
    padding: 10px 14px;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* --- SÉLECTEUR DE RAYON --- */
.p360-rayon-wrapper {
    position: fixed;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 9999;
    bottom: 0;
    right: 0;
    width: 380px;
    box-sizing: border-box;
}
.p360-rayon-label {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    white-space: nowrap;
}
.p360-rayon-btn {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}
.p360-rayon-btn:hover { border-color: #E09F3E; color: #E09F3E; }
.p360-rayon-btn.actif { background: #E09F3E; border-color: #E09F3E; color: #fff; }

/* --- FILTRES CATÉGORIE AUTOUR DE MOI --- */
.p360-autour-filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.p360-autour-filtre-btn {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}
.p360-autour-filtre-btn:hover { border-color: #386641; color: #386641; }
.p360-autour-filtre-btn.actif { background: #386641; border-color: #386641; color: #fff; }

.leaflet-container {
   touch-action: pan-y pinch-zoom;
}

/* --- CLUSTERS --- */
.p360-cluster {
    width: 44px;
    height: 44px;
    background: #386641;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

/* --- BOUTON FAVORI --- */
.p360-btn-favori {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 2px solid #E63946;
    background: #fff;
    color: #E63946;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.p360-btn-favori:hover,
.p360-btn-favori.actif {
    background: #E63946;
    color: #fff;
}

/* --- BADGE OUVERT / FERMÉ --- */
.p360-badge-ouvert {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    background: #d4edda;
    color: #155724;
    margin-bottom: 10px;
}
.p360-badge-ferme {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    background: #f8d7da;
    color: #721c24;
    margin-bottom: 10px;
}

/* --- TAGS ROW --- */
.p360-tags-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.p360-tags-row .p360-type-tag,
.p360-tags-row .p360-badge-ouvert,
.p360-tags-row .p360-badge-ferme {
    margin-bottom: 0;
}

/* --- PANNEAU FAVORIS --- */
.p360-fav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: #f9f9f9;
    margin-bottom: 8px;
    transition: background 0.2s;
}
.p360-fav-item:hover { background: #f0f7ee; }
.p360-fav-suppr {
    background: none;
    border: none;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.p360-fav-suppr:hover { color: #E63946; }

/* --- MINI SEMAINE --- */
.p360-semaine {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}
.p360-semaine-jour {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #d4edda;
    color: #155724;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
}
.p360-semaine-jour.ferme {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================================
   MOBILE (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {

    .p360-wrapper {
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
        padding: 0 12px;
        box-sizing: border-box;
        position: relative;
    }

    .p360-topbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .p360-topbar-left {
        display: flex;
        justify-content: flex-start;
        gap: 8px;
    }

    .p360-filtres-outer {
        width: 100%;
    }

    .p360-filtres-scroll {
        padding: 2px 0 12px;
        gap: 8px;
    }

    .p360-search-wrapper.p360-search-open {
        padding: 0 0 10px;
        max-height: 90px;
    }

    .p360-map {
        width: calc(100vw - 24px);
        height: 70vh;
        min-height: 340px;
        max-height: 520px;
        border-radius: 12px;
        display: block;
		touch-action: pan-y pinch-zoom;
    }

    .leaflet-control-zoom {
        display: none !important;
    }

    .p360-panel {
        position: fixed;
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 62vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(110%);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    }

    .p360-panel.open {
        transform: translateY(0);
    }

    .p360-close {
        position: absolute;
        top: 10px;
        right: 14px;
        width: 30px;
        height: 30px;
        background: #f0f0f0;
        color: #555;
        border-radius: 50%;
        font-size: 13px;
        z-index: 10000;
    }

    .p360-close.visible {
        display: flex;
    }

    .p360-btn-geoloc {
        font-size: 12px;
        padding: 6px 10px;
    }

    .p360-search-toggle {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

}