/* ═══════════════════════════════════════════════════════════════════════
   Descargar la app (2026-10-29, DOCUMENTACION.md → "Descargar la app").
   Mockup aprobado: claude.ai/artifact/MRVWYNqhnym45WA4BPNDuF.
   Franja de arriba y hoja inferior en el celular, ventana con QR en la computadora.
   Tokens de piel.css, prefijo dg-, nada por debajo de 12 px, objetivos táctiles de 44 px.
   Nunca dentro de la app (html.en-app): js/descargar.js ni los crea.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Franja de arriba (celular, solo la portada) ── */
html.dg-franja { --dg-franja: 60px; }
.dg-franja {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1105; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  min-height: calc(60px + var(--sa-arriba, 0px)); padding: var(--sa-arriba, 0px) 6px 0 12px;
  background: var(--ink); color: var(--bg); font-family: "Outfit", system-ui, sans-serif;
}
.dg-marca { width: 34px; height: 34px; border-radius: 11px; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; flex: none; }
.dg-marca .dg-ico { width: 19px; height: 19px; stroke-width: 2; }
.dg-franja-tx { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.dg-franja-tx b { font-size: 15px; font-weight: 500; }
.dg-franja-tx small { font-size: 12px; opacity: .78; }
.dg-franja-bajar {
  flex: none; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--acc); color: var(--acc-ink);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.dg-franja-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.dg-franja-x .dg-ico { width: 18px; height: 18px; }
/* Videos y Pintar ocupan toda la pantalla: ahí la franja no se muestra. */
body.videos-abierto .dg-franja, body.pintando .dg-franja { display: none; }
/* La franja empuja hacia abajo lo que la portada pone arriba del mapa (cita del domingo, botones redondos y controles del mapa). */
html.dg-franja body.waze-mapa .w-cita { top: calc(12px + var(--sa-arriba, 0px) + var(--dg-franja)); }
html.dg-franja body.waze-mapa .w-flota-top { top: calc(56px + var(--sa-arriba, 0px) + var(--dg-franja)); }
html.dg-franja body.waze-mapa .maplibregl-ctrl-top-right,
html.dg-franja body.waze-mapa .leaflet-top.leaflet-right { top: calc(116px + var(--dg-franja)); }

/* ── Capa: velo + caja (hoja inferior en el celular, ventana en la computadora) ── */
html.dg-abierto { overflow: hidden; }
.dg-velo {
  position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-end;
  background: rgba(20, 18, 15, .5); font-family: "Outfit", system-ui, sans-serif;
}
.dg-velo.ventana { align-items: center; padding: 24px; }
.dg-caja { position: relative; box-sizing: border-box; width: 100%; background: var(--bg); color: var(--ink); max-height: 100%; overflow-y: auto; }
.dg-caja h2 { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.dg-caja.hoja { max-width: 560px; border-radius: 24px 24px 0 0; padding: 22px 20px max(20px, env(safe-area-inset-bottom, 0px)); animation: dg-sube .22s ease-out; }
.dg-caja.ventana { max-width: 440px; border-radius: 26px; padding: 32px 28px 24px; text-align: center; box-shadow: var(--tsh, 0 20px 60px rgba(0,0,0,.3)); animation: dg-entra .18s ease-out; }
.dg-asa { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -10px auto 14px; }
.dg-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.dg-x:hover { color: var(--ink); }
.dg-x .dg-ico { width: 18px; height: 18px; }
.dg-ico { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dg-sub { margin: 10px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Las tres razones (hoja del celular) */
.dg-razones { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; gap: 10px; }
.dg-razones li { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.35; }
.dg-razones .dg-ico { width: 40px; height: 40px; padding: 10px; border-radius: 13px; background: var(--field); color: var(--acc); box-sizing: border-box; }

/* El código QR (ventana de la computadora): siempre sobre blanco para que lo lea la cámara, también con paleta oscura */
.dg-qr { width: 180px; height: 180px; margin: 20px auto 0; padding: 12px; box-sizing: border-box; border-radius: 18px; background: #fff; color: #000; box-shadow: var(--csh, 0 8px 24px rgba(0,0,0,.1)); }
.dg-qr svg { display: block; width: 100%; height: 100%; }
.dg-o { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.dg-o b { color: var(--ink); font-weight: 500; }

/* Las tiendas: enlace si ya existe, «Muy pronto» si no */
.dg-tiendas { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.dg-caja.ventana .dg-tiendas { flex-direction: row; justify-content: center; flex-wrap: wrap; }
.dg-tienda {
  min-height: 48px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--acc); color: var(--acc-ink); font-size: 15px; font-weight: 500; text-decoration: none; box-sizing: border-box;
}
.dg-tienda small { font-size: 12px; font-weight: 400; }
.dg-tienda.pronto { background: var(--field); color: var(--muted); flex-direction: column; gap: 0; padding: 6px 16px; line-height: 1.25; }
.dg-caja.ventana .dg-tienda { flex: 1 1 150px; }
.dg-ahora-no { display: block; width: 100%; min-height: 44px; margin-top: 8px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.dg-ahora-no:hover { color: var(--ink); }

.dg-x:focus-visible, .dg-tienda:focus-visible, .dg-ahora-no:focus-visible, .dg-franja-bajar:focus-visible, .dg-franja-x:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

@keyframes dg-sube { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dg-entra { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dg-caja.hoja, .dg-caja.ventana { animation: none; } }
