/*
 * Consulta de Precios — hoja única de la terminal kiosko.
 *
 * Mismo lenguaje visual que el ERP y que asistencia/ (Nunito, el color de
 * marca de la sucursal, el degradé de dos capas de .bg-gradient-primary),
 * sin cargar nada del ERP: en PROD vive en otro subdominio.
 *
 * Contexto que manda: un monitor viejo (puede ser 4:3 o 5:4, no sólo 16:9)
 * mirado de pie a 1–2 metros por alguien con un producto en la mano. El
 * precio se lee de lejos; todo lo demás es secundario. Tamaños en vh/vw y no
 * en px, y sin clamp()/min()/gap en flex: la PC puede tener un Chrome viejo.
 */

:root {
  --primary: #002a45;
  --primary-hover: #001d30;

  --tinta: #f8fafc;
  --tinta-tenue: rgba(248, 250, 252, 0.7);
  --papel: #ffffff;
  --papel-tinta: #0f172a;
  --papel-tenue: #64748b;

  --oferta: #e11d48;
  --efectivo: #15803d;
  --alerta: #fbbf24;
}

* { box-sizing: border-box; }

[hidden], .oculto { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
  color: var(--tinta);
  -webkit-font-smoothing: antialiased;
  cursor: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Misma receta que .bg-gradient-primary del ERP. */
body {
  background-color: var(--primary);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(135deg, var(--primary) 10%, var(--primary-hover) 100%);
}

.pantalla {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.5vh 3vw 3vh;
}

/* ===================== barra ===================== */

.barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 2.6vh;
  font-weight: 700;
  color: var(--tinta-tenue);
  flex: 0 0 auto;
}

.barra-lugar {
  display: flex;
  align-items: center;
  min-width: 0;
}

.barra-lugar span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.barra-logo {
  height: 4.5vh;
  width: auto;
  margin-right: 1.2vw;
  background: var(--papel);
  border-radius: 0.8vh;
  padding: 0.4vh;
}

.barra-der { display: flex; align-items: center; }

.reloj {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--tinta);
  margin-left: 1.5vw;
}

.sin-red {
  background: var(--alerta);
  color: #422006;
  border-radius: 99px;
  padding: 0.4vh 1.2vw;
  font-size: 2vh;
  font-weight: 800;
}

/* ===================== vistas ===================== */

.vista {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  animation: entrar 0.25s ease-out;
}

@keyframes entrar {
  from { opacity: 0; transform: translateY(1.5vh); }
  to   { opacity: 1; transform: none; }
}

/* ----- reposo ----- */

.vista--reposo { text-align: center; }

.reposo-logo {
  background: var(--papel);
  border-radius: 3vh;
  padding: 2.5vh 3vw;
  margin-bottom: 4vh;
  box-shadow: 0 2vh 5vh -1vh rgba(0, 0, 0, 0.45);
}

.reposo-logo img {
  display: block;
  max-height: 20vh;
  max-width: 45vw;
}

.reposo-titulo {
  margin: 0 0 4vh;
  font-size: 9vh;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Código de barras dibujado con un láser que lo barre: dice "escaneá acá"
   sin necesidad de leer. */
.reposo-codigo {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 14vh;
  padding: 2vh 2.5vw;
  background: var(--papel);
  border-radius: 1.5vh;
  overflow: hidden;
}

.reposo-codigo span {
  display: block;
  width: 0.5vw;
  margin-right: 0.45vw;
  background: var(--papel-tinta);
}
.reposo-codigo span:nth-child(3n)  { width: 0.25vw; }
.reposo-codigo span:nth-child(4n)  { width: 0.9vw; }
.reposo-codigo span:nth-child(5n)  { margin-right: 0.9vw; }
.reposo-codigo span:last-of-type   { margin-right: 0; }

.reposo-laser {
  position: absolute;
  left: 0;
  right: 0;
  top: 10%;
  height: 0.6vh;
  background: #ef4444;
  box-shadow: 0 0 1.5vh 0.4vh rgba(239, 68, 68, 0.75);
  animation: laser 2.2s ease-in-out infinite alternate;
}

@keyframes laser {
  from { top: 10%; }
  to   { top: 88%; }
}

.reposo-ayuda {
  margin: 4vh 0 0;
  font-size: 3.4vh;
  font-weight: 700;
  color: var(--tinta-tenue);
}

/* ----- producto ----- */

.vista--producto {
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 2.5vh;
}

.producto {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  background: var(--papel);
  color: var(--papel-tinta);
  border-radius: 3vh;
  box-shadow: 0 3vh 7vh -2vh rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.producto-foto {
  flex: 0 0 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 2vw;
  border-right: 1px solid #e2e8f0;
}

.producto-foto img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.producto-sinfoto {
  width: 50%;
  color: #cbd5e1;
}
.producto-sinfoto svg { width: 100%; height: auto; display: block; }

.producto-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 3vh 3vw;
}

.insignias { min-height: 1px; }

.insignia {
  display: inline-block;
  margin: 0 1vw 1.5vh 0;
  padding: 0.6vh 1.4vw;
  border-radius: 99px;
  font-size: 2.8vh;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--oferta);
}

