/* mobile-bar.css — телефон (<=760px): вверху логотип и поиск, внизу фиксированный тулбар
   (All Deals · Account · Favorites · Cart). Грузится после menu-tabs.css. */
.mbar { display: none; }

@media (max-width: 760px) {
  :root { --mbar-h: 60px; }
  body { padding-bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom, 0px)); }
  body.mm-open { overflow: hidden; }

  /* Верх: логотип и поиск в один ряд. Account/Favorites/Cart уехали в нижний тулбар. */
  .hdr-top__inner { flex-wrap: nowrap !important; gap: 12px !important; padding: 10px 14px !important; }
  .hdr-top .brand--lockup { order: 1; flex: none; margin: 0 !important; }
  .hdr-top .brand__lockup { height: 30px; }
  .hdr-top__inner .search { order: 2; flex: 1 1 0; min-width: 0; max-width: none; margin: 0 !important; padding-left: var(--s4); }
  .hdr-top__inner .search input { min-width: 0; text-overflow: ellipsis; }
  .hdr-actions { display: none !important; }

  /* Белая полоса с «All Deals» ушла в тулбар; сама панель меню открывается листом над ним. */
  .hdr-nav { border: 0; box-shadow: none; min-height: 0; }
  .hdr-nav__inner { min-height: 0 !important; height: 0; padding: 0 !important; }
  .mm-trigger { display: none; }
  .mm-scrim { display: none !important; }
  .mm-panel {
    position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important;
    bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 90 !important; border: 0; border-radius: 0; box-shadow: none;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }

  /* Нижний тулбар. z-index ниже ящика фильтров каталога (100), чтобы тот перекрывал тулбар. */
  .mbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mbar__item {
    flex: 1 1 0; min-width: 0; height: var(--mbar-h);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-2); font: inherit; font-size: 11px; font-weight: 600; line-height: 1;
    background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .mbar__ico { position: relative; display: inline-flex; }
  .mbar__ico svg { width: 23px; height: 23px; }
  .mbar__item.is-active, .mbar__menu.is-open { color: var(--brand); }
  .mbar__ico-close { display: none; }
  .mbar__menu.is-open .mbar__ico-open { display: none; }
  .mbar__menu.is-open .mbar__ico-close { display: block; }
  .mbar .cart-count, .mbar .fav-count {
    position: absolute; top: -6px; left: calc(100% - 8px); right: auto;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    font-size: 10px; font-weight: 700; line-height: 1; display: grid; place-items: center;
  }
  .mbar .cart-count { background: var(--cta); color: var(--ink); }
  .mbar .fav-count { background: var(--coral); color: #fff; }
  .mbar .fav-count[hidden] { display: none; }

  /* Меню «All Deals» на телефоне: категории и бренды простым списком (строка = ссылка). */
  .mm-panel .mm-rail { display: block !important; padding: 0 !important; background: #fff; border: 0; }
  .mm-panel .mm-rail > .mm-rail__h,
  .mm-panel .mm-filter__lbl {
    display: block; padding: 12px 16px 6px !important; margin: 0;
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-3); background: var(--surface, #F1F2F5); min-height: 0;
  }
  .mm-panel .mm-cat,
  .mm-panel .mm-brand {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 11px 16px !important; margin: 0;
    border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important;
    background: #fff !important; box-shadow: none !important;
    font: inherit; font-size: 15px; font-weight: 500; line-height: 1.25; color: var(--ink); text-align: left;
  }
  .mm-panel .mm-cat.is-active, .mm-panel .mm-brand.is-on { color: var(--ink); background: #fff !important; }
  .mm-panel .mm-cat--tile .mm-cat__ico { width: 28px; height: 28px; border-radius: 8px; }
  .mm-panel .mm-cat--tile .mm-cat__lbl, .mm-panel .mm-cat { text-align: left; }
  /* Шеврон справа: у категорий — их svg, у брендов — псевдоэлемент. */
  .mm-panel .mm-cat > svg, .mm-panel .mm-cat--tile > svg { display: block !important; opacity: .45 !important; margin-left: auto; width: 14px; height: 14px; flex: none; }
  .mm-panel .mm-brand::after {
    content: ""; flex: none; margin-left: auto; width: 7px; height: 7px;
    border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); opacity: .4;
  }
  .mm-panel .mm-filter { display: block !important; margin: 0; padding: 0; border: 0; }
  .mm-panel .mm-brands { display: block !important; flex: none; gap: 0; }
  .mm-panel .mm-body { padding: 0 !important; min-height: 0; }
  .mm-panel .mm-head { padding: 16px 16px 0; }
  .mm-panel .mm-prods { padding: 0 16px 18px; }

  /* Баннер cookies садится над тулбаром, а не закрывает его. */
  .cookie-bar { bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom, 0px)); }
}
