/**
 * Мобільна нижня панель (варіант з /home-nav — плаваючий кошик).
 * На екранах до 767px замінює стару смугу .header-bottom.
 */

.navlab-bar {
  display: none;
}

@media screen and (max-width: 767px) {
  html .header-section > .header-bottom,
  html .header-section > .header-bottom.add-shadow {
    display: none !important;
  }

  body:has(.navlab-bar) {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  body:has(.navlab-bar) .new-footer-component {
    margin-bottom: 0;
  }

  .navlab-bar {
    position: fixed;
    z-index: 1100;
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    min-height: 74px;
    padding: 10px 4px 12px;
    box-sizing: border-box;
    background: #fff;
    color: #1c1d21;
    border-radius: 28px;
    box-shadow:
      0 10px 28px rgba(23, 24, 26, 0.14),
      0 1px 4px rgba(23, 24, 26, 0.06);
    font-family: Inter, Arial, sans-serif;
    font-size: 11px;
    line-height: 1;
    overflow: visible;
  }

  .navlab-bar button,
  .navlab-bar a {
    -webkit-tap-highlight-color: transparent;
  }

  .navlab-catalog {
    display: flex;
    min-width: 0;
  }

  .navlab-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 2px 2px 0;
    border: 0;
    background: none;
    color: #1c1d21;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
  }

  .navlab-icon {
    position: relative;
    display: flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    flex: none;
  }

  .navlab-icon svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .navlab-label {
    max-width: 100%;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #2b2d33;
    white-space: nowrap;
  }

  .navlab-item.is-active {
    color: #e10613;
  }

  .navlab-item.is-active .navlab-label {
    color: #e10613;
    font-weight: 600;
  }

  .navlab-item.is-active .navlab-label::after {
    content: "";
    display: block;
    height: 2px;
    margin-top: 4px;
    border-radius: 2px;
    background: #e10613;
  }

  .navlab-badge {
    position: absolute;
    top: -7px;
    right: -11px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #e10613;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }

  .navlab-cart {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
    min-width: 70px;
    margin: 0 2px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }

  .navlab-cart-fab {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 1;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #e10613;
    color: #fff;
    box-shadow: 0 8px 18px rgba(225, 6, 19, 0.38);
  }

  .navlab-cart-fab svg {
    width: 26px;
    height: 26px;
    display: block;
  }

  .navlab-cart-badge {
    position: absolute;
    top: 1px;
    right: -1px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #fff;
    color: #e10613;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(23, 24, 26, 0.18);
  }

  .navlab-cart-sum {
    position: absolute;
    left: 50%;
    bottom: 5px;
    z-index: 2;
    transform: translateX(-50%);
    margin-top: 0;
    padding: 5px 8px 6px;
    border-radius: 999px;
    background: #fff;
    color: #e10613;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(23, 24, 26, 0.1);
  }

  .navlab-bar .header-bottom-catalog-list {
    display: none;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    top: auto;
    width: auto;
    max-height: min(62vh, 440px);
    margin: 0;
    padding: 8px 6px 10px;
    overflow: auto;
    transform: none;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(23, 24, 26, 0.16);
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
    z-index: 1001;
  }

  .navlab-bar .header-bottom-catalog-list.w--open {
    display: block;
  }

  /* У бойовому CSS підписи категорій — 6em від крихітної бази хедера. Тут база інша, тож фіксуємо px. */
  .navlab-bar .header-dropdown-list-wrapper.is-navbar {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }

  .navlab-bar .header-dropdown-ci-wrapper.is-navbar {
    gap: 10px !important;
    padding: 10px 12px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
  }

  .navlab-bar .xs__text.new-fs.is-navbar {
    padding-left: 0 !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
  }

  .navlab-bar .header-new-dropdown-icon {
    width: 24px !important;
    height: 24px !important;
  }
}

/* Вузький телефон: коло, плашка суми й підписи менші, щоб не наїжджали одне на одне. */
@media screen and (max-width: 379px) {
  .navlab-bar {
    left: 8px;
    right: 8px;
    padding: 8px 2px 20px;
    border-radius: 24px;
  }

  .navlab-item {
    gap: 4px;
    padding-left: 0;
    padding-right: 0;
  }

  .navlab-icon,
  .navlab-icon svg {
    width: 20px;
    height: 20px;
  }

  .navlab-label {
    font-size: 9px;
    letter-spacing: -0.045em;
  }

  .navlab-cart {
    min-width: 62px;
    margin: 0;
  }

  .navlab-cart-fab {
    width: 48px;
    height: 48px;
    bottom: 24px;
  }

  .navlab-cart-fab svg {
    width: 22px;
    height: 22px;
  }

  .navlab-cart-badge {
    top: 0;
    right: -2px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
  }

  .navlab-cart-sum {
    bottom: 5px;
    padding: 3px 5px 4px;
    font-size: 10px;
    letter-spacing: -0.045em;
  }
}
