/* ============================================================
   MAP-STORES: Блок "Адреса магазинов" — редизайн
   Сессия 135 (2026-04-16) — полная переверстка панели по Figma
   ============================================================ */

/* --- CSS-переменные, локальные для блока --- */
.drag-block.container.MAPS {
    --rm-map-name-size: 20px;
    --rm-map-addr-size: 14px;
    --rm-map-search-size: 14px;
    --rm-map-item-gap: 56px;
    --rm-map-divider-gap: 14px;
    --rm-map-icon-size: 56px;
    --rm-map-text-gap: 12px;
    --rm-map-panel-padding: 20px;
    --rm-map-search-radius: 27px;
    --rm-map-search-height: 50px;
    --rm-map-border-color: #BFBFBF;
    --rm-map-addr-color: #767676;
    --rm-map-name-color: #000000;
    /* Внешний бордер (карта + панель) */
    --rm-map-outer-border: #7A7A7A;
    /* Разделитель в детальной карточке */
    --rm-map-detail-divider: #f5f3f1;
    /* Цвет иконок в панели */
    --rm-map-icon-color: #404040;
    /* Маркер: дефолтное состояние */
    --rm-map-marker-default: #D9561F;
    /* Быстрый переход маркера (0.1s — специально быстрее rm-transition) */
    --rm-transition-marker: 0.1s ease-out;
    /* Кнопка «Построить маршрут» */
    --rm-map-route-btn-bg: #404040;
    --rm-map-route-block-h: 124px;
    --rm-map-route-block-shadow: 0 0 20px rgba(0, 0, 0, 0.102);
    /* Фон ссылок навигатора */
    --rm-map-nav-link-bg: #f5f3f1;
    /* Цена в карточке слайдера — между xs(12) и sm(14) */
    --rm-map-price-size: 13px;
}

/* ============================================================
   БАЗОВЫЕ СБРОСЫ БЛОКА
   ============================================================ */

.drag-block.container.MAPS {
    margin: 0 0 var(--rm-spacing-4xl);
}
.drag-block.container.MAPS .content_wrapper_block > .maxwidth-theme {
    padding-top: 0;
}

/* Убираем Aspro top_block — заголовок рендерим сами выше */
.drag-block.container.MAPS .wrapper_block.title_left > .top_block {
    display: none;
}

/* Заголовок секции над картой */
.drag-block.container.MAPS .rm-map-stores__title {
    margin: 0 0 var(--rm-spacing-lg);
    font-family: var(--rm-font-main);
    font-size: var(--rm-font-size-3xl);
    font-weight: var(--rm-font-weight-medium);
    color: var(--rm-text);
    line-height: 1.15;
}

/* ============================================================
   ПОЗИЦИЯ ПАНЕЛИ: вправо, 453px
   ============================================================ */

/* Панель адресов: вправо, 453px */
.drag-block.container.MAPS .wrapper_block.title_left .block_container {
    left: auto;
    right: 0;
    width: 453px;
    height: 688px;
    border: none !important; /* !important: Aspro .block_container имеет border через inline-style */
    box-shadow: none;
    /* Сброс Aspro-стилей */
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: var(--rm-bg);
    overflow: hidden;
}

/* Общая обёртка: единый бордер вокруг карты + панели */
.drag-block.container.MAPS .rm-map-stores__outer {
    border: 1px solid var(--rm-map-outer-border);
    border-radius: var(--rm-radius);
    overflow: hidden;
    position: relative;
}

/* Карта: убираем левый отступ Aspro, добавляем правый под панель */
.drag-block.container.MAPS .wrapper_block.title_left + .contacts_map_list {
    padding-left: 0;
    padding-right: 453px;
    padding-bottom: 0;
}

/* Вплотную к краям */
.drag-block.container.MAPS .wrapper_block.title_left + .contacts_map_list .contacts_map {
    margin-left: 0;
    margin-right: 0;
    min-height: 688px;
}

/* Сброс Aspro box-shadow на block_container */
body .drag-block.container.MAPS .with_title .block_container {
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.06);
    border-right-width: 0;
}

/* ============================================================
   ПОИСКОВАЯ СТРОКА
   ============================================================ */

