/* --- RESET & VARIABLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --primary-color: #E2D9FF; /* Violet pastel doux, lumineux et premium */
    --primary-hover: #C9BBFF; /* Violet un poil plus soutenu pour le survol bouton */
    --primary-marker: #8B75FF; /* Teinte de violet lisible pour le centre du marqueur */
    --text-main: #222222;
    --text-muted: #717171;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
    --radius-round: 32px;
    --radius-md: 16px;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: var(--text-main);
}

/* --- CARTE --- */
#map {
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #f4f3f0;
}

/* --- BARRE DE RECHERCHE FLOATTANTE (AIRBNB STYLE) --- */
.search-container {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-round);
    padding: 8px 8px 8px 24px;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s ease;
}

.search-box:focus-within {
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 0, 0, 0.15);
}

.search-icon {
    width: 16px;
    height: 16px;
    display: block;
    fill: var(--text-main);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    background: transparent;
}

.search-box button {
    background: var(--primary-color);
    color: var(--text-main);
    font-weight: 600;
    border: none;
    outline: none;
    padding: 10px 20px;
    border-radius: var(--radius-round);
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.search-box button:hover {
    background-color: var(--primary-hover);
}

.search-box button:active {
    transform: scale(0.96);
}

/* --- MARQUEURS VIOLET PASTEL (L.divIcon) --- */
.custom-marker-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-marker-pin {
    width: 20px;
    height: 20px;
    background: var(--bg-white);
    border-radius: 50%;
    box-shadow: 0 0 0 2px white, var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-marker-pin::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-marker);
    border-radius: 50%;
}

.custom-marker-wrapper:hover .custom-marker-pin {
    transform: scale(1.2);
}

/* --- POPUPS LEAFLET --- */
.leaflet-popup-content-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-md) !important;
    padding: 8px;
    box-shadow: var(--shadow-lg) !important;
    border: none;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    line-height: 1.4;
}

.leaflet-popup-tip-container {
    display: none; 
}

.popup-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.popup-address {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: capitalize; /* Formatage majuscule auto sur chaque mot */
}

/* Bouton Itinéraire */
.btn-itinerary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 16px;
    padding: 11px 0;
    background-color: var(--text-main);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-align: center;
}

.btn-itinerary:hover {
    background-color: #000000;
    color: #ffffff !important;
}

.btn-itinerary:active {
    transform: scale(0.98);
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    padding: 8px 8px 0 0 !important;
    font-size: 16px !important;
}

/* --- MARQUEURS CLUSTERS (VIOLET) --- */
.custom-cluster {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-cluster div {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.7) !important;
}