.route-map-page {
    --route-panel-bg: #f5f7fa;
    --route-panel-border: rgba(80, 96, 110, 0.16);
    --route-panel-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
    --route-muted: #536170;
    --route-text: #1b2430;
    --route-accent: #d63b2f;
    --route-accent-dark: #a62b25;
    --route-dash: #aeb9c2;
    --route-map-bg: #edf2f6;
    --route-card: #ffffff;
    --route-surface: rgba(255, 255, 255, 0.96);
    --route-surface-border: rgba(80, 96, 110, 0.14);
    --route-surface-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    --route-surface-shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.08);
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #f7f9fb, #edf2f6 52%, #eef4f7);
}

.route-map-page--rtl {
    direction: rtl;
}

.route-map-page--mobile-shell {
    min-height: 100vh;
    padding: 0;
}

.route-map-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 70;
    border: 0;
    border-radius: 6px;
    padding: 11px 18px;
    background: var(--route-accent);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(162, 31, 23, 0.25);
    font-weight: 700;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.route-map-page.is-panel-open .route-map-panel-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

.route-map-page--rtl .route-map-panel-toggle {
    left: auto;
    right: 20px;
}

.route-map-panel {
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 16px;
    width: min(92vw, 370px);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border-radius: 6px;
    background: linear-gradient(160deg, rgba(255, 252, 249, 0.97), rgba(249, 240, 234, 0.93));
    border: 1px solid var(--route-panel-border);
    box-shadow: var(--route-panel-shadow);
    backdrop-filter: blur(14px);
    overflow: hidden;
    transform: translateX(0);
    transition: transform 0.22s ease;
}

.route-map-page:not(.is-panel-open) .route-map-panel {
    transform: translateX(calc(-100% - 24px));
    pointer-events: none;
}

.route-map-page--rtl .route-map-panel {
    left: auto;
    right: 16px;
}

.route-map-page--rtl:not(.is-panel-open) .route-map-panel {
    transform: translateX(calc(100% + 24px));
}

.route-map-panel__header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.route-map-panel__header {
    /* padding: 12px 12px 14px; */
    border-radius: 5px;
    /* background: var(--route-surface);
    border: 1px solid var(--route-surface-border);
    box-shadow: var(--route-surface-shadow-soft); */
}

.route-map-panel-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 5px;
    font-size: 24px;
    line-height: 1;
    color: var(--route-text);
    background: rgba(92, 78, 67, 0.14);
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.route-map-panel-close:hover,
.route-map-panel-close:focus-visible {
    background: rgba(92, 78, 67, 0.2);
    transform: scale(1.04);
    outline: none;
}

.route-map-panel__header h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    color: var(--route-text);
    font-weight: 800;
}

.route-map-panel__header p {
    margin: 8px 0 0;
    color: var(--route-muted);
    line-height: 1.5;
    font-size: 14px;
}

.route-map-panel__search {
    width: 100%;
    border: 1px solid var(--route-surface-border);
    border-radius: 5px;
    background: var(--route-surface);
    color: var(--route-text);
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--route-surface-shadow-soft);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.route-map-panel__search::placeholder {
    color: #8f8176;
}

.route-map-panel__search:focus {
    outline: 2px solid rgba(203, 47, 36, 0.15);
    border-color: rgba(203, 47, 36, 0.34);
    box-shadow: 0 10px 22px rgba(162, 31, 23, 0.14);
    transform: translateY(-1px);
}

.route-map-panel__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.route-map-stat {
    padding: 12px 14px;
    border-radius: 5px;
    background: var(--route-surface);
    border: 1px solid var(--route-surface-border);
    box-shadow: var(--route-surface-shadow-soft);
}

.route-map-stat strong,
.route-map-stat span {
    display: block;
}

.route-map-stat strong {
    color: var(--route-text);
    font-size: 20px;
}

