body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  box-sizing: border-box;
}
.background-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: url('images/etiquetas-fondo.jpg?v=1') no-repeat center center;
  background-size: cover;
  background-color: #000;
  z-index: -1;
  filter: brightness(0.85);
}
header {
  padding: 0;
  display: block;
}
.logo {
  position: fixed;
  top: 32px;
  right: 48px;
  width: 140px;
  height: auto;
  max-width: 20vw;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 2000;
}
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 100vh;
  padding-bottom: 80px;
}
.titulo {
  font-size: 3.2rem;
  color: #fff;
  margin-bottom: 24px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.instruccion {
  font-size: 1.6rem;
  color: #f0f0f0;
  margin-bottom: 32px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.scanner-input-container {
  position: relative;
  width: 300px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
#barcode-input {
  width: 100%;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.4rem;
  text-align: center;
  padding: 8px;
  outline: none;
  letter-spacing: 1px;
}
#barcode-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
}
.scanner-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #fff;
  animation: scan 2s infinite;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}
@keyframes scan {
  0% { width: 0; }
  50% { width: 100%; }
  100% { width: 0; }
}
.codigo-barras {
  font-size: 2rem;
  margin-bottom: 6px;
  margin-top: 6px;
  color: #333;
  margin-bottom: 24px;
  text-align: center;
  font-family: monospace;
  letter-spacing: 1px;
  font-weight: 500;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}
.resultado {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 80vh;
  min-height: 160px;
  min-width: 700px;
  max-width: 900px;
  width: 90vw;
  padding: 32px 80px;
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
  z-index: 1000;
  border: 5px solid #000000;
}
.resultado.oculto {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.btn-cerrar {
  position: absolute;
  top: 15px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: #dc3545;
  color: white;
  font-size: 24px;
  font-weight: bold;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn-cerrar:hover {
  background: #c82333;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.btn-cerrar:active {
  transform: scale(0.95);
}
.nombre-articulo {
  font-size: 2.6rem;
  margin-bottom: 8px;
  margin-top: 6px;
  color: #222;
  text-align: center;
  line-height: 1.3;
}
.precio-articulo {
  font-size: 5.8rem;
  color: #dc3545;
  font-weight: bold;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.cantidad-container {
  margin: 20px 0;
  text-align: center;
}
.cantidad-label {
  font-size: 1.4rem;
  color: #666;
  margin-bottom: 10px;
  display: block;
}
.cantidad-input {
  width: 80px;
  padding: 8px 12px;
  border: 2px solid #dc3545;
  border-radius: 8px;
  font-size: 1.2rem;
  text-align: center;
  margin: 0 10px;
}
.cantidad-buttons {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.btn-cantidad {
  width: 40px;
  height: 40px;
  border: 2px solid #dc3545;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-cantidad:hover {
  background: #b02a37;
  border-color: #b02a37;
}
.btn-cantidad:disabled {
  background: #6c757d;
  border-color: #6c757d;
  cursor: not-allowed;
}

/* Botón principal personalizado */
#btn-imprimir {
  background: linear-gradient(135deg, #dc3545 0%, #8b0000 100%);
  border: none;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
  transition: all 0.3s ease;
}

#btn-imprimir:hover {
  background: linear-gradient(135deg, #c82333 0%, #6b0000 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

#btn-imprimir:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}
/* Responsive */
@media (min-width: 1200px) {
  .resultado {
    max-width: 800px;
    padding: 24px 60px;
  }
  .nombre-articulo {
    font-size: 2.2rem;
  }
  .precio-articulo {
    font-size: 4.8rem;
  }
  .codigo-barras {
    font-size: 1.6rem;
  }
}

@media (min-width: 1600px) {
  .resultado {
    max-width: 900px;
    padding: 32px 80px;
  }
  .nombre-articulo {
    font-size: 2.4rem;
  }
  .precio-articulo {
    font-size: 5.2rem;
  }
  .codigo-barras {
    font-size: 1.8rem;
  }
}

@media (max-width: 400px) {
  .background-overlay {
    background: url('images/etiquetas-fondo-vertical.jpg?v=1') no-repeat center center;
    background-size: cover;
  }
}
@media (max-width: 900px) {
  .resultado {
    min-width: 220px;
    padding: 18px 10px;
  }
  .nombre-articulo {
    font-size: 1.8rem;
  }
  .precio-articulo {
    font-size: 3.2rem;
  }
  .codigo-barras {
    font-size: 1.4rem;
  }
  .scanner-input-container {
    width: 80%;
    max-width: 300px;
  }
  main {
    padding-bottom: 60px;
  }
}
@media (max-width: 600px) {
  .resultado {
    min-width: 120px;
    padding: 10px 2px;
    width: 99vw;
    max-width: 99vw;
  }
  .nombre-articulo {
    font-size: 1.2rem;
  }
  .precio-articulo {
    font-size: 2.1rem;
  }
  .logo {
    width: 80px;
  }
  .scanner-input-container {
    width: 90%;
  }
  .codigo-barras {
    font-size: 1.2rem;
  }
  main {
    padding-bottom: 40px;
  }
  .cantidad-container {
    margin: 15px 0;
  }
  .cantidad-label {
    font-size: 1.2rem;
  }
  .cantidad-input {
    width: 60px;
    font-size: 1rem;
  }
  .btn-cantidad {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
}
@media (max-width: 1000px) and (orientation: portrait) {
  .background-overlay {
    background: url('images/etiquetas-fondo-vertical.jpg?v=1') no-repeat center center;
    background-size: cover;
  }
}