.producto-nombre {
  margin: 0;
  font-size: 5vh;
  font-weight: 800;
  line-height: 1.12;
  /* Hasta 3 renglones: una descripción de ERP larga no puede empujar el
     precio fuera de la pantalla. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.producto-marca {
  margin: 1vh 0 0;
  font-size: 2.8vh;
  font-weight: 700;
  color: var(--papel-tenue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.producto-marca:empty { display: none; }

.precio-bloque { margin-top: 2.5vh; }

.precio-anterior {
  margin: 0;
  font-size: 4vh;
  font-weight: 700;
  color: var(--papel-tenue);
  text-decoration: line-through;
}

.precio {
  margin: 0;
  font-size: 17vh;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.precio-signo {
  font-size: 0.5em;
  vertical-align: 0.6em;
  margin-right: 0.08em;
}

.precio-cent {
  font-size: 0.42em;
  vertical-align: 0.95em;
  margin-left: 0.04em;
}

.precio--sin {
  font-size: 5.5vh;
  white-space: normal;
  color: var(--papel-tinta);
}

.precio-kg {
  margin: 1vh 0 0;
  font-size: 2.6vh;
  font-weight: 700;
  color: var(--papel-tenue);
}

.beneficios {
  list-style: none;
  margin: 3vh 0 0;
  padding: 0;
}

.beneficio {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.3vh 1.6vw;
  margin-bottom: 1vh;
  border-radius: 1.4vh;
  background: #f1f5f9;
  font-size: 3.2vh;
  font-weight: 700;
}

.beneficio strong {
  font-size: 4.2vh;
  font-weight: 900;
  margin-left: 2vw;
  white-space: nowrap;
}

.beneficio--efectivo {
  background: #dcfce7;
  color: var(--efectivo);
}

.beneficio--nota {
  display: block;
  background: transparent;
  padding: 0 0.2vw;
  font-size: 2.2vh;
  color: var(--papel-tenue);
}

/* Cuenta regresiva hasta volver al reposo: barra fina bajo la tarjeta. */
.cuenta {
  flex: 0 0 auto;
  height: 0.8vh;
  margin-top: 1.5vh;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.cuenta i {
  display: block;
  height: 100%;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
}

/* ----- no encontrado ----- */

.vista--aviso { text-align: center; }
.vista--aviso h2 { margin: 0 0 2vh; font-size: 8vh; font-weight: 900; line-height: 1.05; }
.vista--aviso p  { margin: 0; font-size: 4.5vh; font-weight: 700; color: var(--tinta-tenue); }
.vista--aviso .aviso-codigo { margin-top: 3vh; font-size: 2.6vh; letter-spacing: 0.1em; }

/* ----- cargando ----- */

body.cargando .vista { opacity: 0.55; transition: opacity 0.15s; }

/* ----- terminal no habilitada ----- */

.pantalla--error { align-items: center; justify-content: center; text-align: center; }
.bloqueo { max-width: 70vw; }
.bloqueo h1 { margin: 0 0 2vh; font-size: 7vh; font-weight: 900; }
.bloqueo p  { margin: 0 0 2vh; font-size: 3.2vh; font-weight: 600; color: var(--tinta-tenue); }
.bloqueo .bloqueo-ip { margin-top: 4vh; font-size: 2.6vh; font-variant-numeric: tabular-nums; }

/* El input del lector: enfocable pero invisible. display:none o
   visibility:hidden NO sirven — un elemento así no puede tener el foco. */
.scan {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ===================== monitores 4:3 / 5:4 ===================== */

/* En un monitor cuadrado el ancho se acaba antes que el alto: foto arriba
   del texto no, pero sí achicar precio y nombre para que no desborde. */
@media (max-aspect-ratio: 4/3) {
  .producto-foto { flex-basis: 34%; }
  .precio { font-size: 12vw; }
  .producto-nombre { font-size: 4.2vh; }
  .reposo-titulo { font-size: 7vw; }
}
