/**
 * Стили для карты OSM объектов
 */
:root {
    --shop-color: #1E98FF;
    --medical-color: #1BAD03;
    --education-color: #B51EFF;
    --entertainment-color: #F371D1;
    --food-color: #FF931E;
    --sport-color: #82CDFF;
}

.osm-map-container {
    width: 100%;
    margin: 20px 0;
}

.osm-map-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: var(--radius-m);
    overflow: clip;
}

/* Overlay слой для блокировки взаимодействия с картой */
.osm-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    cursor: pointer;
    pointer-events: all;
}

/* Элементы управления масштабом - отступ справа */
.osm-map-wrapper .osm-yandex-controls,
.osm-map-wrapper .ymaps3x0--controls {
    padding: 0 var(--space-m);
}

/* Кнопка блокировки/разблокировки карты */
.osm-map-lock-btn {
    position: absolute;
    top: var(--space-m);
    right: var(--space-m);
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: var(--black);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 .3rem .8rem rgb(from var(--shadow-default, #282829) r g b / 12%), 0 .3rem .1rem rgb(from var(--shadow-default, #282829) r g b / 4%);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.osm-map-lock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 .4rem 1rem rgb(from var(--shadow-default, #282829) r g b / 15%), 0 .4rem .2rem rgb(from var(--shadow-default, #282829) r g b / 6%);
}

.osm-map-lock-btn:active {
    transform: translateY(0);
}

.osm-lock-icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    background-color: var(--white);
    mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    color: var(--neutral);
}

.osm-map-lock-btn.unlocked {
    background-color: var(--white);
}


.osm-map-lock-btn.locked .osm-lock-icon {
    mask-image: url(../icons/lock-icon.svg);
    -webkit-mask-image: url(../icons/lock-icon.svg);
}

.osm-map-lock-btn.unlocked .osm-lock-icon {
    background-color: var(--black);
    mask-image: url(../icons/lock-open.svg);
    -webkit-mask-image: url(../icons/lock-open.svg);
}

.osm-map-canvas {
    width: 100%;
    height: 100%;
}

.osm-map-filters {
    position: absolute;
    bottom: var(--space-m);
    left: 50%;
    z-index: 1000;
    transform: translateX(-50%);
}

.osm-filters-list {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-xs);
    background: var(--neutral-ultra-light);
    padding: 2px;
    border-radius: var(--radius-xxl);
    justify-content: center;
    align-items: stretch;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.osm-filter-btn {
    display: flex;
    align-items: center;
    gap: .25em;
    padding: .5rem 1rem;
    background: transparent;
    border: 2px none #e0e0e0;
    border-radius: var(--radius-xxl);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--text-s);
    font-weight: 500;
    color: var(--neutral);
    white-space: nowrap;
}

.osm-filter-btn:hover {
    border-color: var(--white);
    background: var(--white);
}

.osm-filter-btn.active {
    background: var(--white);
    border-color: var(--white);
    box-shadow: 0 .3rem .8rem rgb(from var(--shadow-default, #282829) r g b / 12%), 0 .3rem .1rem rgb(from var(--shadow-default, #282829) r g b / 4%);
}

.osm-filter-btn.active:hover {
    background: var(--white);
    border-color: var(--white);
}

.osm-filter-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
}

/* Стилизация цвета иконки по категориям */
.osm-filter-btn[data-category="products"] .osm-filter-icon {
    mask-image: url(../icons/products.svg);
    -webkit-mask-image: url(../icons/products.svg);
    color: var(--shop-color);
}

.osm-filter-btn[data-category="sport"] .osm-filter-icon {
    mask-image: url(../icons/sport.svg);
    -webkit-mask-image: url(../icons/sport.svg);
    color: var(--sport-color);
}

.osm-filter-btn[data-category="education"] .osm-filter-icon {
    mask-image: url(../icons/education.svg);
    -webkit-mask-image: url(../icons/education.svg);
    color: var(--education-color);
}

.osm-filter-btn[data-category="entertainment"] .osm-filter-icon {
    mask-image: url(../icons/entertainment.svg);
    -webkit-mask-image: url(../icons/entertainment.svg);
    color: var(--entertainment-color);
}

.osm-filter-btn[data-category="food"] .osm-filter-icon {
    mask-image: url(../icons/food.svg);
    -webkit-mask-image: url(../icons/food.svg);
    color: var(--food-color);
}

.osm-filter-btn[data-category="medicine"] .osm-filter-icon {
    mask-image: url(../icons/medicine.svg);
    -webkit-mask-image: url(../icons/medicine.svg);
    color: var(--medical-color);
}

.osm-filter-text {
    font-size: var(--text-s);
    line-height: 0.8;
    transform: translateY(.1em);
}

.osm-filter-count {
    font-size: var(--text-xs);
    font-weight: 400;
    text-align: center;
    line-height: .5;
    transform: translateY(.15em);
}

.osm-map-error {
    padding: 20px;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.osm-map-no-objects {
    padding: 15px;
    background: #fff3e0;
    color: #e65100;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .osm-map-wrapper {
        height: 500px;
    }

    .osm-filters-list {
        gap: var(--space-s);
        justify-content: flex-start;
    }

    .osm-filter-text {
        display: none;
        /* Скрываем текст на очень маленьких экранах */
    }

    .osm-filter-btn {
        padding: 8px 12px;
        font-size: var(--text-s);
    }

    .osm-filter-icon {
        font-size: 1em;
    }

    .osm-filter-text {
        font-size: var(--text-s);
    }

    .osm-filter-count {
        padding: 2px 6px;
        font-size: var(--text-xs);
    }
}

@media (max-width: 480px) {
    .osm-map-filters {
        width: 100%;
    }

    .osm-map-wrapper {
        height: 500px;
    }

    .osm-filters-list {
        gap: 0;
        justify-content: flex-start;
    }

    .osm-filter-btn {
        padding: 6px 10px;
        font-size: var(--text-s);
        gap: 6px;
    }

    .osm-filter-text {
        display: none;
        /* Скрываем текст на очень маленьких экранах */
    }

    .osm-filter-btn .osm-filter-text+.osm-filter-count {
        margin-left: 0;
    }
}

/* Стили для скроллбара фильтров */
.osm-filters-list::-webkit-scrollbar {
    height: 4px;
}

.osm-filters-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.osm-filters-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.osm-filters-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}