/* ─────────────────────────────────────────────────────────────────────────────
   descarga.css — insignias OFICIALES de las tiendas y barra «Descarga
   TatuARTE» (js/descarga.js). 7-nov-2026. Va en TODAS las páginas de la web,
   después de su hoja propia (main.css, flyer.css o landing.css).
   ─────────────────────────────────────────────────────────────────────────────
   Las insignias NO se modifican (guías de Apple y de Google): solo se escalan
   en proporción. Las dos se ven a la MISMA altura, `--alto-insignia`, nunca
   por debajo de 40 px (mínimo de Apple en pantalla). El PNG de Google Play
   (646 × 250) trae margen transparente: 29 px arriba y abajo, 192 px de
   insignia visible (medido el 7-nov). Se compensa aquí: la imagen crece a
   250/192 de la altura y el margen negativo se come la parte transparente.
   Entre insignias, al menos un cuarto de su altura (espacio libre de Apple).
   ───────────────────────────────────────────────────────────────────────────── */

.insignia-oficial {
  --alto-insignia: 48px;
  display: inline-block;
  flex: none;
  line-height: 0;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.insignia-oficial img { display: block; width: auto; max-width: none; height: var(--alto-insignia); }
.insignia-oficial--google img {
  height: calc(var(--alto-insignia) * 250 / 192);
  margin: calc(var(--alto-insignia) * -29 / 192) 0;
}
.insignia-oficial:focus-visible { outline: 3px solid #3cfb36; outline-offset: 3px; }

/* Grupos de insignias de la portada (js/destinos.js). */
.insignias,
[data-insignias] { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; }
[data-insignias][hidden] { display: none; }

/* Lo que solo se ve en un modo (js/destinos.js): `hidden` manda siempre,
   aunque la hoja de la página le dé otro `display`. */
[data-solo-tiendas][hidden],
[data-solo-web][hidden] { display: none !important; }

/* Portada (landing/index.html): insignias bajo las puertas del inicio y en
   «Crear cuenta», y el enlace a la web app como secundario. */
.descarga-portada { margin-top: var(--paso-4, 1.5rem); }
.descarga-portada__titulo { margin: 0 0 0.7rem; font-weight: 700; color: var(--fg, #f4f4f4); }
.descarga-portada__web { margin: var(--paso-3, 1rem) 0 0; }
.grupo-botones .insignias { gap: 0.7rem 0.8rem; }
.landing .cta__navegador { margin: 0.8rem 0 0; font-size: 0.9rem; color: var(--fg-subtle, #a3a3a3); }
.landing .cta__navegador a { color: var(--accent, #3cfb36); font-weight: 600; }

/* Landings del flyer (/tatuarme, /tatuadores): mismas medidas que sus botones
   de 56 px, sin estirarse a lo ancho en la columna del móvil. */
.cta .insignia-oficial { --alto-insignia: 52px; align-self: flex-start; }
.barra-fija .cta { justify-content: center; align-items: center; }
.barra-fija .insignia-oficial { --alto-insignia: 44px; align-self: center; }

/* Pie de marcas de Apple y Google, en el pie de cada página. */
.marcas-tiendas { margin: 10px 0 0; font-size: 0.75rem; line-height: 1.5; opacity: 0.8; }
.site-footer .marcas-tiendas {
  max-width: var(--max-page, 72rem);
  margin: 0 auto;
  padding: 0 var(--space-4, 1rem) var(--space-4, 1rem);
  color: var(--color-text-subtle, inherit);
}

/* ─── La barra «Descarga TatuARTE» ─────────────────────────────────────────
   Móvil: una franja abajo (logo, texto, la insignia de su tienda y la X).
   Escritorio (≥ 700 px): una tarjeta en la esquina con las dos insignias.
   Siempre oscura, también en el tema claro de las páginas legales: es la
   estética de la marca (verde #3CFB36 sobre negro). */
.descarga {
  --d-texto: #f4f4f4;
  --d-suave: #a3a3a3;
  --d-borde: #262626;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; /* bajo la persiana de la portada (200) */
  display: flex; align-items: center; gap: 10px;
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom)) 14px;
  background: rgba(5, 5, 5, 0.96); color: var(--d-texto);
  border-top: 1px solid var(--d-borde);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  font-size: 15px; line-height: 1.25; text-align: left;
  transform: translateY(110%); visibility: hidden;
  transition: transform 240ms ease, visibility 0s linear 240ms;
}
.descarga--visible { transform: none; visibility: visible; transition: transform 240ms ease, visibility 0s; }
.descarga__logo { width: 36px; height: 36px; flex: none; }
.descarga__texto { margin: 0; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.descarga__texto strong { font-weight: 800; font-size: 0.95em; color: var(--d-texto); }
.descarga__texto span { font-size: 0.82em; color: var(--d-suave); }
.descarga__insignias { display: flex; align-items: center; gap: 12px; flex: none; }
.descarga .insignia-oficial { --alto-insignia: 40px; }
.descarga .insignia-oficial:focus-visible { outline-width: 2px; }
.descarga__cerrar {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--d-suave); cursor: pointer;
}
.descarga__cerrar:hover { color: var(--d-texto); background: rgba(255, 255, 255, 0.08); }
.descarga__cerrar:focus-visible { outline: 2px solid #3cfb36; outline-offset: 1px; }

/* El hueco del final de la página: lo ajusta js/descarga.js a la altura real. */
.descarga-hueco { height: calc(64px + env(safe-area-inset-bottom)); }

@media (max-width: 429px) {
  .descarga__texto span { display: none; }
}
@media (max-width: 359px) {
  .descarga { padding-left: 12px; gap: 8px; }
  .descarga__logo { display: none; }
}

@media (min-width: 700px) {
  .descarga {
    left: auto; right: 20px; bottom: 20px; width: max-content; max-width: 360px;
    flex-wrap: wrap; gap: 12px 12px;
    padding: 14px 8px 16px 16px;
    border: 1px solid var(--d-borde); border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    transform: translateY(calc(100% + 40px));
  }
  .descarga.descarga--visible { transform: none; }
  .descarga__cerrar { order: 1; align-self: flex-start; margin: -8px 0 -8px auto; }
  .descarga__insignias { order: 2; flex-basis: 100%; padding-right: 8px; }
  .descarga-hueco { height: 150px; }
}

/* ─── La hoja del móvil (primera visita a la portada y a las landings) ─────
   Casi a pantalla completa: se ve un trozo de la página detrás, para que se
   entienda que la web sigue ahí («Seguir en la web»). */
html.hoja-descarga-abierta { overflow: hidden; }
.hoja-descarga {
  position: fixed; inset: 0; z-index: 250; /* encima de la persiana (200) y del pop-up de registro (60) */
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: hoja-descarga-fondo 200ms ease;
}
.hoja-descarga__caja {
  box-sizing: border-box; width: 100%; max-width: 480px;
  min-height: 88vh; min-height: 88dvh; max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px calc(24px + env(safe-area-inset-bottom));
  background: #050505; color: #f4f4f4; text-align: center;
  border: 1px solid #262626; border-bottom: 0; border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  animation: hoja-descarga-sube 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hoja-descarga__logo { width: 64px; height: 64px; }
.hoja-descarga__titulo {
  margin: 18px 0 0; font-family: inherit; font-size: 1.75rem; font-weight: 900; line-height: 1.1;
  letter-spacing: -0.02em; color: #f4f4f4; max-width: 14em; text-wrap: balance;
}
.hoja-descarga__caja:focus { outline: none; }
.hoja-descarga__ventajas { list-style: none; margin: 22px 0 0; padding: 0; text-align: left; display: grid; gap: 12px; }
.hoja-descarga__ventajas li { position: relative; padding-left: 30px; font-size: 1rem; line-height: 1.35; color: #d4d4d4; }
.hoja-descarga__ventajas li::before {
  content: ""; position: absolute; left: 0; top: 0.1em; width: 20px; height: 20px; border-radius: 999px;
  background: #3cfb36 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23050505' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.hoja-descarga__insignia { --alto-insignia: 56px; margin-top: 30px; }
.hoja-descarga__web {
  margin-top: 16px; min-height: 48px; padding: 0 28px; width: 100%; max-width: 320px;
  border: 1.5px solid #3a3a3a; border-radius: 999px; background: transparent;
  color: #f4f4f4; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.hoja-descarga__web:hover { border-color: #3cfb36; }
.hoja-descarga__web:focus-visible { outline: 3px solid #3cfb36; outline-offset: 3px; }
.hoja-descarga__nota { margin: 18px 0 0; font-size: 0.8rem; color: #8a8a8a; }
@keyframes hoja-descarga-fondo { from { opacity: 0; } }
@keyframes hoja-descarga-sube { from { transform: translateY(32px); opacity: 0; } }

/* ─── QR para el móvil (solo escritorio: lo pinta js/descarga.js) ───────── */
.descarga-qr { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.descarga-qr[hidden] { display: none; }
.descarga-qr svg { width: 112px; height: 112px; flex: none; border-radius: 8px; }
.descarga-qr p { margin: 0; max-width: 15em; font-size: 0.9rem; line-height: 1.4; color: var(--fg-subtle, var(--texto-suave, #a3a3a3)); }

/* ─── /descargar y /app ─────────────────────────────────────────────────── */
.descargar { padding: 56px 0 72px; }
.descargar h1 { margin: 10px 0 0; }
.descargar .entradilla { max-width: 32em; }
.descargar [data-insignias] { margin-top: 28px; }
.descargar [data-insignias] .insignia-oficial { --alto-insignia: 52px; }
.descargar__abriendo { display: none; margin: 18px 0 0; font-weight: 700; color: #3cfb36; }
html.descarga-redirigiendo .descargar__abriendo { display: block; }

@media (prefers-reduced-motion: reduce) {
  .descarga, .descarga--visible { transition: none; }
  .hoja-descarga, .hoja-descarga__caja { animation: none; }
}

@media print {
  .descarga, .descarga-hueco, .hoja-descarga { display: none !important; }
}
