/* Мобильный Bottom Navigation Bar. Подключается отдельно, сам JS рисует разметку. */
:root {
  --tph-bottomnav-h: 0px;
}

.tph-bnb,
.tph-bnb-sheet,
.tph-bnb-scrim {
  display: none;
}

@media (max-width: 768px) {
  html {
    --tph-bottomnav-h: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  body.tph-has-bottomnav {
    padding-bottom: calc(var(--tph-bottomnav-h, 0px) + 8px);
  }

  .tph-bnb {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147481800;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    min-height: var(--tph-bottomnav-h);
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 14, 18, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .tph-bnb {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147481800;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    min-height: var(--tph-bottomnav-h);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 14, 18, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .tph-bnb-item {
    flex: 1 1 0;
    width: 12.5%;
    min-width: 0;
    max-width: 12.5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 2px 1px 0;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0;
    text-align: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .tph-bnb-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .tph-bnb-item span {
    display: block;
    width: 100%;
    height: 22px;
    overflow: hidden;
    text-align: center;
  }

  .tph-bnb-item.is-active {
    color: #fff;
  }

  .tph-bnb-item.is-active svg {
    stroke: #ff5a6f;
  }

  .tph-bnb-item--cta {
    color: #ffd7dc;
  }

  .tph-bnb-item--cta svg {
    stroke: #ff5a6f;
  }

  .tph-bnb-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147481790;
    background: rgba(0, 0, 0, 0.45);
    border: 0;
  }

  .tph-bnb-sheet {
    display: none;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--tph-bottomnav-h, 58px) + 8px);
    z-index: 2147481795;
    padding: 14px 12px 12px;
    border-radius: 16px;
    background: #14181f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }

  body.tph-bnb-more-open .tph-bnb-scrim,
  body.tph-bnb-more-open .tph-bnb-sheet {
    display: block;
  }

  .tph-bnb-sheet-title {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .tph-bnb-sheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tph-bnb-sheet a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
  }

  .tph-bnb-sheet a.is-active {
    border-color: rgba(196, 30, 58, 0.7);
    background: rgba(196, 30, 58, 0.18);
  }

  .tph-bnb-sheet a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #ff5a6f;
    fill: none;
    stroke-width: 2;
  }

  body.tph-onc-form-open .tph-bnb,
  body.tph-onc-form-open .tph-bnb-sheet,
  body.tph-onc-form-open .tph-bnb-scrim,
  body.tph-assistance-open .tph-bnb {
    visibility: hidden;
    pointer-events: none;
  }

  .float-btns {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px) + var(--tph-bottomnav-h, 0px) + var(--tph-dock-lift, 0px)) !important;
  }

  .onicon-button-callback {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px) + var(--tph-bottomnav-h, 0px) + var(--tph-dock-lift, 0px)) !important;
  }

  .onicon-button,
  .onicon-chat-button {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px) + var(--tph-bottomnav-h, 0px) + var(--tph-dock-lift, 0px)) !important;
  }

  .tph-selbar {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--tph-bottomnav-h, 0px)) !important;
  }
}

@media (min-width: 769px) {
  .tph-bnb,
  .tph-bnb-sheet,
  .tph-bnb-scrim {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tph-bnb,
  .tph-bnb-item,
  .tph-bnb-sheet {
    transition: none !important;
  }
}
