/* Karma Jyotish PWA chrome — mobile only for the tab bar; desktop layout unchanged. */

.pwa-tabbar {
  display: none;
}

.pwa-install[hidden] {
  display: none !important;
}

.pwa-install {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(7, 11, 26, 0.96);
  color: #f5f6fa;
  border: 1px solid rgba(201, 162, 74, 0.45);
  border-radius: 0.9rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.pwa-install__mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
  background: #05060f;
}

.pwa-install__copy {
  min-width: 0;
  flex: 1;
}

.pwa-install__title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #e6c77a;
}

.pwa-install__body {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #d2d4de;
}

.pwa-install__actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.pwa-install__cta,
.pwa-install__dismiss {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

.pwa-install__cta {
  background: #c9a24a;
  color: #0e1a3a;
}

.pwa-install__dismiss {
  background: transparent;
  color: #c5c7d4;
}

@media (min-width: 768px) {
  .pwa-install {
    left: auto;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 22rem;
    max-width: calc(100vw - 2rem);
  }
}

@media (max-width: 767px) {
  .pwa-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: auto;
    min-height: 3.5rem;
    padding: 0.2rem 0.15rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
    background: rgba(5, 6, 15, 0.96);
    border-top: 1px solid rgba(201, 162, 74, 0.28);
    backdrop-filter: blur(12px);
    justify-content: space-around;
    align-items: stretch;
  }

  body.has-pwa-tabs {
    padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  }

  body.has-pwa-tabs:has(.pwa-bottom-cta) {
    padding-bottom: calc(8.75rem + env(safe-area-inset-bottom, 0px));
  }

  .pwa-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.35rem 0.15rem 0.2rem;
    color: #c5c7d4;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.1;
    border-radius: 0.6rem;
  }

  .pwa-tab svg {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
  }

  .pwa-tab[aria-current="page"],
  .pwa-tab.is-active {
    color: #e6c77a;
  }

  .pwa-tab[aria-current="page"] svg,
  .pwa-tab.is-active svg {
    color: #c9a24a;
  }

  /* Lift existing or future floating WhatsApp buttons above the tab bar. */
  body.has-pwa-tabs a.wa-fab,
  body.has-pwa-tabs .wa-float,
  body.has-pwa-tabs #whatsapp-float,
  body.has-pwa-tabs [data-wa-fab] {
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Puja book sticky CTAs sit above the tab bar instead of covering it. */
  body.has-pwa-tabs .pwa-bottom-cta {
    bottom: calc(3.65rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (display-mode: standalone) {
  body.has-pwa-tabs header.sticky {
    padding-top: env(safe-area-inset-top, 0px);
  }
}