.route-map-stat span {
    color: var(--route-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.route-map-panel__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 4px 2px 2px;
}

.route-map-page--rtl .route-map-panel__list {
    padding-right: 0;
    padding-left: 4px;
}

.route-map-panel__list::-webkit-scrollbar {
    width: 8px;
}

.route-map-panel__list::-webkit-scrollbar-thumb {
    background: rgba(92, 78, 67, 0.18);
    border-radius: 999px;
}

.route-map-airport {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--route-surface-border);
    border-radius: 5px;
    background: var(--route-surface);
    text-align: left;
    cursor: pointer;
    box-shadow: var(--route-surface-shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.route-map-page--rtl .route-map-airport {
    text-align: right;
}

.route-map-airport:hover,
.route-map-airport:focus-visible,
.route-map-airport.is-active {
    transform: translateY(-1px);
    border-color: rgba(203, 47, 36, 0.36);
    box-shadow: var(--route-surface-shadow);
    outline: none;
}

.route-map-airport.is-active {
    background: linear-gradient(120deg, rgba(255, 242, 237, 0.95), rgba(255, 249, 246, 0.96));
}

.route-map-airport__code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 8px 10px;
    border-radius: 5px;
    background: rgba(203, 47, 36, 0.1);
    color: var(--route-accent-dark);
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 12px;
}

.route-map-airport__body {
    flex: 1;
    min-width: 0;
}

.route-map-airport__name {
    display: block;
    font-size: 15px;
    color: var(--route-text);
    font-weight: 700;
    line-height: 1.35;
}

.route-map-airport__meta,
.route-map-airport__region {
    display: block;
    color: var(--route-muted);
    font-size: 12px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-map-canvas {
    position: relative;
    width: 100%;
    height: 650px;
    min-width: 0;
}

.route-map-map {
    width: 100%;
    height: 650px;
    min-height: 650px;
    border-radius: 0;
    overflow: hidden;
    border: 0;
    box-shadow: none;
    background: var(--route-map-bg);
}

.route-map-map .leaflet-control-attribution,
.route-map-map .leaflet-control-zoom a {
    border-radius: 12px !important;
}

.route-map-map .mapboxgl-ctrl-group,
.route-map-map .mapboxgl-ctrl-attrib {
    border-radius: 5px;
}

.route-map-airport-marker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.route-map-airport-marker__dot {
    position: relative;
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--route-accent);
    border: 3px solid rgba(255, 255, 255, 0.98);
    box-shadow: 0 0 0 4px rgba(214, 59, 47, 0.14);
}

.route-map-airport-marker.is-selected .route-map-airport-marker__dot {
    background: #1b2430;
    box-shadow: 0 0 0 5px rgba(27, 36, 48, 0.12);
}

.route-map-popup {
    min-width: 240px;
    padding: 14px;
    border-radius: 5px;
    background: var(--route-surface);
    border: 1px solid var(--route-surface-border);
    box-shadow: var(--route-surface-shadow);
}

.route-map-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 5px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.route-map-leaflet-popup .leaflet-popup-content {
    margin: 0;
}

.route-map-leaflet-popup .leaflet-popup-tip {
    background: var(--route-surface);
    border: 1px solid var(--route-surface-border);
}

.route-map-gl-popup .mapboxgl-popup-content {
    padding: 0;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
}

.route-map-gl-popup .mapboxgl-popup-tip {
    border-top-color: var(--route-surface);
}

.route-map-popup__eyebrow {
    margin: 0 0 8px;
    color: var(--route-accent-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.route-map-popup__title {
    margin: 0;
    color: var(--route-text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.route-map-popup__subtitle {
    margin: 6px 0 0;
    color: var(--route-muted);
    font-size: 13px;
}

.route-map-popup__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.route-map-popup__meta-label {
    display: block;
    margin-bottom: 4px;
    color: var(--route-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.route-map-popup__meta-value {
    color: var(--route-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
}

.route-map-popup__meta-value a {
    color: var(--route-accent-dark);
    text-decoration: none;
}

.route-map-popup__meta-value a:hover {
    text-decoration: underline;
}

.route-map-empty {
    padding: 18px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--route-muted);
    text-align: center;
    font-size: 14px;
}

@keyframes routeMapPulse {
    0% {
        transform: scale(0.82);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.85);
        opacity: 0;
    }
}

@media (max-width: 991px) {
    .route-map-page {
        height: auto;
        min-height: 0;
    }

    .route-map-panel {
        top: 0;
        bottom: 0;
        left: 0;
        width: min(88vw, 360px);
        max-width: 100%;
        border-radius: 0 5px 5px 0;
    }

    .route-map-page--rtl .route-map-panel {
        left: auto;
        right: 0;
        border-radius: 5px 0 0 5px;
    }

    .route-map-map {
        min-height: 420px;
        height: 420px;
    }

    .route-map-panel-toggle {
        top: 16px;
        bottom: auto;
        left: 16px;
    }

    .route-map-page--rtl .route-map-panel-toggle {
        left: auto;
        right: 16px;
    }
}

@media (max-width: 640px) {
    .route-map-panel {
        width: min(94vw, 340px);
        padding: 14px;
    }

    .route-map-panel__header h1 {
        font-size: 24px;
    }

    .route-map-panel__stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .route-map-canvas {
        height: 560px;
    }

    .route-map-map {
        min-height: 560px;
        height: 560px;
    }
}