/**
 * Go Local PWA Bridge - install banner.
 *
 * Scoped hard to .golocal-pwa-banner so nothing can leak into the live theme.
 * Sits above the fold of the viewport bottom, clear of iOS/Android home bars.
 */

.golocal-pwa-banner {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 99999;

  display: flex;
  align-items: center;
  gap: 0.75rem;

  width: calc(100% - 2rem);
  max-width: 30rem;
  padding: 0.85rem 0.9rem 0.85rem 1.1rem;
  box-sizing: border-box;

  background: #231f20;
  color: #f4f5f0;
  border-radius: 10px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);

  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.35;

  transform: translate(-50%, calc(100% + 2rem));
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.golocal-pwa-banner.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.golocal-pwa-banner__text {
  flex: 1 1 auto;
  margin: 0;
  color: inherit;
  font-size: inherit;
  min-width: 0;
}

.golocal-pwa-banner__install {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  background: #ed3726;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.golocal-pwa-banner__install:hover,
.golocal-pwa-banner__install:focus-visible {
  background: #ff5a49;
}

.golocal-pwa-banner__install:disabled {
  opacity: 0.6;
  cursor: default;
}

.golocal-pwa-banner__close {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: #c6c7bd;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.25rem 0.35rem;
  cursor: pointer;
}

.golocal-pwa-banner__close:hover,
.golocal-pwa-banner__close:focus-visible {
  color: #ffffff;
}

.golocal-pwa-banner button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Installed apps never need the banner, but belt and braces. */
@media all and (display-mode: standalone) {
  .golocal-pwa-banner { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .golocal-pwa-banner { transition: none; }
}

@media (max-width: 24rem) {
  .golocal-pwa-banner {
    font-size: 0.88rem;
    padding: 0.75rem 0.7rem 0.75rem 0.9rem;
    gap: 0.5rem;
  }
  .golocal-pwa-banner__install { padding: 0.55rem 0.8rem; }
}
