/*
 * Install banner for the guest-site PWA (assets/pwa-install.js).
 * Loaded by header.php and (as of the Business/Boutique PWA-parity pass)
 * business_theme_head()/boutique_theme_head() too, so it never reaches
 * the admin panel, which has its own identical-in-spirit but separately-
 * styled banner — see admin/assets/pwa-install.css.
 *
 * Premium visual pass: a brand-gradient accent strip, a softer layered
 * shadow, a gradient "Install" button matching the AI chat widget's own
 * premium gradient treatment (includes/ai_chat_widget.php) for a
 * consistent look across the site's floating UI, and a nicer icon frame.
 * Still only --blue/--blue-dark — every theme already redeclares that
 * pair to its own accent, so this never needs a per-theme fork either.
 */

.pwa-install-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 0);
  width: calc(100% - 24px);
  max-width: 420px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 20px;
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, .3), 0 8px 20px -8px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .04);
  z-index: 9998;
  padding: 18px 16px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-start;
  gap: 13px;
  font-family: var(--font-body, system-ui), sans-serif;
  animation: pwaBannerIn .4s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}

/* Thin brand-gradient strip along the top edge — the one colored touch
   that ties this floating banner to the site's own brand without
   recoloring the whole card (which would fight with the icon/buttons for
   attention). */
.pwa-install-banner__accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue, #1D7C59), var(--blue-dark, #145c42));
}

@keyframes pwaBannerIn {
  from { opacity: 0; transform: translate(-50%, 22px) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.pwa-install-banner__icon {
  flex-shrink: 0;
  padding: 3px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--blue, #1D7C59), var(--blue-dark, #145c42));
}
.pwa-install-banner__icon img {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  background: #fff;
  object-fit: cover;
}

.pwa-install-banner__body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.pwa-install-banner__title {
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.3;
  margin: 0 0 2px;
  letter-spacing: -.01em;
}

.pwa-install-banner__desc {
  font-size: .78rem;
  line-height: 1.45;
  color: #6b7280;
  margin: 0;
}

.pwa-install-banner__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
}

.pwa-install-banner__btn {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: .8rem;
  font-weight: 650;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue, #1D7C59), var(--blue-dark, #145c42));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s ease;
}
.pwa-install-banner__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .4); }
.pwa-install-banner__btn:active { transform: translateY(0) scale(.97); }

.pwa-install-banner__dismiss {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 10px;
  transition: color .15s ease;
}
.pwa-install-banner__dismiss:hover { color: #4b5563; }

.pwa-install-banner__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: none;
  background: #f3f4f6;
  border-radius: 999px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color .15s ease, color .15s ease;
}
.pwa-install-banner__close:hover { background: #e5e7eb; color: #1a1a1a; }
.pwa-install-banner__close svg { width: 12px; height: 12px; }

/* iOS variant: no real "Install" action exists, so the steps are shown
   inline instead of behind a second tap — the whole point is that a
   guest who has never installed a PWA before sees the exact two steps
   immediately, not a vague "Install" button that does nothing on iOS. */
.pwa-install-banner__steps {
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pwa-install-banner__step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: #374151;
}
.pwa-install-banner__step-num {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--blue-light, #eef2f6);
  color: var(--blue, #1D7C59);
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-install-banner__step svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--blue, #1D7C59);
}

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

@media (min-width: 640px) {
  .pwa-install-banner {
    left: 20px;
    bottom: 20px;
    transform: none;
  }
  @keyframes pwaBannerIn {
    from { opacity: 0; transform: translateY(22px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
}
