/* Геометрия и цвета нижней панели preview; селекторы native шапки и sticky buy не меняются */
:root { --st-mobile-nav-height: 0px; }
#st-mobile-bottom-navigation,
#st-mobile-navigation-spacer { display: none; }

@media (max-width: 992px) {
  html.st-mobile-navigation-ready { --st-mobile-nav-height: calc(64px + env(safe-area-inset-bottom, 0px)); }
  #st-mobile-navigation-spacer { display: block; height: var(--st-mobile-nav-height); }
  /* Эти панели уже прокручиваются native CSS. Ограничиваем лишь доступную высоту
     и оставляем место последней ссылке над панелью; позиции и поведение не меняем */
  html body.st-has-mobile-navigation:has(> #st-mobile-bottom-navigation) header.st-header-redesign :is(.mobile-top-menu-left, .mobile-top-menu-right) {
    max-height: calc(100vh - var(--st-header-height, 104px) - var(--st-mobile-nav-height) - 16px);
    max-height: calc(100dvh - var(--st-header-height, 104px) - var(--st-mobile-nav-height) - 16px);
    padding-bottom: 16px;
  }
  #st-mobile-bottom-navigation {
    position: fixed;
    z-index: 1002;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    box-sizing: border-box;
    height: var(--st-mobile-nav-height);
    padding: 5px max(6px, env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    border: 0;
    border-top: 2px solid #ff682c;
    background: #151b1e;
    box-shadow: 0 -5px 20px #03091022;
    color: #b6b6b6;
  }
  #st-mobile-bottom-navigation > :is(a, button) {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-sizing: border-box;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    padding: 3px 0;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: #b6b6b6;
    font: 600 12px/1.2 Arial, sans-serif;
    letter-spacing: .025em;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
    appearance: none;
  }
  #st-mobile-bottom-navigation > :is(a, button):is([aria-current="page"], [aria-expanded="true"]) {
    color: #ff682c;
    background: #ff682c12;
    border-color: #ff682c4d;
    box-shadow: inset 0 2px 0 #ff682c;
  }
  #st-mobile-bottom-navigation > :is(a, button):hover { color: #ff682c; background: #283136; }
  #st-mobile-bottom-navigation > :is(a, button):focus-visible { outline: 2px solid #ff682c; outline-offset: -3px; }
  #st-mobile-bottom-navigation .st-mnav-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linejoin: round;
    stroke-linecap: round;
  }
  #st-mobile-bottom-navigation [data-st-mobile-cart] .st-mnav-icon { width: 26px; height: 26px; }
  #st-mobile-bottom-navigation .st-mnav-menu-close { display: none; }
  #st-mobile-bottom-navigation [aria-expanded="true"] .st-mnav-menu-open { display: none; }
  #st-mobile-bottom-navigation [aria-expanded="true"] .st-mnav-menu-close { display: block; order: -1; }
  #st-mobile-bottom-navigation .st-mnav-count {
    position: absolute;
    top: 0;
    left: calc(50% + 4px);
    box-sizing: border-box;
    min-width: 15px;
    height: 15px;
    padding: 1px 4px;
    border-radius: 9px;
    background: #8e3b2a;
    color: #b6b6b6;
    font: 400 9px/13px Arial, sans-serif;
    text-align: center;
  }
  #st-mobile-bottom-navigation [hidden] { display: none !important; }
  body:is(.fancybox-active, .fancybox-enabled, .modal-open) #st-mobile-bottom-navigation { visibility: hidden; pointer-events: none; }
}
