/* Arranque de la app pública. Mismo html/body fijo que la app del negocio
   (evita el pull-to-refresh que recarga la página y borra el carrito, ver
   web/index.html) y el mismo loader gris. Además, la tarjeta de bienvenida
   instantánea: una copia en HTML de BienvenidaTienda (Flutter) que se pinta
   apenas responde el enlace, mientras baja la app. */
html, body {
  position: fixed;
  overflow: hidden;
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
  margin: 0;
}

#app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #F5F7FB;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#app-loader .spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #E1E5EC;
  border-top-color: #8A93A6;
  border-radius: 50%;
  opacity: 0;
  animation: app-loader-spin 0.9s linear infinite, app-loader-text-in 0.3s ease-in 0.6s forwards;
}
@keyframes app-loader-spin { to { transform: rotate(360deg); } }
#app-loader p {
  margin: 0;
  color: #8A93A6;
  font-size: 13px;
  text-align: center;
  padding: 0 24px;
  opacity: 0;
  animation: app-loader-text-in 0.3s ease-in 0.6s forwards;
}
@keyframes app-loader-text-in { to { opacity: 1; } }
#app-loader.app-loader-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

/* ── Tarjeta de bienvenida (mismas medidas que bienvenida_tienda.dart) ── */
#app-loader.con-bienvenida {
  justify-content: flex-start;
  overflow-y: auto;
  padding: 20px 16px 24px;
  box-sizing: border-box;
}
#app-loader.con-bienvenida > .spinner,
#app-loader.con-bienvenida > p { display: none; }
.bv {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  color: #1a1a1a;
}
.bv-cab {
  border-radius: 18px 18px 0 0;
  padding: 20px 20px 18px;
  text-align: center;
  color: #fff;
}
.bv-logo {
  width: 76px;
  height: 76px;
  box-sizing: border-box;
  padding: 6px;
  margin: 0 auto 10px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bv-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bv-nombre { margin: 0; font-size: 22px; font-weight: 800; }
.bv-mensaje { margin: 6px 0 0; font-size: 15px; line-height: 1.35; color: rgba(255, 255, 255, 0.92); }
.bv-cuerpo { padding: 16px 20px 20px; display: flex; flex-direction: column; }
.bv-estado {
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.bv-linea { display: flex; gap: 8px; padding: 4px 0; font-size: 14px; align-items: flex-start; }
.bv-linea svg { flex: 0 0 18px; width: 18px; height: 18px; }
.bv-contacto { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.bv-contacto a {
  border: 1px solid currentColor;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.bv-boton {
  margin-top: 16px;
  height: 50px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0.55;
}
.bv-boton .giro {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: app-loader-spin 0.9s linear infinite;
}
