/* ============================================================
   INSTALADOR DE LA APP (PWA) · Oficina virtual Marketing Lab 360
   Mismo diseño que el instalador de sepackchile.cl, con los colores
   y el logo de la marca. Todo va prefijado con .pwa- (o .instalar).
   ============================================================ */

:root {
  --pwa-a: #f7931e;   /* naranjo de la marca */
  --pwa-b: #d6247a;   /* magenta de la marca */
  --pwa-l: #ffb35c;
  --pwa-ink: #1d276a; /* azul marino de la marca */
  --pwa-barras: #ff702e; /* naranjo del logo, el mismo de las barras del navegador y de la app */
}

/* ---------- Botón de la barra (flecha hacia abajo que pulsa) ---------- */
.boton.instalar { position: relative; background: var(--degradado); color: #fff; overflow: visible; }
.boton.instalar:hover { background: var(--degradado); }
.boton.instalar svg { position: relative; z-index: 2; animation: pwaBaja 1.6s ease-in-out infinite; }
.boton.instalar .txt { position: relative; z-index: 2; }
.boton.instalar::before,
.boton.instalar::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px;
  background: rgba(247, 147, 30, .55); z-index: -1; pointer-events: none;
}
.boton.instalar::before { animation: pwaPulso 2.4s cubic-bezier(.4, 0, .2, 1) infinite; }
.boton.instalar::after { animation: pwaPulso 2.4s cubic-bezier(.4, 0, .2, 1) 1.2s infinite; }
@keyframes pwaPulso {
  0% { transform: scale(1); opacity: .75; }
  70% { opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes pwaBaja { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }
.pwa-oculto { display: none !important; }

/* Tarjeta al final de «Cómo moverse en la oficina» */
.instrucciones .instalar-ayuda { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; background: linear-gradient(120deg, #fff4e8, #fdeaf3); }
.instrucciones .instalar-ayuda img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 6px 14px rgba(247, 147, 30, .35); flex: none; }
.instrucciones .instalar-ayuda span { flex: 1; }
.instrucciones .instalar-ayuda button { background: var(--degradado); color: #fff; font-weight: 900; border-radius: 12px; padding: 10px 16px; display: inline-flex; align-items: center; gap: 7px; flex: none; }
.instrucciones .instalar-ayuda button svg { width: 17px; height: 17px; }
@media (max-width: 520px) { .instrucciones .instalar-ayuda { flex-wrap: wrap; } .instrucciones .instalar-ayuda button { width: 100%; justify-content: center; } }

/* Franjas naranjas bajo la barra de estado y la barra de navegación del teléfono
   (cuando el navegador o la app dibujan la página detrás de ellas) */
.franja-superior, .franja-inferior { position: fixed; left: 0; right: 0; background: var(--pwa-barras); z-index: 2500; pointer-events: none; }
.franja-superior { top: 0; height: env(safe-area-inset-top, 0px); }
.franja-inferior { bottom: 0; height: env(safe-area-inset-bottom, 0px); }

/* ---------- Overlay + hoja del modal ---------- */
.pwa-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(12, 17, 48, .58);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.pwa-overlay.pwa-show { opacity: 1; visibility: visible; }
@media (min-width: 640px) { .pwa-overlay { align-items: center; } }

.pwa-sheet {
  position: relative; width: 100%; max-width: 460px; background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 26px 24px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 44px rgba(0, 0, 0, .32);
  text-align: center; font-family: Lato, system-ui, -apple-system, sans-serif; color: var(--pwa-ink);
  transform: translateY(60px); transition: transform .38s cubic-bezier(.2, .9, .3, 1);
}
.pwa-overlay.pwa-show .pwa-sheet { transform: translateY(0); }
@media (min-width: 640px) {
  .pwa-sheet { max-width: 400px; border-radius: 24px; transform: translateY(24px) scale(.97); padding: 30px 28px; }
  .pwa-overlay.pwa-show .pwa-sheet { transform: translateY(0) scale(1); }
}
.pwa-grip { width: 44px; height: 5px; border-radius: 5px; background: #e6e9f5; margin: 0 auto 18px; }
@media (min-width: 640px) { .pwa-grip { display: none; } }

.pwa-appicon { width: 88px; height: 88px; border-radius: 22px; display: block; margin: 0 auto 10px; box-shadow: 0 10px 24px rgba(247, 147, 30, .4); }
.pwa-logo { display: block; height: 30px; margin: 0 auto 14px; }
.pwa-sheet h3 { font-size: 21px; line-height: 1.25; margin: 0 0 6px; color: var(--pwa-ink); font-weight: 900; }
.pwa-sheet .pwa-sub { font-size: 14.5px; color: #4a5578; line-height: 1.55; margin: 0 auto 20px; max-width: 340px; }

/* Botón principal con el degradado de la marca */
.pwa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  padding: 15px 18px; border: none; border-radius: 15px; cursor: pointer;
  background: linear-gradient(145deg, var(--pwa-l), var(--pwa-a) 45%, var(--pwa-b));
  color: #fff; font-weight: 900; font-size: 16px; font-family: Lato, sans-serif;
  box-shadow: 0 12px 26px -8px rgba(214, 36, 122, .6);
  transition: transform .15s ease, box-shadow .2s ease;
}
.pwa-btn:hover { box-shadow: 0 16px 30px -8px rgba(214, 36, 122, .75); }
.pwa-btn:active { transform: translateY(1px); }
.pwa-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }

.pwa-dismiss { display: inline-block; margin-top: 14px; background: none; border: none; cursor: pointer; color: #7d86a8; font-size: 14px; font-weight: 700; font-family: Lato, sans-serif; padding: 6px 10px; }
.pwa-dismiss:hover { color: #4a5578; text-decoration: underline; }

.pwa-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; background: #eef1fb; color: var(--pwa-ink); font-size: 18px; line-height: 1; display: grid; place-items: center; }
.pwa-x:hover { background: #e2e7f7; }

/* ---------- Pasos visuales (iPhone) ---------- */
.pwa-steps { text-align: left; margin: 6px 0; }
.pwa-step { display: flex; gap: 13px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid #eef1fb; }
.pwa-step:last-child { border-bottom: none; }
.pwa-step .pwa-n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(145deg, var(--pwa-a), var(--pwa-b)); color: #fff; font-weight: 900; font-size: 14px; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(214, 36, 122, .35); }
.pwa-step .pwa-tx { font-size: 14.5px; color: #1d276a; line-height: 1.5; padding-top: 3px; }
.pwa-step .pwa-tx b { color: var(--pwa-ink); font-weight: 900; }
.pwa-ic { display: inline-flex; vertical-align: -5px; margin: 0 2px; width: 20px; height: 20px; color: #0a84ff; }
.pwa-ic.pwa-ic-plus { color: var(--pwa-ink); }

/* ---------- Flecha animada hacia el botón Compartir (iPhone) ---------- */
.pwa-arrow { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 2001; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; pointer-events: none; }
.pwa-arrow.pwa-show { display: flex; animation: pwaArrowBounce 1.15s ease-in-out infinite; }
.pwa-arrow .pwa-arrow-lbl { background: var(--pwa-a); color: #fff; font-family: Lato, sans-serif; font-size: 12.5px; font-weight: 900; padding: 6px 12px; border-radius: 10px; margin-bottom: 7px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); display: flex; align-items: center; gap: 6px; }
.pwa-arrow .pwa-arrow-lbl svg { width: 16px; height: 16px; }
.pwa-arrow .pwa-chev { width: 40px; height: 40px; color: var(--pwa-a); filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .55)); }
@keyframes pwaArrowBounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(12px); } }
@media (max-width: 639px) { .pwa-overlay .pwa-sheet.pwa-ios-flow { padding-bottom: calc(135px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Aviso de éxito ---------- */
.pwa-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(24px); z-index: 2002;
  background: var(--pwa-ink); color: #fff; padding: 14px 20px; border-radius: 14px;
  font-family: Lato, sans-serif; font-size: 14px; line-height: 1.45; max-width: 90vw; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); display: flex; align-items: center; gap: 10px;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}
.pwa-toast.pwa-show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.pwa-toast svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--pwa-l); }