.drag-block.container.MAPS .rm-map-stores__search-header {
    flex-shrink: 0;
    background: var(--rm-bg);
    padding: var(--rm-spacing-xl) !important; /* !important: Aspro .block_container обнуляет padding дочерних блоков */
    margin: 0 !important;                      /* !important: Aspro .items задаёт margin через cascade */
}

.rm-map-stores__search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--rm-map-search-height);
    border: 1px solid var(--rm-map-border-color);
    border-radius: var(--rm-map-search-radius);
    padding: 0 20px;
    background: var(--rm-bg);
    transition: border-color var(--rm-transition);
}

.rm-map-stores__search:focus-within {
    border-color: var(--rm-primary);
}

.rm-map-stores__search-icon {
    flex-shrink: 0;
    display: block;
}

/* !important: Aspro применяет агрессивные стили к input внутри .block_container через высокую специфичность */
.rm-map-stores__search-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: var(--rm-map-search-size);
    color: var(--rm-text) !important;
    font-family: var(--rm-font-main);
    height: auto !important;
    min-width: 0;
    padding: 0 !important;
}

.rm-map-stores__search-input::placeholder {
    color: var(--rm-map-border-color);
}

/* ============================================================
   СПИСОК МАГАЗИНОВ
   ============================================================ */

/* Сброс Aspro-стилей на .items */
.drag-block.container.MAPS .with_title .block_container .items {
    height: auto;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.rm-map-stores__list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 24px;
    /* Скроллбар */
    scrollbar-width: thin;
    scrollbar-color: var(--rm-border) transparent;
}

.rm-map-stores__list::-webkit-scrollbar {
    width: 4px;
}
.rm-map-stores__list::-webkit-scrollbar-track {
    background: transparent;
}
.rm-map-stores__list::-webkit-scrollbar-thumb {
    background: var(--rm-border);
    border-radius: 2px;
}

.rm-map-stores__items-inner {
    /* Сброс Aspro .items-inner */
}

/* ============================================================
   ЭЛЕМЕНТ СПИСКА (item-wrap = item + divider)
   ============================================================ */

.rm-map-stores__item-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--rm-map-divider-gap);
    margin-bottom: var(--rm-map-item-gap);
}

/* Сам элемент */
.drag-block.container.MAPS .with_title .block_container .items .item.rm-map-stores__item {
    /* Сброс Aspro-стилей на .item */
    padding: 0 32px;
    border-bottom: none;
    border-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: transparent;
    transition: background var(--rm-transition);
}

.drag-block.container.MAPS .with_title .block_container .items .item.rm-map-stores__item:hover {
    background: transparent;
}

/* Иконка */
.rm-map-stores__item-icon {
    flex-shrink: 0;
    width: var(--rm-map-icon-size);
    height: var(--rm-map-icon-size);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rm-map-stores__item-icon svg {
    display: block;
    width: var(--rm-map-icon-size);
    height: var(--rm-map-icon-size);
}

/* Текстовая часть */
.rm-map-stores__item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--rm-map-text-gap);
    min-width: 0;
    padding-top: 4px;
}

/* Название магазина */
.rm-map-stores__item-name {
    font-size: var(--rm-map-name-size);
    font-weight: var(--rm-font-weight-medium);
    color: var(--rm-map-name-color);
    line-height: 1.2;
    font-family: var(--rm-font-main);
}

/* Адрес */
.rm-map-stores__item-addr {
    font-size: var(--rm-map-addr-size);
    color: var(--rm-map-addr-color);
    line-height: var(--rm-line-height-tight);
    font-family: var(--rm-font-main);
}

