/*
 * Store Listing — install overlay styles.
 * Mobile-first. Sits on top of the store-listing template.
 */

.sl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 9999;
  padding: 0;
}
.sl-overlay.is-open { display: flex; }
body.sl-overlay-open { overflow: hidden; }

.sl-overlay__card {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 12px 12px env(safe-area-inset-bottom, 20px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  color: #1c1c1e;
  animation: sl-overlay-slide-in 220ms ease-out;
}

@keyframes sl-overlay-slide-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sl-overlay__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}
.sl-overlay__sub {
  font-size: 14px;
  color: #6e6e73;
  margin: 0 0 18px;
  line-height: 1.4;
}

.sl-overlay__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  counter-reset: sl-step;
}
.sl-overlay__steps li {
  counter-increment: sl-step;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f2f2f7;
  font-size: 15px;
  line-height: 1.4;
}
.sl-overlay__steps li:last-child { border-bottom: 0; }
.sl-overlay__steps li::before {
  content: counter(sl-step);
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Wrapper for the step's text so it behaves as a single flex item.
   Without it, every text node / <strong> / icon inside the <li>
   becomes its own flex item and the line wraps awkwardly. */
.sl-overlay__steps-text {
  flex: 1 1 auto;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.sl-overlay__steps-text strong { font-weight: 600; }

.sl-overlay__steps .sl-icon {
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
  font-weight: 700;
}
.sl-overlay__steps .sl-icon--share::before { content: '\2191'; } /* up arrow as a stand-in for share icon */
.sl-overlay__steps .sl-icon--more::before  { content: '\22EF'; } /* horizontal ellipsis */

a.sl-overlay__primary,
.sl-overlay .sl-overlay__primary {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  background: #1a73e8;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 14px;
  -webkit-tap-highlight-color: transparent;
}
a.sl-overlay__primary:hover,
a.sl-overlay__primary:active,
.sl-overlay .sl-overlay__primary:active { background: #1557b0; color: #fff; }

/* Compact "or manually" divider above the fallback steps. */
.sl-overlay__or {
  font-size: 12px;
  color: #6e6e73;
  text-align: center;
  margin: 6px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sl-overlay__steps--compact li {
  font-size: 13px;
  padding: 8px 0;
}
.sl-overlay__steps--compact li::before {
  flex: 0 0 22px;
  height: 22px;
  font-size: 11px;
}

.sl-overlay__close {
  background: transparent;
  border: 0;
  color: #007aff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  display: block;
  width: 100%;
  text-align: center;
  cursor: pointer;
  margin-top: 4px;
}

.sl-overlay__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  font-size: 13px;
  color: #6e6e73;
}

/* Android tweaks — overlay used when in Meta webview on Android */
[data-sl-bucket="open_in_browser"] .sl-overlay__steps li::before {
  background: #01875f;
}

/* ──────────────────────────────────────────────────────────────────
 * PWA standalone splash. Toggled on via html.sl-pwa-standalone,
 * which is set synchronously by an inline <head> script before
 * <body> parses — so the splash appears on the very first paint
 * and the install-hook page content stays hidden until the JS
 * timer fires and redirects to the partner.
 * ──────────────────────────────────────────────────────────────── */
.sl-splash {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #fff;
  font-family: 'Google Sans', Roboto, -apple-system, 'SF Pro Text', sans-serif;
}
.sl-splash__icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a3a6b, #2d6eb5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.sl-splash__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sl-splash__name {
  font-size: 1.15rem;
  font-weight: 500;
  color: #202124;
  text-align: center;
  padding: 0 24px;
}
.sl-splash__spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: #174ea6;
  border-radius: 50%;
  animation: sl-splash-spin 0.8s linear infinite;
}
@keyframes sl-splash-spin {
  to { transform: rotate(360deg); }
}

html.sl-pwa-standalone .sl-splash     { display: flex; }
html.sl-pwa-standalone .sl-page-shell { display: none; }
