/* ============================
   CARTE
============================ */
#map {
    height: 550px;
    margin-bottom: 20px;
}

/* ============================
   POPUPS PREMIUM
============================ */
.leaflet-popup-content-wrapper {
    border-radius: 14px !important;
    padding: 0 !important; /* Supprime le padding du wrapper */
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.leaflet-popup-content {
    margin: 0 !important; /* IMPORTANT : Supprime la marge automatique de Leaflet */
    padding: 0 !important;
    width: 280px !important;
    font-family: "Arial", sans-serif;
}

.popup-premium {
    display: flex;
    flex-direction: column;
    margin: 0 !important;
}

.popup-premium img {
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 !important; /* Supprime toute marge propre à l'image */
    border-top-left-radius: 14px; /* Arrondi pour épouser le wrapper */
    border-top-right-radius: 14px;
}

.popup-body {
    padding: 12px 16px;
}

.popup-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 6px;
    color: #1a2a40;
}

.popup-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.popup-btn {
    display: inline-block;
    padding: 8px 14px;
    background: #1a2a40;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
}

.popup-btn:hover {
    background: #2c3f5c;
}

/* ============================
   PETIT CARRÉ DE CONTRÔLES
============================ */
.control-box {
    background: #1a2a40;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-box a {
    background: #fff;
    color: #1a2a40 !important;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
}

.control-box a:hover {
    background: #e6e6e6;
}

/* ============================
   TOGGLE iOS PREMIUM – 3 LAYERS
============================ */
.ios-toggle {
    z-index: 9999;
}

.toggle-container {
    position: relative;
    display: inline-flex;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(8px);
    border-radius: 22px;
    padding: 4px;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.toggle-option {
    position: relative;
    z-index: 2;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.toggle-option.active {
    color: white;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.toggle-pill {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    width: 0;
    background: #2b6cb0;
    border-radius: 16px;
    transition: all 0.25s ease;
    z-index: 1;
}

/* ============================
   PANNEAU LATERAL "LIEUX"
============================ */
.side-panel {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    max-height: 260px;
    overflow-y: auto;
    font-size: 0.85rem;
    min-width: 200px;
}

.side-panel.hidden {
    display: none;
}

.side-panel h3 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a2a40;
}

.side-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-panel li {
    padding: 4px 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.side-panel li:last-child {
    border-bottom: none;
}

.side-panel li:hover {
    color: #2b6cb0;
}

/* ============================
   MOBILE
============================ */
@media (max-width: 768px) {
    #map {
        height: 420px;
    }

    .toggle-container {
        font-size: 0.8rem;
        padding: 3px;
    }

    .toggle-option {
        padding: 4px 10px;
    }

    .control-box {
        padding: 6px;
        gap: 4px;
    }

    .control-box a {
        font-size: 12px;
        padding: 5px 8px;
    }

    .side-panel {
        max-height: 200px;
        font-size: 0.8rem;
    }
}

/* Supprime le carré blanc du routing */
.leaflet-routing-container,
.leaflet-routing-container * {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}