* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui;
  background: linear-gradient(135deg, #f8f4f0, #fdfaf7);
  color: #243b55;
  padding: 16px; /* menos en móvil */
}

.container {
  max-width: 800px;
  margin: auto;
  background: white;
  border-radius: 16px; /* menos redondeo en móvil */
  padding: 20px; /* menos padding en móvil */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.encabezado {
  display: flex;
  flex-direction: column; /* en móvil: vertical */
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 600px) {
  .encabezado {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

h1 {
  color: #fa3e19;
  margin: 0;
  font-size: 24px;
}

.fecha-entrega {
  width: 100%;
}
@media (min-width: 600px) {
  .fecha-entrega {
    text-align: right;
    width: auto;
  }
}
.fecha-entrega label {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
  display: block;
}
.fecha-entrega input {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 100%;
}
@media (min-width: 600px) {
  .fecha-entrega input {
    width: 160px;
  }
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 600px) {
  .form-row {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.form-group {
  width: 100%;
}
@media (min-width: 600px) {
  .form-group {
    flex: 1;
    min-width: 180px;
  }
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
}

input, select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

/* Línea de producto + transporte */
.linea-producto-transporte {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 16px;
  align-items: stretch;
}
@media (min-width: 768px) {
  .linea-producto-transporte {
    flex-direction: row;
    gap: 24px;
    align-items: center;
  }
}

.grupo-producto {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
@media (min-width: 768px) {
  .grupo-producto {
    flex-direction: row;
    gap: 12px;
    align-items: center;
    flex: 1;
  }
}

.selector-producto, .cantidad-input {
  width: 100%;
}
@media (min-width: 768px) {
  .selector-producto {
    flex: 2;
  }
  .cantidad-input {
    flex: 0 0 100px;
    width: 100px;
  }
}

.caja-transporte {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
  width: 100%;
}
@media (min-width: 768px) {
  .caja-transporte {
    width: 200px;
  }
}

.caja-transporte .titulo-transporte {
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

/* Botones */
button {
  background: #fa3e19;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  min-height: 44px; /* tamaño táctil mínimo */
}
button:hover {
  background: #e03616;
}

#btnAgregar {
  padding: 8px 12px;
  font-size: 16px;
  height: 40px;
  min-height: 40px;
  margin-top: 0;
}
@media (min-width: 768px) {
  #btnAgregar {
    margin-top: 28px;
  }
}

/* Tabla */
table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #eee;
}
#total {
  text-align: right;
  font-size: 18px;
  font-weight: bold;
  margin: 16px 0;
}

/* Botón eliminar */
.btn-eliminar {
  background: #fa3e19;
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  font-size: 12px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-width: 28px;
  min-height: 28px;
}
.btn-eliminar:hover {
  background: #d03615;
}

/* Firma */
.firma-container {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
@media (min-width: 600px) {
  .firma-container {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
}
#firma {
  width: 100%;
  height: 80px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: crosshair;
  background: #f9fbff;
}
@media (min-width: 600px) {
  #firma {
    width: 300px;
  }
}
.acciones-firma {
  margin-top: 8px;
}

/* Transportación: checkbox + texto más unidos y centrados */
.opcion-transporte {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}
.opcion-transporte input[type="checkbox"] {
  margin: 0;
  transform: scale(1.1);
  min-width: 18px;
  min-height: 18px;
}
.opcion-transporte label {
  margin: 0;
  font-weight: normal;
  font-size: 14px;
}

.titulo-transporte {
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
}

/* Elimina estilos innecesarios */
#chk-caja, #chk-bandeja, #chk-bolsa {
  width: auto !important;
  margin-left: 0 !important;
}
.titulo-transporte1 {
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
  margin-top: -15px;
  margin-left: 0 !important;
  text-align: left;
}
@media (min-width: 768px) {
  .titulo-transporte1 {
    margin-left: 80px !important;
    text-align: right;
  }
}

#btnGenerarFactura {
  margin-bottom: 20px;
  margin-left: 0;
  font-size: 18px;
  width: 100%;
}
@media (min-width: 600px) {
  #btnGenerarFactura {
    margin-left: 50px;
    width: auto;
  }
}