/* Телефон */
.rm-map-stores__item-phones {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rm-map-stores__item-phone {
    font-size: var(--rm-map-addr-size);
    color: var(--rm-map-addr-color);
    text-decoration: none;
    transition: color var(--rm-transition);
}

.rm-map-stores__item-phone:hover {
    color: var(--rm-primary);
}

/* Разделитель: 453 - 32 - 32 = 389px */
.rm-map-stores__divider {
    height: 1px;
    background: var(--rm-secondary);
    margin: 0 32px;
    flex-shrink: 0;
}

/* Сообщение "не найдено" */
.rm-map-stores__no-results {
    padding: 20px var(--rm-map-panel-padding);
    font-size: var(--rm-map-addr-size);
    color: var(--rm-map-addr-color);
}

/* ============================================================
   DETAIL_ITEMS — карточка магазина при клике
   ============================================================ */

/* Общий шрифт блока + паддинг */
.drag-block.container.MAPS .with_title .block_container .detail_items .map_info_store,
.drag-block.container.MAPS .with_title .block_container .detail_items .map_info_store * {
    font-family: var(--rm-font-main);
}

.drag-block.container.MAPS .with_title .block_container .detail_items .map_info_store {
    padding: 30px 34px 0;
}

/* Адрес: 16px, чёрный, отступ сверху */
.drag-block.container.MAPS .with_title .block_container .detail_items .rm-detail-addr {
    font-size: var(--rm-font-size-base);
    color: var(--rm-text);
    line-height: var(--rm-line-height-tight);
    margin-top: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rm-map-detail-divider);
}

/* Метки полей (title-prop) — скрыты */
.drag-block.container.MAPS .with_title .block_container .detail_items .title-prop.font_upper.muted {
    display: none;
}

/* Кнопка "Написать сообщение" — скрыта временно */
.drag-block.container.MAPS .with_title .block_container .detail_items .buttons_block {
    display: none;
}

/* Строка телефона: иконка + номер */
.rm-detail-phone-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Иконка телефона */
.rm-detail-phone-icon {
    flex-shrink: 0;
    display: block;
    width: 20px;
    height: 20px;
    fill: var(--rm-map-icon-color);
}

/* Номера телефонов: font-weight medium + hover */
.drag-block.container.MAPS .with_title .block_container .detail_items .property.phone .value a {
    font-weight: var(--rm-font-weight-medium);
    transition: opacity var(--rm-transition);
}

.drag-block.container.MAPS .with_title .block_container .detail_items .property.phone .value a:hover {
    opacity: var(--rm-hover-opacity);
    color: inherit !important; /* !important: перебивает dark_link Aspro */
}

/* Название магазина в заголовке карточки + hover */
.drag-block.container.MAPS .with_title .block_container .detail_items .rm-detail-title-row .dark_link {
    font-size: var(--rm-font-size-base);
    margin-top: 1px;
    transition: opacity var(--rm-transition);
}

.drag-block.container.MAPS .with_title .block_container .detail_items .rm-detail-title-row .dark_link:hover {
    opacity: var(--rm-hover-opacity);
    color: inherit !important; /* !important: перебивает dark_link Aspro */
}

/* Слово «Ежедневно» — серый, обычный вес */
.rm-schedule-daily {
    color: var(--rm-text-muted);
    font-weight: var(--rm-font-weight-normal);
}

/* Время после «Ежедневно» — полужирный */
.rm-schedule-time {
    font-weight: var(--rm-font-weight-medium);
}

.drag-block.container.MAPS .with_title .block_container .detail_items {
    width: 100%;
    left: 0;
    background: var(--rm-bg);
    overflow-y: auto;
}

.drag-block.container.MAPS .with_title .block_container .detail_items .rm-detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drag-block.container.MAPS .with_title .block_container .detail_items .top-close.rm-detail-back {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    margin: 0;
    padding: 0;
    color: var(--rm-map-icon-color);
    cursor: pointer;
    line-height: 0;
}

.drag-block.container.MAPS .with_title.title_left .block_container .detail_items .top-close.rm-detail-back svg,
.drag-block.container.MAPS .with_title .block_container .detail_items .top-close.rm-detail-back svg {
    width: 25px !important;
    height: 25px !important;
    display: block;
}

.drag-block.container.MAPS .with_title .block_container .detail_items .top-close.rm-detail-back *,
.drag-block.container.MAPS .with_title .block_container .detail_items .top-close.rm-detail-back:not(:hover) * {
    fill: none !important;
}

.drag-block.container.MAPS .with_title .block_container .detail_items .top-close.rm-detail-back circle,
.drag-block.container.MAPS .with_title .block_container .detail_items .top-close.rm-detail-back path {
    stroke: currentColor !important;
}

