/* PWA mobile app shell — bottom tab bar, install banner, standalone polish */

:root {
  --pmts-pwa-tabbar-height: calc(3.75rem + env(safe-area-inset-bottom, 0px));
  --pmts-pwa-brand: #bf5f0b;
  --pmts-pwa-tab-bg: rgb(255 255 255 / 0.94);
  --pmts-pwa-tab-border: rgb(226 232 240 / 0.95);
}

/* ── Bottom tab bar ─────────────────────────────────────────────── */

.pmts-pwa-tabbar {
  display: none;
}

@media (max-width: 991px) {
  body.pmts-pwa-mobile .pmts-pwa-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0.15rem;
    min-height: var(--pmts-pwa-tabbar-height);
    padding:
      0.35rem max(0.5rem, env(safe-area-inset-left, 0px))
      max(0.35rem, env(safe-area-inset-bottom, 0px))
      max(0.5rem, env(safe-area-inset-right, 0px));
    border-top: 1px solid var(--pmts-pwa-tab-border);
    background: var(--pmts-pwa-tab-bg);
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
    box-shadow: 0 -6px 24px rgb(15 23 42 / 0.08);
  }

  body.pmts-pwa-mobile #page-scroll-shell {
    padding-bottom: var(--pmts-pwa-tabbar-height);
  }

  body.pmts-pwa-mobile.pmts-pwa-install-visible #page-scroll-shell {
    padding-bottom: calc(var(--pmts-pwa-tabbar-height) + 3.5rem);
  }

  body.pmts-pwa-mobile .pmts-public-footer-wrap,
  body.pmts-pwa-mobile .pmts-footer-wrap {
    display: none;
  }
}

.pmts-pwa-tab {
  display: inline-flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.2rem 0.25rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: rgb(100 116 139);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  touch-action: manipulation;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.pmts-pwa-tab:active {
  transform: scale(0.96);
}

.pmts-pwa-tab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.5rem;
  color: rgb(100 116 139);
  background: rgb(241 245 249);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pmts-pwa-tab__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.pmts-pwa-tab__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.pmts-pwa-tab--active,
.pmts-pwa-tab--active .pmts-pwa-tab__icon {
  color: var(--pmts-pwa-brand);
}

.pmts-pwa-tab--active .pmts-pwa-tab__icon {
  background: rgb(255 247 237);
}

/* ── Install banner ─────────────────────────────────────────────── */

.pmts-pwa-install {
  position: fixed;
  left: max(0.75rem, env(safe-area-inset-left, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  bottom: calc(var(--pmts-pwa-tabbar-height) + 0.5rem);
  z-index: 46;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  background: linear-gradient(135deg, #fff 0%, #fffbf5 100%);
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.14);
}

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

.pmts-pwa-install__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  object-fit: cover;
  box-shadow: 0 4px 12px rgb(15 23 42 / 0.1);
}

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

.pmts-pwa-install__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  color: rgb(15 23 42);
  line-height: 1.25;
}

.pmts-pwa-install__text {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: rgb(100 116 139);
}

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

.pmts-pwa-install__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.pmts-pwa-install__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #d97706, var(--pmts-pwa-brand));
}

.pmts-pwa-install__btn--ghost {
  color: rgb(100 116 139);
  background: transparent;
  border-color: rgb(226 232 240);
}

/* ── Offline indicator ─────────────────────────────────────────── */

.pmts-pwa-network {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgb(252 165 165);
  background: rgb(254 242 242 / 0.96);
  color: rgb(153 27 27);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.12);
  backdrop-filter: blur(8px);
}

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

.pmts-pwa-network__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: rgb(239 68 68);
}

/* ── Standalone / installed app polish ──────────────────────────── */

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

body.pmts-pwa-standalone.pmts-pwa-mobile .public-site-header,
body.pmts-pwa-standalone.pmts-pwa-mobile .pmts-topbar {
  box-shadow: 0 1px 0 rgb(226 232 240 / 0.9);
}

body.pmts-pwa-standalone.pmts-pwa-mobile #page-scroll-shell {
  background: linear-gradient(180deg, #e8ecf1 0%, #f3f4f6 100%);
}

/* Offline page */
.pmts-pwa-offline-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(70vh, 32rem);
  padding: 2rem 1.25rem;
  text-align: center;
}

.pmts-pwa-offline-page__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  border-radius: 1.25rem;
  background: rgb(255 247 237);
  color: var(--pmts-pwa-brand);
}

.pmts-pwa-offline-page__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: rgb(15 23 42);
}

.pmts-pwa-offline-page__lead {
  margin: 0.75rem 0 0;
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: rgb(100 116 139);
}

.pmts-pwa-offline-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.pmts-pwa-offline-page__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
}

.pmts-pwa-offline-page__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #d97706, var(--pmts-pwa-brand));
}

.pmts-pwa-offline-page__btn--ghost {
  color: rgb(51 65 85);
  background: #fff;
  border: 1px solid rgb(203 213 225);
}
