/* ========================================
RESET / BASE
======================================== */

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: #ffffff;
}



/* ========================================
HEADER КАРТЫ
фиксированный сверху
стеклянный как на главной
======================================== */

.map-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    /* прозрачный градиент как на главной */
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.30) 0%,
            rgba(0, 0, 0, 0.15) 40%,
            rgba(0, 0, 0, 0.08) 70%,
            rgba(0, 0, 0, 0.00) 100%);

    z-index: 1000;
    border-bottom: none;
}



/* ========================================
ВЕРХНЯЯ ПАНЕЛЬ
назад + язык
======================================== */

.map-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    min-width: 0;
}



/* ========================================
КНОПКА НАЗАД
glass стиль
======================================== */

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    height: 40px;
    background: rgba(0, 0, 0, 0.10);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    border: 1px solid rgba(255, 255, 255, 0.35);

    padding: 0px 16px;
    border-radius: 20px;

    font-size: 18px;
    text-decoration: none;
    color: white;
    font-weight: 400;
}

/* ========================================
SEARCH
поиск по карте
glass стиль как кнопки
======================================== */

.map-search {
    display: flex;
    align-items: center;
    gap: 8px;

    flex: 1 1 auto;

    min-width: 0;

    margin: 0 8px;
    padding: 12px 14px;

    background: rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;

    color: white;
}


/* иконка поиска */

.map-search-icon {
    width: 14px;
    height: 14px;

    filter: brightness(0) invert(1);

    opacity: 0.8;
}


/* input поиска */

.map-search-input {
    flex: 1;
    min-width: 0;

    background: transparent;
    border: none;
    outline: none;

    color: white;
    font-size: 14px;

    font-weight: 500;
}


/* placeholder */

.map-search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}



/* ========================================
LANGUAGE DROPDOWN
======================================== */

.language-dropdown {
    position: relative;
    z-index: 2000;
}


/* кнопка языка*/
.language-button {
    width: 90px;
    background: rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    border: 1px solid rgba(255, 255, 255, 0.35);
    height: 40px;
    padding: 0px 16px;
    border-radius: 18px;
    font-size: 18px;
    cursor: pointer;
    font-weight: 400;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
}


/* иконка языка */

.lang-icon {
    width: 16px;
    height: 16px;

    filter: brightness(0) invert(1);

    opacity: 0.95;
}



/* выпадающее меню */

.language-menu {
    position: absolute;
    width: 80px;
    right: 0;
    top: 42px;
    z-index: 2100;

    background: rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.35);

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.15);

    display: none;
    flex-direction: column;
    overflow: hidden;
    font-size: 18px;
    font-weight: 400;
    color: white;
}

.language-menu span {
    padding: 10px 16px;
    cursor: pointer;
    color: white;
    text-align: center;
}

.language-menu span:hover {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(2px);
}




/* ========================================
ФИЛЬТРЫ КАРТЫ
glass стиль
======================================== */

.map-filters {
    display: flex;
    gap: 10px;

    padding: 10px 16px 16px 16px;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.map-filters::-webkit-scrollbar {
    display: none;
    /* Chrome / Safari */
}

/* кнопки фильтра */

.map-filters button {
    border: 1px solid rgba(255, 255, 255, 0.35);

    background: rgba(0, 0, 0, 0.10);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    padding: 10px 16px;
    border-radius: 20px;

    font-size: 16px;
    cursor: pointer;

    white-space: nowrap;

    color: white;
    font-weight: 400;
}



/* активная кнопка */

.map-filters button.active {
    border: 1px solid rgb(133, 0, 18);

    background: #680009b0;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    padding: 10px 16px;
    border-radius: 20px;

    font-size: 16px;
    cursor: pointer;

    white-space: nowrap;

    color: white;
    font-weight: 500;
}



/* ========================================
КАРТА
======================================== */

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
}

/* ========================================
КЛАСТЕР MARKER
======================================== */

.mapboxgl-marker.cluster-marker {
    background: white;
    border: 3px solid #7a1f2b;

    border-radius: 50%;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 600;
    color: #7a1f2b;
    font-size: 14px;
}

/* ========================================
POPUP
стеклянный белый popup карты
======================================== */

.mapboxgl-popup-content {
    background: rgba(255, 255, 255, 0.5) !important;

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    border-radius: 16px !important;

    border: 1px solid rgba(255, 255, 255, 1);

    padding: 16px !important;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.12),
        0 20px 40px rgba(0, 0, 0, 0.10) !important;
}



/* убираем черный треугольник */
.mapboxgl-popup-tip {
    border-top-color: rgba(255, 255, 255, 0.92) !important;
    border-bottom-color: rgba(255, 255, 255, 0.92) !important;
}



/* контент popup */

.custom-popup h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111;
}

.custom-popup p {
    margin: 0 0 14px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #444;
}

.custom-popup a {
    display: inline-block;

    padding: 8px 14px;
    background: #7a1f2b;

    color: white !important;
    font-size: 13px;

    border-radius: 10px;
    text-decoration: none;
}



/* картинка */

.popup-image {
    width: 100%;
    height: auto;

    border-radius: 12px;
    margin-bottom: 10px;

    object-fit: cover;
}


/* ========================================
MAPBOX CONTROLS
======================================== */

/* убираем сверху */
.mapboxgl-ctrl-top-right {
    top: auto;
    right: 10px;
    bottom: 40px;
}

/* контейнер контролов */
.mapboxgl-ctrl-group {
    border-radius: 14px !important;
    overflow: hidden;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* кнопки zoom + compass */
.mapboxgl-ctrl-group>button {
    width: 38px;
    height: 38px;
}


/* кнопка 3D */
.mapbox-3d-btn {
    font-size: 12px;
    font-weight: 600;
}

/* активная */
.mapboxgl-ctrl button.active {
    background: #7a1f2b;
    color: white;
}

/* отступ от фильтров */
@media (max-width:768px) {
    .mapboxgl-ctrl-top-right {
        bottom: 40px;
    }
}

/* ========================================
DESKTOP
======================================== */

@media (min-width:900px) {


    .map-topbar .back-button {
        order: 1;
    }

    .map-topbar .language-dropdown {
        order: 2;
    }

    .map-topbar .map-search {
        order: 3;
    }

    .map-header {
        display: flex;
        align-items: center;
        padding: 10px 20px;
        position: fixed;
    }

    /* ========================================
DESKTOP SEARCH POSITION
между языком и фильтрами
======================================== */

    .map-search {
        width: 300px;
        max-width: 300px;
        margin: 0;
        position: absolute;
        left: 40%;
        transform: translateX(-50%);
    }

    .map-topbar {
        display: flex;
        align-items: center;
        padding: 0;
        gap: 20px;
    }

    .map-filters {
        padding: 0;
        margin-left: auto;
    }

    #map {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
    }

}