/* calc/calc-bottomnav.css — app-style bottom menu for mobile browser + installed
   PWA. Mirrors the .calc__tabs strip in REVERSE order (rightmost = "Мой расчёт",
   leftmost = "Прогнозы"). Desktop browser stays untouched: the bar is
   display:none and the top tab strip remains. All colors via shared --vars, so
   it follows the light / dark / midnight / graphite themes automatically. */

.calc__bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none; /* shown only on mobile / standalone via the gates below */
  align-items: stretch;
  justify-content: space-around;
  gap: 2px;
  padding: 6px 4px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px var(--shadow);
  -webkit-backdrop-filter: saturate(1.15) blur(8px);
  backdrop-filter: saturate(1.15) blur(8px);
}

.calc__navbtn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 2px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease, background .15s ease;
}

.calc__navbtn svg { width: 24px; height: 24px; display: block; }
.calc__navbtn .calc__navico { display: flex; align-items: center; justify-content: center; }
.calc__navbtn .calc__navlbl {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calc__navbtn.is-active { color: var(--accent); }
.calc__navbtn:active { background: var(--bg); }

/* ===== when to switch the top tabs for the bottom menu ===== */
@media (max-width: 760px) {
  .calc .calc__tabs { display: none; }
  .calc__bottomnav { display: flex; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media all and (display-mode: standalone) {
  .calc .calc__tabs { display: none; }
  .calc__bottomnav { display: flex; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
/* iOS standalone: old Safari ignores the display-mode query, so calc-bottomnav.js
   adds html.is-pwa from navigator.standalone as a fallback. */
html.is-pwa .calc .calc__tabs { display: none; }
html.is-pwa .calc__bottomnav { display: flex; }
html.is-pwa body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
