/* ============================================================
   Wichita Falls Equipment — PWA / Mobile App Styles
   Bottom tab bar, install banner, safe-area insets
   ============================================================ */

/* ---- safe-area body padding so footer/content isn't hidden ---- */
@media (max-width: 768px) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  /* Nudge the floating pill nav down a tiny bit on iOS standalone */
  @media (display-mode: standalone) {
    header.site { top: max(14px, env(safe-area-inset-top, 14px)); }
  }
}

/* ============================================================
   Bottom Tab Bar
   ============================================================ */
.pwa-tabs {
  display: none;                   /* hidden on desktop */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: rgba(12, 19, 15, 0.88);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid #223028;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  align-items: stretch;
}

@media (max-width: 768px) {
  .pwa-tabs { display: flex; }
}

.pwa-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  height: 60px;
  color: #5a7065;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
}

.pwa-tab:active { color: #39ff14; opacity: 0.85; }

.pwa-tab.active {
  color: #39ff14;
}

.pwa-tab.active svg {
  filter: drop-shadow(0 0 6px #39ff1488);
}

.pwa-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex-shrink: 0;
}

/* Call tab — neon green pill */
.pwa-tab.pwa-call {
  flex: 0 0 80px;
  background: #39ff14;
  color: #04140a;
  border-radius: 14px;
  margin: 6px 4px;
  height: 48px;
  font-size: 0.62rem;
  font-weight: 800;
  box-shadow: 0 0 16px #39ff1455, 0 0 40px #39ff1422;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.pwa-tab.pwa-call:active {
  background: #2fd411;
  box-shadow: 0 0 8px #39ff1488;
}

.pwa-tab.pwa-call svg {
  stroke: #04140a;
}

/* ============================================================
   Install Prompt Banner  (Android / Chrome — iOS uses Share)
   ============================================================ */
#pwa-install-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 600;
  background: linear-gradient(135deg, #0e1512, #121a16);
  border-bottom: 1px solid #223028;
  padding: 10px 14px;
  align-items: center;
  gap: 12px;
  animation: pwa-slide-down 0.3s ease;
  padding-top: max(10px, env(safe-area-inset-top, 10px));
}

#pwa-install-bar.show { display: flex; }

@keyframes pwa-slide-down {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

.pwa-install-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid #39ff1433;
}

.pwa-install-text { flex: 1; min-width: 0; }
.pwa-install-text strong { color: #f2f7f4; font-size: 0.88rem; display: block; white-space: nowrap; }
.pwa-install-text small  { color: #9db3a7; font-size: 0.75rem; }

.pwa-install-btn {
  background: #39ff14;
  color: #04140a;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 10px #39ff1455;
  flex-shrink: 0;
}

.pwa-install-btn:active { background: #2fd411; }

.pwa-install-close {
  background: none;
  border: none;
  color: #9db3a7;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}

/* iOS "Add to Home Screen" hint — shown on mobile Safari in browser mode */
.pwa-ios-hint {
  display: none;
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 550;
  background: #0e1512;
  border: 1px solid #39ff1444;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,.55);
  max-width: 300px;
  text-align: center;
  animation: pwa-slide-up 0.3s ease;
}

.pwa-ios-hint.show { display: block; }

@keyframes pwa-slide-up {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);   opacity: 1; }
}

.pwa-ios-hint p {
  color: #f2f7f4;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 6px;
}

.pwa-ios-hint small { color: #9db3a7; font-size: 0.76rem; }

.pwa-ios-hint-close {
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: none;
  color: #9db3a7;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px;
}

.pwa-share-icon {
  display: inline-block;
  width: 14px; height: 14px;
  vertical-align: middle;
  margin: 0 2px;
}
