
/*
 * VietMap Mobile Map Toolbar V9
 * Финальный override загружается после основного CSS.
 */

@media (max-width: 900px) {
  /*
   * Шапка карты:
   * строка 1 — логотип, поиск, избранное, профиль;
   * строка 2 — язык, категории и кнопка фильтров.
   */
  .vmo-map-mobile-v2__header,
  .vmo-map-mobile-v2__header--v4 {
    position: absolute !important;
    top: env(safe-area-inset-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 700 !important;

    display: block !important;
    box-sizing: border-box !important;

    width: 100% !important;
    height: 116px !important;
    min-height: 116px !important;

    margin: 0 !important;
    padding: 7px !important;

    pointer-events: none !important;
    overflow: visible !important;
  }

  .vmo-map-mobile-v2__header > *,
  .vmo-map-mobile-v2__header--v4 > * {
    pointer-events: auto !important;
  }

  .vmo-map-mobile-v2__top-line {
    position: absolute !important;
    top: 7px !important;
    left: 7px !important;
    right: 7px !important;

    box-sizing: border-box !important;
    width: auto !important;
    height: 45px !important;
    min-height: 45px !important;

    margin: 0 !important;
    transform: none !important;
  }

  /*
   * Язык — слева во второй строке.
   */
  .vmo-map-mobile-v2__language {
    position: absolute !important;
    top: 59px !important;
    left: 7px !important;
    right: auto !important;

    z-index: 715 !important;

    box-sizing: border-box !important;
    width: 94px !important;
    min-width: 94px !important;
    max-width: 94px !important;
    height: 48px !important;
    min-height: 48px !important;

    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  .vmo-map-mobile-v2__language button,
  .vmo-map-mobile-v2__language select {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
  }

  /*
   * Категории находятся между языком и фильтрами.
   */
  .vmo-map-mobile-v2__categories {
    position: absolute !important;
    top: 59px !important;
    left: 108px !important;
    right: 62px !important;

    z-index: 710 !important;

    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;

    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 48px !important;
    min-height: 48px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    transform: none !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch;
  }

  .vmo-map-mobile-v2__categories::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .vmo-map-mobile-v2__categories > *,
  .vmo-map-mobile-v2__chip {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;

    flex: 0 0 auto !important;

    box-sizing: border-box !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: 150px !important;
    height: 48px !important;
    min-height: 48px !important;

    margin: 0 !important;
    padding: 8px 12px !important;

    transform: none !important;
    white-space: nowrap !important;
  }

  /*
   * Кнопка расширенных фильтров — справа в той же строке.
   */
  .vmo-map-mobile-v2__filter-button {
    position: absolute !important;
    top: 59px !important;
    right: 7px !important;
    left: auto !important;

    z-index: 720 !important;

    box-sizing: border-box !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;

    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  /*
   * Панель фильтров.
   */
  .vmo-map-mobile-v2__filters {
    position: fixed !important;
    top:
      calc(
        env(safe-area-inset-top, 0px)
        + 122px
      ) !important;
    left: 12px !important;
    right: 12px !important;
    bottom: auto !important;

    z-index: 1202 !important;

    box-sizing: border-box !important;
    width: auto !important;
    max-width: none !important;
    max-height:
      calc(
        100dvh
        - 210px
        - env(safe-area-inset-bottom, 0px)
      ) !important;

    margin: 0 !important;
    padding: 18px 14px 14px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    border-radius: 24px !important;
    transform: none !important;
  }

  /*
   * Затемнение под открытой панелью.
   */
  .vmo-map-filter-v9-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;

    display: none;
    border: 0;
    margin: 0;
    padding: 0;

    background: rgba(7, 31, 20, 0.34);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .vmo-map-filter-v9-backdrop.is-open {
    display: block;
  }

  /*
   * Встроенная панель управления фильтрами.
   */
  .vmo-map-filter-v9-heading {
    position: sticky;
    top: -18px;
    z-index: 4;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: -18px -14px 12px;
    padding: 13px 14px;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(8, 59, 34, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .vmo-map-filter-v9-title {
    min-width: 0;
    color: #083b22;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
  }

  .vmo-map-filter-v9-close {
    display: grid;
    place-items: center;
    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    border: 1px solid #dce5e0;
    border-radius: 14px;

    background: #ffffff;
    color: #112033;

    font-size: 24px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;
  }

  .vmo-map-filter-v9-actions {
    position: sticky;
    bottom: -14px;
    z-index: 4;

    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 9px;

    margin: 14px -14px -14px;
    padding: 12px 14px 14px;

    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid rgba(8, 59, 34, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .vmo-map-filter-v9-reset,
  .vmo-map-filter-v9-apply {
    box-sizing: border-box;
    min-width: 0;
    min-height: 48px;

    border-radius: 15px;
    padding: 10px 12px;

    font-size: 15px;
    font-weight: 900;
    line-height: 1.15;

    cursor: pointer;
  }

  .vmo-map-filter-v9-reset {
    border: 1px solid #d8e2dc;
    background: #ffffff;
    color: #334155;
  }

  .vmo-map-filter-v9-apply {
    border: 1px solid #078744;
    background: #078744;
    color: #ffffff;
  }

  body.vmo-map-filter-v9-open {
    overflow: hidden !important;
  }
}

@media (max-width: 390px) {
  .vmo-map-mobile-v2__language {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
  }

  .vmo-map-mobile-v2__categories {
    left: 100px !important;
    right: 58px !important;
    gap: 5px !important;
  }

  .vmo-map-mobile-v2__filter-button {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
  }

  .vmo-map-mobile-v2__categories > *,
  .vmo-map-mobile-v2__chip {
    padding-inline: 10px !important;
    font-size: 12px !important;
  }
}
