/* =============================================================================
   pwa-bootstrap.css — install sheet, update banner, open-in-app banner
   Vive en sitio web Y en /app/ (se carga globalmente).
   ============================================================================= */

/* --------- Update available banner --------- */
.pwa-update-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #1a1a2e; color: #fff;
  border: 1px solid #ff9f00; border-radius: 14px;
  padding: 10px 14px; z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  transform: translateY(calc(100% + 40px));
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  max-width: 520px; margin: 0 auto;
}
.pwa-update-bar.show { transform: translateY(0); }
.pwa-update-icon { font-size: 20px; color: #ff9f00; }
.pwa-update-text { flex: 1; line-height: 1.2; }
.pwa-update-text strong { display: block; font-size: 14px; font-weight: 700; }
.pwa-update-text small  { font-size: 11px; opacity: .6; }
.pwa-update-btn {
  background: #ff9f00; color: #161616; border: 0;
  padding: 8px 16px; border-radius: 8px;
  font-weight: 800; font-size: 13px; cursor: pointer;
}
.pwa-update-btn:active { transform: scale(.95); }
.pwa-update-close {
  background: transparent; border: 0; color: rgba(255,255,255,.5);
  font-size: 18px; cursor: pointer; padding: 4px 6px;
}

/* --------- Install bottom sheet --------- */
.pwa-install-sheet {
  position: fixed; inset: 0; z-index: 9998;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease-out;
  font-family: system-ui, -apple-system, sans-serif;
}
.pwa-install-sheet.show { opacity: 1; pointer-events: auto; }
.pwa-install-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
}
.pwa-install-card {
  position: absolute; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff; color: #161616;
  border-radius: 20px; padding: 20px 20px 24px;
  max-width: 520px; margin: 0 auto;
  box-shadow: 0 16px 60px rgba(0,0,0,.5);
  transform: translateY(calc(100% + 40px));
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.pwa-install-sheet.show .pwa-install-card { transform: translateY(0); }
.pwa-install-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pwa-install-head img { border-radius: 12px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(255,159,0,.3); }
.pwa-install-head strong { display: block; font-size: 16px; font-weight: 800; color: #161616; line-height: 1.2; }
.pwa-install-head small  { display: block; font-size: 12px; color: #666; margin-top: 3px; }
.pwa-install-x {
  margin-left: auto; background: transparent; border: 0;
  color: #999; font-size: 22px; cursor: pointer; padding: 4px 8px;
  line-height: 1;
}
.pwa-install-chips {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px;
}
.pwa-install-chips span {
  background: #fff7ed; color: #b45309;
  padding: 4px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.pwa-install-ios-steps {
  padding-left: 22px; margin: 8px 0 14px;
  color: #333; font-size: 13px; line-height: 1.6;
}
.pwa-install-ios-steps li { margin-bottom: 6px; }
.pwa-install-ios-steps strong { color: #ff9f00; }
.pwa-install-accept {
  width: 100%; background: #ff9f00; color: #161616; border: 0;
  padding: 14px; border-radius: 12px;
  font-weight: 900; font-size: 15px; cursor: pointer;
  transition: all .15s;
}
.pwa-install-accept:active { transform: scale(.98); background: #d78500; }
.pwa-install-later {
  width: 100%; background: transparent; color: #666; border: 0;
  padding: 10px; font-size: 13px; cursor: pointer; margin-top: 6px;
}

/* --------- Smart banner (open in app if ya instalada) --------- */
.pwa-open-bar {
  position: fixed; left: 12px; right: 12px;
  top: calc(12px + env(safe-area-inset-top, 0px));
  background: #fff; color: #161616;
  border: 1px solid rgba(0,0,0,.08); border-radius: 12px;
  padding: 8px 12px; z-index: 9997;
  display: flex; align-items: center; gap: 10px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  transform: translateY(-120%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  max-width: 520px; margin: 0 auto;
}
.pwa-open-bar.show { transform: translateY(0); }
.pwa-open-bar img { border-radius: 8px; flex-shrink: 0; }
.pwa-open-bar span { flex: 1; font-weight: 600; }
.pwa-open-btn {
  background: #ff9f00; color: #161616; padding: 6px 14px;
  border-radius: 8px; text-decoration: none; font-weight: 800;
  font-size: 13px;
}
.pwa-open-close {
  background: transparent; border: 0; color: #999;
  font-size: 16px; cursor: pointer; padding: 2px 6px;
}

/* Dark mode auto */
@media (prefers-color-scheme: dark) {
  .pwa-install-card,
  .pwa-open-bar { background: #1a1a1c; color: #f5f5f7; border-color: #2a2a2e; }
  .pwa-install-head strong,
  .pwa-open-bar span { color: #f5f5f7; }
  .pwa-install-head small { color: #a0a0a8; }
  .pwa-install-chips span { background: rgba(255,159,0,.15); color: #ff9f00; }
  .pwa-install-ios-steps { color: #d0d0d5; }
}
