html.ccpv-pwa-standalone,
html.ccpv-pwa-standalone body {
  min-height: 100%;
}

.ccpv-pwa-loader {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(96, 165, 250, 0.18), transparent 30%),
    linear-gradient(135deg, #071b3d 0%, #0b2f66 55%, #06152f 100%);
  color: #fff;
  opacity: 1;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.ccpv-pwa-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.ccpv-pwa-loader-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.ccpv-pwa-loader-logo {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid rgba(191, 219, 254, 0.38);
  border-radius: 999px;
  color: #eaf2ff;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(15, 76, 129, 0.92), rgba(6, 21, 47, 0.94));
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.34),
    inset 0 0 0 8px rgba(255, 255, 255, 0.04);
  animation: ccpvPwaBreathe 1.8s ease-in-out infinite;
}

.ccpv-pwa-loader-logo::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: inherit;
}

.ccpv-pwa-loader-logo img {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
}

.ccpv-pwa-loader-fallback {
  position: relative;
  z-index: 1;
  display: none;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.ccpv-pwa-loader-logo.has-fallback .ccpv-pwa-loader-fallback {
  display: inline-flex;
}

.ccpv-pwa-loader strong {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.ccpv-pwa-loader span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
}

.ccpv-pwa-offline-pill {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 11000;
  display: none;
  max-width: min(340px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 16px;
  color: #7f1d1d;
  background: #fee2e2;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
  font-weight: 700;
}

html.ccpv-is-offline .ccpv-pwa-offline-pill {
  display: block;
}

.ccpv-pwa-install-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 11000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 15px 11px 12px;
  border: 1px solid rgba(191, 219, 254, 0.42);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b5fff 0%, #063f9c 100%);
  box-shadow: 0 16px 38px rgba(11, 95, 255, 0.28);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.ccpv-pwa-install-button[hidden] {
  display: none;
}

.ccpv-pwa-install-button:hover,
.ccpv-pwa-install-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(11, 95, 255, 0.34);
}

.ccpv-pwa-install-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ccpv-pwa-install-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #0b5fff;
  background: #ffffff;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.ccpv-pwa-ios-guide {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 11100;
  width: min(420px, calc(100vw - 28px));
  color: #0f172a;
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.ccpv-pwa-ios-guide.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(12px);
}

.ccpv-pwa-ios-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(16px);
}

.ccpv-pwa-ios-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
  background: #f8fafc;
}

.ccpv-pwa-ios-content {
  display: grid;
  gap: 6px;
  padding-right: 24px;
}

.ccpv-pwa-ios-content strong {
  color: #0f172a;
  font-size: 0.98rem;
}

.ccpv-pwa-ios-content span,
.ccpv-pwa-ios-content li {
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.35;
}

.ccpv-pwa-ios-content ol {
  margin: 4px 0 0;
  padding-left: 18px;
}

.ccpv-pwa-ios-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

@keyframes ccpvPwaBreathe {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.03);
    filter: brightness(1.12);
  }
}

@media (display-mode: fullscreen), (display-mode: standalone) {
  body {
    overscroll-behavior-y: contain;
  }

  .ccpv-pwa-install-button {
    display: none;
  }

  .ccpv-pwa-ios-guide {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ccpv-pwa-loader,
  .ccpv-pwa-loader-logo {
    animation: none;
    transition: none;
  }
}

@media (max-width: 640px) {
  .ccpv-pwa-install-button {
    right: 14px;
    bottom: 14px;
    justify-content: center;
  }

  .ccpv-pwa-ios-card {
    grid-template-columns: 44px 1fr;
    padding: 14px;
  }

  .ccpv-pwa-ios-logo {
    width: 44px;
    height: 44px;
  }
}

/* Maps ALA — Instalar App no canto inferior (chips ficam no topo) */
body.ccpv-maps-ala-gmaps .ccpv-pwa-install-button,
body:has(.maps-page-ala) .ccpv-pwa-install-button {
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  right: 12px;
  left: auto;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.8rem;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(11, 95, 255, 0.22);
  z-index: 1260;
}

body.ccpv-maps-ala-gmaps .ccpv-pwa-install-icon,
body:has(.maps-page-ala) .ccpv-pwa-install-icon {
  width: 22px;
  height: 22px;
  font-size: 16px;
}

@media (max-width: 720px) {
  body.ccpv-maps-ala-gmaps .ccpv-pwa-install-button,
  body:has(.maps-page-ala) .ccpv-pwa-install-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    justify-content: center;
  }

  body.ccpv-maps-ala-gmaps .ccpv-pwa-install-button .ccpv-pwa-install-label,
  body:has(.maps-page-ala) .ccpv-pwa-install-button .ccpv-pwa-install-label {
    display: none;
  }
}