/* ============================================================
   МАРКЕРЫ НА КАРТЕ
   ============================================================ */

.rm-map-marker {
    position: relative;
    cursor: pointer;
}

.rm-map-marker__circle {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--rm-map-marker-default);
    transition: transform var(--rm-transition-marker), background-color var(--rm-transition-marker);
}

.rm-map-marker__pointer {
    position: absolute;
    bottom: 0;
    z-index: 1;
    width: 46px;
    fill: var(--rm-map-marker-default);
    transition: fill var(--rm-transition-marker);
}

.rm-map-marker.rm-active .rm-map-marker__circle {
    background-color: var(--rm-primary);
    transform: translateY(-12px);
}

.rm-map-marker.rm-active .rm-map-marker__pointer {
    fill: var(--rm-primary);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 991px) {
    .drag-block.container.MAPS .wrapper_block.title_left .block_container {
        left: auto;
        right: auto;
        width: 100%;
        height: auto;
        max-height: 350px;
        box-shadow: none;
        border-left-width: 0;
        border-bottom-width: 1px;
        position: static;
        display: flex;
        flex-direction: column;
    }
    .drag-block.container.MAPS .wrapper_block.title_left + .contacts_map_list {
        padding-right: 0;
    }
    .drag-block.container.MAPS .with_title .block_container .items {
        max-height: 260px;
    }
    .drag-block.container.MAPS .contacts_map_list {
        padding-bottom: 0;
    }
}

@media (max-width: 767px) {
    .drag-block.container.MAPS .contacts_map {
        min-height: 320px;
    }
    .drag-block.container.MAPS .wrapper_block.title_left .block_container {
        max-height: 280px;
    }
    .rm-map-stores__search {
        margin: 12px 16px 0;
    }
    .rm-map-stores__list {
        padding-top: 20px;
    }
    .drag-block.container.MAPS .with_title .block_container .items.rm-map-stores__list .item.rm-map-stores__item {
        padding: 0 16px;
    }
    .rm-map-stores__divider {
        margin: 0 16px;
    }
}

/* ======= Кнопка Построить маршрут ======= */
.rm-route-wrap {
    margin-top: 40px;
}

.rm-route-btn {
    display: block;
    width: 100%;
    background: var(--rm-map-route-btn-bg);
    color: var(--rm-bg);
    font-family: var(--rm-font-main);
    font-size: var(--rm-font-size-base);
    font-weight: var(--rm-font-weight-medium);
    line-height: var(--rm-line-height-tight);
    border: none;
    border-radius: var(--rm-radius);
    padding: 14px 20px;
    cursor: pointer;
    transition: opacity var(--rm-transition);
    text-align: center;
}

.rm-route-btn:hover {
    opacity: 0.85;
}

/* Блок выбора навигатора — вырывается за паддинг .map_info_store (34px л/п) */
.rm-route-block {
    background: var(--rm-bg);
    height: var(--rm-map-route-block-h);
    padding: 20px 34px;
    box-shadow: var(--rm-map-route-block-shadow);
    margin-left: -34px;
    margin-right: -34px;
}

.rm-route-block__title {
    font-family: var(--rm-font-main);
    font-size: var(--rm-font-size-base);
    font-weight: var(--rm-font-weight-medium);
    color: var(--rm-text);
    margin-bottom: 15px;
}

.rm-route-block__actions {
    display: flex;
    gap: 15px;
}

.rm-route-block__link {
    flex: 1;
    display: block;
    background: var(--rm-map-nav-link-bg);
    color: var(--rm-text) !important; /* !important: перебивает dark_link Aspro */
    text-align: center;
    padding: 10px 8px;
    border-radius: var(--rm-radius-sm);
    font-family: var(--rm-font-main);
    font-size: var(--rm-font-size-sm);
    font-weight: var(--rm-font-weight-normal);
    text-decoration: none !important; /* !important: dark_link Aspro добавляет underline */
    transition: background var(--rm-transition), color var(--rm-transition);
}

.rm-route-block__link:hover {
    background: var(--rm-primary);
    color: var(--rm-bg) !important; /* !important: аналогично dark_link */
}
