/* Мобильный режим карты для листинга. Всё внутри @media — на ПК не влияет ни на что. */
.ure-mm-entry,
.ure-mm { display: none; }

@media (max-width: 767px) {

  /* Плавающая кнопка «Карта» внизу экрана (вариант 1А) */
  body.ure-mm-ready .ure-mm-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    left: 50%;
    bottom: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 998;            /* ниже карты (999) и шапки сайта (1000) */
    height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 2px;
    background: #3F374A;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 6px 18px rgba(40, 20, 40, 0.35);
    cursor: pointer;
  }
  html.ure-mm-open .ure-mm-entry { display: none !important; }
  body.ure-mm-filters-open .ure-mm-entry { display: none !important; }
  .ure-mm-entry svg { width: 20px; height: 20px; }

  /* Полноэкранная карта под шапкой сайта */
  html.ure-mm-open,
  html.ure-mm-open body { overflow: hidden; }

  .ure-mm.is-open {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 60px;               /* уточняется скриптом по высоте шапки */
    z-index: 999;            /* шапка сайта (.main-nav) — 1000, остаётся сверху */
    background: #AAD3DF;
    color: #2A2630;
    -webkit-tap-highlight-color: transparent;
  }
  .ure-mm *, .ure-mm *::before, .ure-mm *::after { box-sizing: border-box; }
  .ure-mm button { font-family: inherit; }

  .ure-mm__bar {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 4px 0 16px;
    background: #FFFFFF;
    border-bottom: 1px solid #E6E0E8;
    box-shadow: 0 2px 8px rgba(30, 15, 30, 0.10);
    z-index: 3;
  }
  .ure-mm__sum { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .ure-mm__sum b { font-size: 15px; font-weight: 600; }
  .ure-mm__sum span { font-size: 12px; color: #6B6570; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ure-mm__filters {
    height: 44px; padding: 0 12px; border: 0; background: transparent;
    color: #3F374A; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  }
  .ure-mm__filters svg { width: 18px; height: 18px; }

  .ure-mm__map { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; z-index: 1; }

  /* Листание страниц результатов */
  .ure-mm__pager {
    position: absolute; left: 12px; top: 64px; z-index: 2;
    display: flex; align-items: center;
    background: #FFFFFF; box-shadow: 0 2px 6px rgba(30, 15, 30, 0.18); border-radius: 2px;
    font-size: 13px; font-weight: 600;
  }
  .ure-mm__pager span { padding: 0 6px; white-space: nowrap; }
  .ure-mm__pager a {
    width: 40px; height: 36px; display: flex; align-items: center; justify-content: center;
    color: #3F374A; text-decoration: none; font-size: 18px;
  }
  .ure-mm__pager a.is-disabled { color: #C9C2CE; pointer-events: none; }

  /* Кнопка «Список» */
  .ure-mm__list {
    position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 4;
    height: 48px; padding: 0 22px; border: 0; border-radius: 2px;
    background: #3F374A; color: #FFFFFF; font-size: 15px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 6px 18px rgba(40, 20, 40, 0.35); cursor: pointer;
  }
  .ure-mm__list svg { width: 20px; height: 20px; }
  .ure-mm.has-card .ure-mm__list,
  .ure-mm.has-sheet .ure-mm__list { display: none; }

  /* Ценники и кластеры */
  .ure-pin-wrap { background: transparent; border: 0; }
  .ure-pin {
    position: absolute; left: 0; bottom: 7px; transform: translateX(-50%);
    display: block; height: 28px; line-height: 28px; padding: 0 10px;
    background: #FFFFFF; color: #3F374A; border-radius: 2px;
    font-size: 13px; font-weight: 600; white-space: nowrap;
    box-shadow: 0 2px 6px rgba(30, 15, 30, 0.3);
  }
  .ure-pin::after {
    content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px;
    margin-left: -5px; background: inherit; transform: rotate(45deg);
    box-shadow: 2px 2px 3px rgba(30, 15, 30, 0.18); z-index: -1;
  }
  .ure-pin-wrap.is-active { z-index: 1000 !important; }
  .ure-pin-wrap.is-active .ure-pin { background: #3F374A; color: #FFFFFF; }

  .ure-cl { background: transparent; border: 0; }
  .ure-cl span {
    width: 40px; height: 40px; margin: 2px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #4C233F; color: #FFFFFF; border: 3px solid #FFFFFF;
    font-size: 15px; font-weight: 700;
    box-shadow: 0 2px 8px rgba(30, 15, 30, 0.35);
    transition: transform 0.15s ease;
  }
  .ure-cl.is-active span {
    border-color: #E8973A;
    box-shadow: 0 0 0 4px rgba(232, 151, 58, 0.35), 0 2px 8px rgba(30, 15, 30, 0.35);
    transform: scale(1.15);
  }

  /* Превью объекта */
  .ure-mm__card {
    position: absolute; left: 12px; right: 12px; bottom: 16px; z-index: 5;
    background: #FFFFFF; border-radius: 2px;
    box-shadow: 0 6px 24px rgba(30, 15, 30, 0.28);
    display: none;
  }
  .ure-mm.has-card .ure-mm__card { display: block; }
  .ure-mm__card-main {
    display: flex; gap: 12px; padding: 12px 40px 0 12px;
    color: #2A2630 !important; text-decoration: none !important;
  }
  .ure-mm__ph { width: 112px; height: 112px; flex-shrink: 0; background: #E9E4EE; overflow: hidden; border-radius: 2px; }
  .ure-mm__ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ure-mm__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .ure-mm__price { font-size: 19px; font-weight: 700; line-height: 24px; }
  .ure-mm__bgn { font-size: 12px; color: #6B6570; }
  .ure-mm__title { font-size: 14px; font-weight: 500; line-height: 18px; margin-top: 6px; }
  .ure-mm__specs { font-size: 13px; line-height: 17px; color: #6B6570; }
  .ure-mm__id { font-size: 12px; color: #6B6570; }
  .ure-mm__close {
    position: absolute; right: 2px; top: 2px; width: 40px; height: 40px;
    border: 0; background: transparent; color: #6B6570; font-size: 22px; line-height: 1; cursor: pointer;
  }
  .ure-mm__nav {
    display: flex; align-items: center; height: 44px; margin-top: 8px; padding: 0 4px;
    border-top: 1px solid #F0ECF2;
  }
  .ure-mm__nav button {
    width: 40px; height: 40px; border: 0; background: transparent; color: #3F374A;
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .ure-mm__nav button:disabled { color: #C9C2CE; cursor: default; }
  .ure-mm__count { font-size: 12px; color: #6B6570; white-space: nowrap; }
  .ure-mm__more {
    margin-left: auto; height: 44px; padding: 0 12px;
    display: flex; align-items: center; gap: 4px;
    color: #3F374A !important; font-size: 14px; font-weight: 600; text-decoration: none !important;
  }

  /* Список объектов одной точки (комплекс) */
  .ure-mm__sheet {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 70%; z-index: 5;
    background: #FFFFFF; border-radius: 2px 2px 0 0;
    box-shadow: 0 -6px 24px rgba(30, 15, 30, 0.22);
    display: none; flex-direction: column;
  }
  .ure-mm.has-sheet .ure-mm__sheet { display: flex; }
  .ure-mm__sheet-head { position: relative; padding: 14px 56px 12px 16px; border-bottom: 1px solid #F0ECF2; }
  .ure-mm__sheet-head b { font-size: 18px; font-weight: 600; display: block; }
  .ure-mm__sheet-head span { font-size: 13px; color: #6B6570; }
  .ure-mm__sheet-head .ure-mm__close { top: 8px; right: 6px; width: 44px; height: 44px; }
  .ure-mm__rows { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .ure-mm__row {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 10px 12px 10px 16px; border: 0; border-bottom: 1px solid #F3EFF4;
    background: #FFFFFF; text-align: left; color: #2A2630; cursor: pointer;
  }
  .ure-mm__row .ure-mm__ph { width: 72px; height: 72px; }
  .ure-mm__row .ure-mm__info { flex-grow: 1; }
  .ure-mm__row .ure-mm__price { font-size: 16px; line-height: 20px; }
  .ure-mm__row .ure-mm__title { margin-top: 0; }

  /* Нет объектов с координатами */
  .ure-mm__empty {
    position: absolute; left: 24px; right: 24px; top: 140px; z-index: 5;
    background: #FFFFFF; border-radius: 2px; box-shadow: 0 8px 28px rgba(30, 15, 30, 0.25);
    padding: 24px 20px; text-align: center; display: none;
  }
  .ure-mm.is-empty .ure-mm__empty { display: block; }
  .ure-mm__empty b { display: block; font-size: 18px; font-weight: 600; margin-bottom: 8px; }
  .ure-mm__empty p { font-size: 14px; line-height: 20px; color: #6B6570; margin: 0 0 16px 0; }
  .ure-mm__empty button {
    height: 48px; padding: 0 24px; border: 0; border-radius: 2px;
    background: #3F374A; color: #FFFFFF; font-size: 15px; font-weight: 600; cursor: pointer;
  }
}
