/* ============================================================
   ITINÉRAIRE — Full-screen map + search panel
   ============================================================ */

   .iti-body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* Rétablir le curseur natif sur la page itinéraire */
.iti-body *,
.iti-body *::before,
.iti-body *::after {
    cursor: auto !important;
}

.iti-body .cursor {
    display: none !important;
}

.iti-body .iti-panel__search,
.iti-body .iti-panel__swap,
.iti-body .iti-route,
.iti-body .iti-autocomplete-item,
.iti-body button,
.iti-body a {
    cursor: pointer !important;
}

.iti-body .iti-map .leaflet-grab {
    cursor: grab !important;
}
.iti-body .iti-map .leaflet-dragging .leaflet-grab {
    cursor: grabbing !important;
}

/* Map plein écran */
.iti-map {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.iti-map .leaflet-tile {
    filter: brightness(0.5) saturate(0.25) hue-rotate(200deg);
}

.iti-map .leaflet-control-zoom a {
    background: var(--color-primary) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.15) !important;
    font-size: 16px !important;
}
.iti-map .leaflet-control-zoom a:hover {
    background: var(--color-orange) !important;
}
.iti-map .leaflet-control-attribution {
    background: rgba(37,35,74,0.85) !important;
    color: rgba(255,255,255,0.4) !important;
    font-size: 9px !important;
}
.iti-map .leaflet-control-attribution a {
    color: rgba(255,255,255,0.5) !important;
}

/* Panneau latéral */
.iti-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 380px;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    background: rgba(37, 35, 74, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    color: white;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.iti-panel__header {
    padding: var(--space-lg) var(--space-lg) 0;
}

.iti-panel__title {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    margin-bottom: 4px;
}

.iti-panel__sub {
    font-size: var(--fs-small);
    color: rgba(255,255,255,0.45);
}

/* Form */
.iti-panel__form {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.iti-panel__input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.iti-panel__input-wrap:focus-within {
    border-color: var(--color-orange);
    background: rgba(255,255,255,0.12);
}

.iti-panel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.iti-panel__dot--from { background: var(--color-orange); }
.iti-panel__dot--to { background: #00C9A7; }

.iti-panel__input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: white;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    padding: 12px 0;
}
.iti-panel__input::placeholder {
    color: rgba(255,255,255,0.35);
}

.iti-panel__swap {
    align-self: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.3s var(--ease-spring);
    flex-shrink: 0;
}
.iti-panel__swap:hover {
    background: var(--color-orange);
    color: white;
    border-color: var(--color-orange);
    transform: rotate(180deg);
}

.iti-panel__search {
    padding: 12px;
    background: var(--color-orange);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--fs-body);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin-top: 4px;
}
.iti-panel__search:hover {
    background: #d04030;
    transform: translateY(-1px);
}
.iti-panel__search:active {
    transform: translateY(0);
}

/* Autocomplete dropdown */
.iti-autocomplete {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(45,43,90,0.97);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 60;
    max-height: 220px;
    overflow-y: auto;
}
.iti-autocomplete-item {
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: var(--fs-small);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: background 0.12s;
}
.iti-autocomplete-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Results */
.iti-panel__results {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-lg) var(--space-lg);
}

.iti-panel__results::-webkit-scrollbar { width: 4px; }
.iti-panel__results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Route card */
.iti-route {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.iti-route:hover,
.iti-route.is-active {
    background: rgba(255,255,255,0.1);
    border-color: var(--color-orange);
}

.iti-route__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.iti-route__type {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: var(--fs-body);
    color: white;
}

.iti-route__duration {
    font-size: var(--fs-small);
    color: var(--color-orange);
    font-weight: 600;
}

.iti-route__steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.iti-route__step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-small);
    color: rgba(255,255,255,0.7);
}

.iti-route__line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    border-radius: 6px;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.iti-route__walk {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-small);
    color: rgba(255,255,255,0.4);
    padding: 2px 0;
}

.iti-route__arrow {
    color: rgba(255,255,255,0.25);
    font-size: 0.7rem;
}

/* No result */
.iti-no-result {
    text-align: center;
    padding: var(--space-lg) 0;
    color: rgba(255,255,255,0.4);
    font-size: var(--fs-body);
}

/* Popup map */
.iti-popup .leaflet-popup-content-wrapper {
    background: rgba(37,35,74,0.95);
    color: white;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: var(--fs-small);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.iti-popup .leaflet-popup-tip { background: rgba(37,35,74,0.95); }
.iti-popup .leaflet-popup-content { margin: 8px 12px; }
.iti-popup strong { display: block; margin-bottom: 2px; }

/* Mobile toggle */
.iti-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    padding: 12px 24px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--fs-body);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    gap: 8px;
    align-items: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .iti-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 85vh;
        max-height: 85dvh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(calc(100% - 140px));
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        will-change: transform;
        touch-action: none;
    }

    .iti-panel.is-expanded {
        transform: translateY(0);
    }

    .iti-panel__header {
        padding: var(--space-md) var(--space-md) 0;
        cursor: grab;
    }

    /* Drag handle — barre visible */
    .iti-panel__header::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background: rgba(255,255,255,0.25);
        border-radius: 3px;
        margin: 0 auto var(--space-sm);
    }

    .iti-panel__form {
        padding: var(--space-sm) var(--space-md);
    }

    .iti-toggle {
        display: none;
    }
}